Skip to content

points_sojkaPointsSojkaPointsSojkapoints_sojkaT_points_sojkaπŸ”—

Short descriptionπŸ”—

points_sojkaPointsSojkaPointsSojkapoints_sojkaT_points_sojka β€” Find corners using the Sojka operator.

SignatureπŸ”—

points_sojka( image Image, integer MaskSize, number SigmaW, number SigmaD, number MinGrad, number MinApparentness, angle.rad MinAngle, string Subpix, out point.y Row, out point.x Column )void PointsSojka( const HObject& Image, const HTuple& MaskSize, const HTuple& SigmaW, const HTuple& SigmaD, const HTuple& MinGrad, const HTuple& MinApparentness, const HTuple& MinAngle, const HTuple& Subpix, HTuple* Row, HTuple* Column )static void HOperatorSet.PointsSojka( HObject image, HTuple maskSize, HTuple sigmaW, HTuple sigmaD, HTuple minGrad, HTuple minApparentness, HTuple minAngle, HTuple subpix, out HTuple row, out HTuple column )def points_sojka( image: HObject, mask_size: int, sigma_w: Union[float, int], sigma_d: Union[float, int], min_grad: Union[int, float], min_apparentness: Union[int, float], min_angle: float, subpix: str ) -> Tuple[Sequence[float], Sequence[float]]

Herror T_points_sojka( const Hobject Image, const Htuple MaskSize, const Htuple SigmaW, const Htuple SigmaD, const Htuple MinGrad, const Htuple MinApparentness, const Htuple MinAngle, const Htuple Subpix, Htuple* Row, Htuple* Column )

void HImage::PointsSojka( Hlong MaskSize, const HTuple& SigmaW, const HTuple& SigmaD, const HTuple& MinGrad, const HTuple& MinApparentness, double MinAngle, const HString& Subpix, HTuple* Row, HTuple* Column ) const

void HImage::PointsSojka( Hlong MaskSize, double SigmaW, double SigmaD, double MinGrad, double MinApparentness, double MinAngle, const HString& Subpix, HTuple* Row, HTuple* Column ) const

void HImage::PointsSojka( Hlong MaskSize, double SigmaW, double SigmaD, double MinGrad, double MinApparentness, double MinAngle, const char* Subpix, HTuple* Row, HTuple* Column ) const

void HImage::PointsSojka( Hlong MaskSize, double SigmaW, double SigmaD, double MinGrad, double MinApparentness, double MinAngle, const wchar_t* Subpix, HTuple* Row, HTuple* Column ) const (Windows only)

void HImage.PointsSojka( int maskSize, HTuple sigmaW, HTuple sigmaD, HTuple minGrad, HTuple minApparentness, double minAngle, string subpix, out HTuple row, out HTuple column )

void HImage.PointsSojka( int maskSize, double sigmaW, double sigmaD, double minGrad, double minApparentness, double minAngle, string subpix, out HTuple row, out HTuple column )

DescriptionπŸ”—

points_sojkaPointsSojka defines a corner as the point of intersection of two straight, non-collinear gray value edges. To decide whether a point of the input image Imageimageimage is a corner or not, a neighborhood of MaskSizeΒ x MaskSize points is inspected. Only those image regions that are relevant for the decision are considered. Pixels with a magnitude of the gradient of less than MinGradminGradmin_grad are ignored from the outset.

Furthermore, only those of the remaining points are used that belong to one of the two gray value edges that form the corner. For this, the so called Apparentness is calculated, which is an indicator of the probability that the examined point actually is a corner point. Essentially, it is determined by the number of relevant points and their gradients. A point can only be accepted as a corner when its Apparentness is at least MinApparentnessminApparentnessmin_apparentness. Typical values of MinApparentnessminApparentnessmin_apparentness should range in the region of a few multiples of MinGradminGradmin_grad.

To calculate the Apparentness, each mask point is weighted according to two criteria: First, the influence of a mask point is weighted with a Gaussian of size SigmaWsigmaWsigma_w according to its distance from the possible corner point. SigmaWsigmaWsigma_w should be roughly between quarter and half of MaskSizemaskSizemask_size to obtain a reasonable proportion of the size of the weighting function to the mask size. Secondly, the distance of the point from the (assumed) ideal gray value edge is estimated and the point is weighted with a Gaussian of size SigmaDsigmaDsigma_d according to that distance. I.e., pixels that (due to the discretization of the input image) lie farther from the ideal gray value edge have less influence on the result than pixels with a smaller distance. Typically, it is not necessary to modify the default value 0.750.75 of SigmaDsigmaDsigma_d .

As a further criterion, the angle is calculated, by which the gray value edges change their direction in the corner point. A point can only be accepted as a corner when this angle is greater than MinAngleminAnglemin_angle.

The position of the detected corner points is returned in (Rowrowrow, Columncolumncolumn). Rowrowrow and Columncolumncolumn are calculated with subpixel accuracy if Subpixsubpixsubpix is 'true'"true". They are calculated only with pixel accuracy if Subpixsubpixsubpix is 'false'"false".

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).

  • Processed without parallelization.

ParametersπŸ”—

Imageimageimage (input_object) singlechannelimage β†’ object (byte / int1 / int2 / uint2 / int4 / real)HObject (byte / int1 / int2 / uint2 / int4 / real)HImage (byte / int1 / int2 / uint2 / int4 / real)HObject (byte / int1 / int2 / uint2 / int4 / real)Hobject (byte / int1 / int2 / uint2 / int4 / real)

Input image.

MaskSizemaskSizemask_size (input_control) integer β†’ (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Required filter size.

Default: 99
List of values: 5, 7, 9, 11, 135, 7, 9, 11, 13

SigmaWsigmaWsigma_w (input_control) number β†’ (real / integer)HTuple (double / Hlong)HTuple (double / int / long)Union[float, int]Htuple (double / Hlong)

Sigma of the weight function according to the distance to the corner candidate.

Default: 2.52.5
Suggested values: 2.0, 2.2, 2.4, 2.5, 2.6, 2.8, 3.02.0, 2.2, 2.4, 2.5, 2.6, 2.8, 3.0
Restriction: 2.0 <=SigmaW && SigmaW <= 3.0

SigmaDsigmaDsigma_d (input_control) number β†’ (real / integer)HTuple (double / Hlong)HTuple (double / int / long)Union[float, int]Htuple (double / Hlong)

Sigma of the weight function for the distance to the ideal gray value edge.

Default: 0.750.75
Suggested values: 0.6, 0.7, 0.75, 0.8, 0.9, 1.00.6, 0.7, 0.75, 0.8, 0.9, 1.0
Restriction: 0.6 <=SigmaD && SigmaD <= 1.0

MinGradminGradmin_grad (input_control) number β†’ (real / integer)HTuple (double / Hlong)HTuple (double / int / long)Union[int, float]Htuple (double / Hlong)

Threshold for the magnitude of the gradient.

Default: 30.030.0
Suggested values: 20.0, 15.0, 30.0, 35.0, 40.020.0, 15.0, 30.0, 35.0, 40.0

MinApparentnessminApparentnessmin_apparentness (input_control) number β†’ (real / integer)HTuple (double / Hlong)HTuple (double / int / long)Union[int, float]Htuple (double / Hlong)

Threshold for Apparentness.

Default: 90.090.0
Suggested values: 30.0, 60.0, 90.0, 150.0, 300.0, 600.0, 1500.030.0, 60.0, 90.0, 150.0, 300.0, 600.0, 1500.0

MinAngleminAnglemin_angle (input_control) angle.rad β†’ (real)HTuple (double)HTuple (double)floatHtuple (double)

Threshold for the direction change in a corner point (radians).

Default: 0.50.5
Restriction: (0.0 <= MinAngle) && (MinAngle <= pi)

Subpixsubpixsubpix (input_control) string β†’ (string)HTuple (HString)HTuple (string)strHtuple (char*)

Subpixel precise calculation of the corner points.

Default: 'false'"false"
List of values: 'false', 'true'"false", "true"

Rowrowrow (output_control) point.y-array β†’ (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

Row coordinates of the detected corner points.

Columncolumncolumn (output_control) point.x-array β†’ (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

Column coordinates of the detected corner points.

ResultπŸ”—

points_sojkaPointsSojka returns 2 (H_MSG_TRUE) if all parameters are correct and no error occurs during the execution. If the input is empty the behavior can be set via set_system('no_object_result',<Result>). If necessary, an exception is raised.

ReferencesπŸ”—

Eduard Sojka: ``A New and Efficient Algorithm for Detecting the Corners in Digital Imagesβ€™β€˜. Pattern Recognition, Luc Van Gool (Editor), LNCS 2449, pp. 125-132, Springer Verlag, 2002.

ModuleπŸ”—

Foundation