Skip to content

robinson_dirRobinsonDirRobinsonDirrobinson_dirrobinson_dir🔗

Short description🔗

robinson_dirRobinsonDirRobinsonDirrobinson_dirrobinson_dir — Detect edges (amplitude and direction) using the Robinson operator.

Signature🔗

robinson_dir( image Image, out image ImageEdgeAmp, out image ImageEdgeDir )void RobinsonDir( const HObject& Image, HObject* ImageEdgeAmp, HObject* ImageEdgeDir )static void HOperatorSet.RobinsonDir( HObject image, out HObject imageEdgeAmp, out HObject imageEdgeDir )def robinson_dir( image: HObject ) -> Tuple[HObject, HObject]

Herror robinson_dir( const Hobject Image, Hobject* ImageEdgeAmp, Hobject* ImageEdgeDir )

Herror T_robinson_dir( const Hobject Image, Hobject* ImageEdgeAmp, Hobject* ImageEdgeDir )

HImage HImage::RobinsonDir( HImage* ImageEdgeDir ) const

HImage HImage.RobinsonDir( out HImage imageEdgeDir )

Description🔗

robinson_dirRobinsonDir calculates an approximation of the first derivative of the image data and is used as an edge detector. In robinson_ampRobinsonAmp the following four of the originally proposed eight 3x3 filter masks are convolved with the image. The other four masks are obtained by a multiplication by -1. All masks contain only the values 0,1,-1,2,-2.

       -1   0   1                2   1   0
       -2   0   2                1   0  -1
       -1   0   1                0  -1  -2

        0   1   2                1   2   1
       -1   0   1                0   0   0
       -2  -1   0               -1  -2  -1

The result image contains the maximum response of all masks. The edge directions are returned in ImageEdgeDirimageEdgeDirimage_edge_dir, and are stored as \(x / 2\). They correspond to the direction of the mask yielding the maximum response.

Attention🔗

Note that filter operators may return unexpected results if an image with a reduced domain is used as input. Please refer to the chapter Filters.

Execution information🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Automatically parallelized on tuple level.

  • Automatically parallelized on channel level.

  • Automatically parallelized on domain level.

Parameters🔗

Imageimageimage (input_object) (multichannel-)image(-array) → object (byte / int2 / uint2)HObject (byte / int2 / uint2)HImage (byte / int2 / uint2)HObject (byte / int2 / uint2)Hobject (byte / int2 / uint2)

Input image.

ImageEdgeAmpimageEdgeAmpimage_edge_amp (output_object) (multichannel-)image(-array) → object (byte / int2 / uint2)HObject (byte / int2 / uint2)HImage (byte / int2 / uint2)HObject (byte / int2 / uint2)Hobject * (byte / int2 / uint2)

Edge amplitude (gradient magnitude) image.

ImageEdgeDirimageEdgeDirimage_edge_dir (output_object) (multichannel-)image(-array) → object (direction)HObject (direction)HImage (direction)HObject (direction)Hobject * (direction)

Edge direction image.

Example🔗

(HDevelop)

read_image(Image,'fabrik')
robinson_dir(Image,Robinson_dirA,Robinson_dirD)
threshold(Robinson_dirA,Res,128,255)
(C)
read_image(&Image,"fabrik")\;
robinson_dir(Image,&Robinson_dirA,&Robinson_dirD)\;
threshold(Robinson_dirA,&Res,128,255)\;

Result🔗

robinson_dirRobinsonDir always returns 2 (H_MSG_TRUE). If the input is empty the behavior can be set via set_system('no_object_result',<Result>). If necessary, an exception is raised.

Combinations with other operators🔗

Combinations

Possible predecessors

binomial_filterBinomialFilter, gauss_filterGaussFilter, sigma_imageSigmaImage, median_imageMedianImage, smooth_imageSmoothImage

Possible successors

hysteresis_thresholdHysteresisThreshold, thresholdThreshold, gray_skeletonGraySkeleton, nonmax_suppression_dirNonmaxSuppressionDir, close_edgesCloseEdges, close_edges_lengthCloseEdgesLength

Alternatives

edges_imageEdgesImage, sobel_dirSobelDir, kirsch_dirKirschDir, prewitt_dirPrewittDir, frei_dirFreiDir

See also

bandpass_imageBandpassImage, laplace_of_gaussLaplaceOfGauss

Module🔗

Foundation