measure_threshT_measure_threshMeasureThreshMeasureThreshmeasure_thresh (算子)

名称

measure_threshT_measure_threshMeasureThreshMeasureThreshmeasure_thresh — 沿矩形或环形弧提取具有特定灰度值的点。

签名

measure_thresh(Image : : MeasureHandle, Sigma, Threshold, Select : RowThresh, ColumnThresh, Distance)

Herror T_measure_thresh(const Hobject Image, const Htuple MeasureHandle, const Htuple Sigma, const Htuple Threshold, const Htuple Select, Htuple* RowThresh, Htuple* ColumnThresh, Htuple* Distance)

void MeasureThresh(const HObject& Image, const HTuple& MeasureHandle, const HTuple& Sigma, const HTuple& Threshold, const HTuple& Select, HTuple* RowThresh, HTuple* ColumnThresh, HTuple* Distance)

void HMeasure::MeasureThresh(const HImage& Image, double Sigma, double Threshold, const HString& Select, HTuple* RowThresh, HTuple* ColumnThresh, HTuple* Distance) const

void HMeasure::MeasureThresh(const HImage& Image, double Sigma, double Threshold, const char* Select, HTuple* RowThresh, HTuple* ColumnThresh, HTuple* Distance) const

void HMeasure::MeasureThresh(const HImage& Image, double Sigma, double Threshold, const wchar_t* Select, HTuple* RowThresh, HTuple* ColumnThresh, HTuple* Distance) const   ( Windows only)

void HImage::MeasureThresh(const HMeasure& MeasureHandle, double Sigma, double Threshold, const HString& Select, HTuple* RowThresh, HTuple* ColumnThresh, HTuple* Distance) const

void HImage::MeasureThresh(const HMeasure& MeasureHandle, double Sigma, double Threshold, const char* Select, HTuple* RowThresh, HTuple* ColumnThresh, HTuple* Distance) const

void HImage::MeasureThresh(const HMeasure& MeasureHandle, double Sigma, double Threshold, const wchar_t* Select, HTuple* RowThresh, HTuple* ColumnThresh, HTuple* Distance) const   ( Windows only)

static void HOperatorSet.MeasureThresh(HObject image, HTuple measureHandle, HTuple sigma, HTuple threshold, HTuple select, out HTuple rowThresh, out HTuple columnThresh, out HTuple distance)

void HMeasure.MeasureThresh(HImage image, double sigma, double threshold, string select, out HTuple rowThresh, out HTuple columnThresh, out HTuple distance)

void HImage.MeasureThresh(HMeasure measureHandle, double sigma, double threshold, string select, out HTuple rowThresh, out HTuple columnThresh, out HTuple distance)

def measure_thresh(image: HObject, measure_handle: HHandle, sigma: float, threshold: float, select: str) -> Tuple[Sequence[float], Sequence[float], Sequence[float]]

描述

measure_threshmeasure_threshMeasureThreshMeasureThreshMeasureThreshmeasure_thresh extracts points for which the gray value within an one-dimensional gray value profile is equal to the specified threshold ThresholdThresholdThresholdThresholdthresholdthreshold. The gray value profile is projected onto the major axis of the measure rectangle which is passed with the parameter MeasureHandleMeasureHandleMeasureHandleMeasureHandlemeasureHandlemeasure_handle, so the threshold points calculated within the gray value profile correspond to certain image coordinates on the rectangle's major axis. These coordinates are returned as the operator results in RowThreshRowThreshRowThreshRowThreshrowThreshrow_thresh and ColumnThreshColumnThreshColumnThreshColumnThreshcolumnThreshcolumn_thresh

For an explanation of the concept of 1D measuring see the introduction of chapter 一维测量

If the gray value profile intersects the threshold line for several times, the parameter SelectSelectSelectSelectselectselect determines which values to return. Possible settings are 'first'"first""first""first""first""first", 'last'"last""last""last""last""last", 'first_last'"first_last""first_last""first_last""first_last""first_last" (first and last) or 'all'"all""all""all""all""all". For the last two cases DistanceDistanceDistanceDistancedistancedistance returns the distances between the calculated points.

The gray value profile is created by averaging the gray values along all line segments, which are defined by the measure rectangle as follows:

  1. The segments are perpendicular to the major axis of the rectangle,

  2. they have an integer distance to the center of the rectangle,

  3. the rectangle bounds the segments.

For every line segment, the average of the gray values of all points with an integer distance to the major axis is calculated. Due to translation and rotation of the measure rectangle with respect to the image coordinates the input image ImageImageImageImageimageimage is in general sampled at subpixel positions.

Since this involves some calculations which can be used repeatedly in several projections, the operator gen_measure_rectangle2gen_measure_rectangle2GenMeasureRectangle2GenMeasureRectangle2GenMeasureRectangle2gen_measure_rectangle2 is used to perform these calculations only once in advance. Here, the measure object MeasureHandleMeasureHandleMeasureHandleMeasureHandlemeasureHandlemeasure_handle is generated and different interpolation schemes can be selected.

注意

measure_threshmeasure_threshMeasureThreshMeasureThreshMeasureThreshmeasure_thresh only returns meaningful results if the assumptions that the edges are straight and perpendicular to the major axis of the rectangle are fulfilled. Thus, it should not be used to extract edges from curved objects, for example. Furthermore, the user should ensure that the rectangle is as close to perpendicular as possible to the edges in the image. Additionally, SigmaSigmaSigmaSigmasigmasigma must not become larger than approx. 0.5 * Length1 (for Length1 see gen_measure_rectangle2gen_measure_rectangle2GenMeasureRectangle2GenMeasureRectangle2GenMeasureRectangle2gen_measure_rectangle2).

It should be kept in mind that measure_threshmeasure_threshMeasureThreshMeasureThreshMeasureThreshmeasure_thresh ignores the domain of ImageImageImageImageimageimage for efficiency reasons. If certain regions in the image should be excluded from the measurement a new measure object with appropriately modified parameters should be generated.

执行信息

参数

ImageImageImageImageimageimage (输入对象)  singlechannelimage objectHImageHObjectHImageHobject (byte / uint2 / real)

输入图像。

MeasureHandleMeasureHandleMeasureHandleMeasureHandlemeasureHandlemeasure_handle (输入控制)  measure HMeasure, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Measure object handle.

SigmaSigmaSigmaSigmasigmasigma (输入控制)  number HTuplefloatHTupleHtuple (real) (double) (double) (double)

Sigma of gaussian smoothing.

默认值: 1.0

建议值: 0.0, 0.4, 0.6, 0.8, 1.0, 1.5, 2.0, 3.0, 4.0, 5.0, 7.0, 10.0

值范围: 0.0 ≤ Sigma Sigma Sigma Sigma sigma sigma ≤ 100 (lin)

最小增量: 0.01

建议增量: 0.1

ThresholdThresholdThresholdThresholdthresholdthreshold (输入控制)  number HTuplefloatHTupleHtuple (real) (double) (double) (double)

Threshold.

默认值: 128.0

值范围: 0 ≤ Threshold Threshold Threshold Threshold threshold threshold ≤ 255 (lin)

最小增量: 0.5

建议增量: 1

SelectSelectSelectSelectselectselect (输入控制)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Selection of points.

默认值: 'all' "all" "all" "all" "all" "all"

值列表: 'all'"all""all""all""all""all", 'first'"first""first""first""first""first", 'first_last'"first_last""first_last""first_last""first_last""first_last", 'last'"last""last""last""last""last"

RowThreshRowThreshRowThreshRowThreshrowThreshrow_thresh (输出控制)  point.y-array HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

Row coordinates of points with threshold value.

ColumnThreshColumnThreshColumnThreshColumnThreshcolumnThreshcolumn_thresh (输出控制)  point.x-array HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

Column coordinates of points with threshold value.

DistanceDistanceDistanceDistancedistancedistance (输出控制)  real-array HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

Distance between consecutive points.

结果

如果参数值正确,算子 measure_threshmeasure_threshMeasureThreshMeasureThreshMeasureThreshmeasure_thresh 返回值 2 ( H_MSG_TRUE )。否则,将抛出异常。

可能的前趋

gen_measure_rectangle2gen_measure_rectangle2GenMeasureRectangle2GenMeasureRectangle2GenMeasureRectangle2gen_measure_rectangle2

可能的后继

close_measureclose_measureCloseMeasureCloseMeasureCloseMeasureclose_measure

替代

measure_posmeasure_posMeasurePosMeasurePosMeasurePosmeasure_pos, edges_sub_pixedges_sub_pixEdgesSubPixEdgesSubPixEdgesSubPixedges_sub_pix, measure_pairsmeasure_pairsMeasurePairsMeasurePairsMeasurePairsmeasure_pairs

模块

一维计量