Skip to content

robertsRobertsRobertsrobertsrobertsšŸ”—

Short descriptionšŸ”—

robertsRobertsRobertsrobertsroberts — Detect edges using the Roberts filter.

SignaturešŸ”—

roberts( image Image, out image ImageRoberts, string FilterType )void Roberts( const HObject& Image, HObject* ImageRoberts, const HTuple& FilterType )static void HOperatorSet.Roberts( HObject image, out HObject imageRoberts, HTuple filterType )def roberts( image: HObject, filter_type: str ) -> HObject

Herror roberts( const Hobject Image, Hobject* ImageRoberts, const char* FilterType )

Herror T_roberts( const Hobject Image, Hobject* ImageRoberts, const Htuple FilterType )

HImage HImage::Roberts( const HString& FilterType ) const

HImage HImage::Roberts( const char* FilterType ) const

HImage HImage::Roberts( const wchar_t* FilterType ) const (Windows only)

HImage HImage.Roberts( string filterType )

DescriptionšŸ”—

robertsRoberts calculates the first derivative of an image and is used as an edge operator. If the following mask describes a part of the image,

                          A               B

                          C               D

the different filter types are defined as follows:

     'roberts_max'     max(| A - D |,| B - C |)
     'gradient_max'    max(| A + B - (C + D)|,| A + C - (B + D)|)
     'gradient_sum'    |A + B - (C + D)| + |A + C - (B + D)|

If an overflow occurs the result is clipped. The result of the operator is stored at the pixel with the coordinates of ā€œDā€.

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.

ImageRobertsimageRobertsimage_roberts (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)

Roberts-filtered result images.

FilterTypefilterTypefilter_type (input_control) string → (string)HTuple (HString)HTuple (string)strHtuple (char*)

Filter type.

Default: 'gradient_sum'"gradient_sum"
List of values: 'gradient_max', 'gradient_sum', 'roberts_max'"gradient_max", "gradient_sum", "roberts_max"

ExamplešŸ”—

(HDevelop)

read_image(Image,'fabrik')
roberts(Image,Roberts,'roberts_max')
threshold(Roberts,Margin,128,255)
(C)
read_image(&Image,"fabrik")\;
roberts(Image,&Roberts,"roberts_max")\;
threshold(Roberts,&Margin,128.0,255.0)\;

ResultšŸ”—

robertsRoberts returns 2 (H_MSG_TRUE) if all parameters are correct. 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

Possible successors

thresholdThreshold, skeletonSkeleton

Alternatives

edges_imageEdgesImage, sobel_ampSobelAmp, frei_ampFreiAmp, kirsch_ampKirschAmp, prewitt_ampPrewittAmp

See also

laplaceLaplace, highpass_imageHighpassImage, bandpass_imageBandpassImage

ModulešŸ”—

Foundation