Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

edge_detection

edge detection (Frei_chen, LoG, Prewitt, Roberts_cross, Scharr, Sobel)


Description

edge detection (Frei_chen, LoG, Prewitt, Roberts_cross, Scharr, Sobel)

Usage

edge_detection(
  image,
  method = NULL,
  conv_mode = "same",
  approx = F,
  gaussian_dims = 5,
  sigma = 1,
  range_gauss = 2,
  laplacian_type = 1
)

Arguments

image

matrix or 3-dimensional array

method

the method should be one of 'Frei_chen', 'LoG' (Laplacian of Gaussian), 'Prewitt', 'Roberts_cross', 'Scharr', 'Sobel'

conv_mode

the convolution mode should be one of 'same', 'full'

approx

if TRUE, approximate calculation of gradient (applies to all filters except for 'LoG')

gaussian_dims

integer specifying the horizontal and vertical dimensions of the gaussian filter

sigma

float parameter sigma for the gaussian filter

range_gauss

float number specifying the range of values for the gaussian filter

laplacian_type

integer value specifying the type for the laplacian kernel (one of 1, 2, 3, 4)

Details

This function takes either a matrix or a 3-dimensional array and it performs edge detection using one of the following filters : 'Frei_chen', 'LoG' (Laplacian of Gaussian), 'Prewitt', 'Roberts_cross', 'Scharr', 'Sobel'

Value

depending on the input, either a matrix or an array

Author(s)

Lampros Mouselimis

Examples

path = system.file("tmp_images", "1.png", package = "OpenImageR")

image = readImage(path)

res = edge_detection(image, method = 'Frei_chen', conv_mode = 'same')

OpenImageR

An Image Processing Toolkit

v1.1.8
GPL-3
Authors
Lampros Mouselimis [aut, cre] (<https://orcid.org/0000-0002-8024-1546>), Sight Machine [cph] (findHOGFeatures function of the SimpleCV computer vision platform), Johannes Buchner [cph] (average_hash, dhash and phash functions of the ImageHash python library), Mohammad Haghighat [cph] (Gabor Feature Extraction), Radhakrishna Achanta [cph] (Author of the C++ code of the SLIC and SLICO algorithms (for commercial use please contact the author))
Initial release
2021-05-04

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.