lines_facetlines_facetLinesFacetLinesFacetlines_facet (算子)

名称

lines_facetlines_facetLinesFacetLinesFacetlines_facet — 使用小面模型检测线。

签名

lines_facet(Image : Lines : MaskSize, Low, High, LightDark : )

Herror lines_facet(const Hobject Image, Hobject* Lines, const Hlong MaskSize, double Low, double High, const char* LightDark)

Herror T_lines_facet(const Hobject Image, Hobject* Lines, const Htuple MaskSize, const Htuple Low, const Htuple High, const Htuple LightDark)

void LinesFacet(const HObject& Image, HObject* Lines, const HTuple& MaskSize, const HTuple& Low, const HTuple& High, const HTuple& LightDark)

HXLDCont HImage::LinesFacet(Hlong MaskSize, const HTuple& Low, const HTuple& High, const HString& LightDark) const

HXLDCont HImage::LinesFacet(Hlong MaskSize, double Low, double High, const HString& LightDark) const

HXLDCont HImage::LinesFacet(Hlong MaskSize, double Low, double High, const char* LightDark) const

HXLDCont HImage::LinesFacet(Hlong MaskSize, double Low, double High, const wchar_t* LightDark) const   ( Windows only)

static void HOperatorSet.LinesFacet(HObject image, out HObject lines, HTuple maskSize, HTuple low, HTuple high, HTuple lightDark)

HXLDCont HImage.LinesFacet(int maskSize, HTuple low, HTuple high, string lightDark)

HXLDCont HImage.LinesFacet(int maskSize, double low, double high, string lightDark)

def lines_facet(image: HObject, mask_size: int, low: Union[float, int], high: Union[float, int], light_dark: str) -> HObject

描述

算子 lines_facetlines_facetLinesFacetLinesFacetLinesFacetlines_facet can be used to extract lines (curvilinear structures) from the image ImageImageImageImageimageimage. The extracted lines are returned in LinesLinesLinesLineslineslines as subpixel precise XLD-contours. The parameter LightDarkLightDarkLightDarkLightDarklightDarklight_dark determines, whether bright or dark lines are extracted.

The extraction is done by using the facet model, i.e., a least squares fit, to determine the parameters of a quadratic polynomial in x and y for each point of the image. The parameter MaskSizeMaskSizeMaskSizeMaskSizemaskSizemask_size determines the size of the window used for the least squares fit. Larger values of MaskSizeMaskSizeMaskSizeMaskSizemaskSizemask_size lead to a larger smoothing of the image, but can lead to worse localization of the line. The parameters of the polynomial are used to calculate the line direction for each pixel. Pixels which exhibit a local maximum in the second directional derivative perpendicular to the line direction are marked as line points. The line points found in this manner are then linked to contours. This is done by immediately accepting line points that have a second derivative larger than HighHighHighHighhighhigh. Points that have a second derivative smaller than LowLowLowLowlowlow are rejected. All other line points are accepted if they are connected to accepted points by a connected path. This is similar to a hysteresis threshold operation with infinite path length (see hysteresis_thresholdhysteresis_thresholdHysteresisThresholdHysteresisThresholdHysteresisThresholdhysteresis_threshold). However, this function is not used internally since it does not allow the extraction of subpixel precise contours.

The gist of how to select the thresholds in the description of lines_gausslines_gaussLinesGaussLinesGaussLinesGausslines_gauss also holds for this operator. A value of Sigma = 1.5 there roughly corresponds to a MaskSizeMaskSizeMaskSizeMaskSizemaskSizemask_size of 5 here.

The extracted lines are returned in a topologically sound data structure in LinesLinesLinesLineslineslines. This means that lines are correctly split at junction points.

lines_facetlines_facetLinesFacetLinesFacetLinesFacetlines_facet defines the following attributes for each line point:

'angle'"angle""angle""angle""angle""angle"

The angle of the direction perpendicular to the line

'response'"response""response""response""response""response"

The magnitude of the second derivative

Use get_contour_attrib_xldget_contour_attrib_xldGetContourAttribXldGetContourAttribXldGetContourAttribXldget_contour_attrib_xld to obtain attribute values. See the operator reference of get_contour_attrib_xldget_contour_attrib_xldGetContourAttribXldGetContourAttribXldGetContourAttribXldget_contour_attrib_xld for further information about contour attributes.

注意

The smaller the filter size MaskSizeMaskSizeMaskSizeMaskSizemaskSizemask_size is chosen, the more short, fragmented lines will be extracted. This can lead to considerably longer execution times.

请注意,若使用域缩减后的图像作为输入,滤波器算子可能会返回意外结果。请参阅 滤波器 一章

执行信息

参数

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

输入图像。

LinesLinesLinesLineslineslines (输出对象)  xld_cont-array objectHXLDContHObjectHXLDContHobject *

Extracted lines.

MaskSizeMaskSizeMaskSizeMaskSizemaskSizemask_size (输入控制)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Size of the facet model mask.

默认值: 5

值列表: 3, 5, 7, 9, 11

LowLowLowLowlowlow (输入控制)  number HTupleUnion[float, int]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Lower threshold for the hysteresis threshold operation.

默认值: 3

建议值: 0, 0.5, 1, 2, 3, 4, 5, 8, 10

值范围: 0 ≤ Low Low Low Low low low

建议增量: 0.5

HighHighHighHighhighhigh (输入控制)  number HTupleUnion[float, int]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Upper threshold for the hysteresis threshold operation.

默认值: 8

建议值: 0, 0.5, 1, 2, 3, 4, 5, 8, 10, 12, 15, 18, 20, 25

值范围: 0 ≤ High High High High high high

建议增量: 0.5

限制: High >= Low

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

Extract bright or dark lines.

默认值: 'light' "light" "light" "light" "light" "light"

值列表: 'dark'"dark""dark""dark""dark""dark", 'light'"light""light""light""light""light"

示例(HDevelop)

* Detection of lines in an aerial image
read_image(Image,'mreut4_3')
lines_facet(Image,Lines,5,3,8,'light')
dev_display(Lines)

示例(C)

/* Detection of lines in an aerial image */
read_image(&Image,"mreut4_3");
lines_facet(Image:&Lines:5,3,8,"light");
disp_xld(Lines,WindowHandle);

示例(HDevelop)

* Detection of lines in an aerial image
read_image(Image,'mreut4_3')
lines_facet(Image,Lines,5,3,8,'light')
dev_display(Lines)

示例(HDevelop)

* Detection of lines in an aerial image
read_image(Image,'mreut4_3')
lines_facet(Image,Lines,5,3,8,'light')
dev_display(Lines)

示例(HDevelop)

* Detection of lines in an aerial image
read_image(Image,'mreut4_3')
lines_facet(Image,Lines,5,3,8,'light')
dev_display(Lines)

复杂度

Let A be the number of pixels in the domain of ImageImageImageImageimageimage. Then the runtime complexity is O(A*MaskSizeMaskSizeMaskSizeMaskSizemaskSizemask_size).

The amount of temporary memory required is dependent on the height H of the domain of ImageImageImageImageimageimage and the width W of ImageImageImageImageimageimage. Let S = W*H, then lines_facetlines_facetLinesFacetLinesFacetLinesFacetlines_facet requires at least 55*S bytes of temporary memory during execution.

结果

lines_facetlines_facetLinesFacetLinesFacetLinesFacetlines_facet 在所有参数正确且执行过程中未发生错误时返回 2 ( H_MSG_TRUE )。如果输入为空则可设置行为通过 set_system(::'no_object_result',<Result>:)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)set_system("no_object_result",<Result>)。如有必要,则抛出异常。

可能的后继

gen_polygons_xldgen_polygons_xldGenPolygonsXldGenPolygonsXldGenPolygonsXldgen_polygons_xld

替代

lines_gausslines_gaussLinesGaussLinesGaussLinesGausslines_gauss

另见

bandpass_imagebandpass_imageBandpassImageBandpassImageBandpassImagebandpass_image, dyn_thresholddyn_thresholdDynThresholdDynThresholdDynThresholddyn_threshold, topographic_sketchtopographic_sketchTopographicSketchTopographicSketchTopographicSketchtopographic_sketch

参考文献

A. Busch: “Fast Recognition of Lines in Digital Images Without User-Supplied Parameters”. In H. Ebner, C. Heipke, K.Eder, eds., “Spatial Information from Digital Photogrammetry and Computer Vision”, International Archives of Photogrammetry and Remote Sensing, Vol. 30, Part 3/1, pp. 91-97, 1994.

模块

二维计量