Skip to content

expand_lineExpandLineExpandLineexpand_lineexpand_line🔗

Short description🔗

expand_lineExpandLineExpandLineexpand_lineexpand_line — Expand a region starting at a given line.

Warning🔗

expand_lineExpandLine is obsolete and is only provided for reasons of backward compatibility.

Signature🔗

expand_line( image Image, out region RegionExpand, integer Coordinate, string ExpandType, string RowColumn, number Threshold )void ExpandLine( const HObject& Image, HObject* RegionExpand, const HTuple& Coordinate, const HTuple& ExpandType, const HTuple& RowColumn, const HTuple& Threshold )static void HOperatorSet.ExpandLine( HObject image, out HObject regionExpand, HTuple coordinate, HTuple expandType, HTuple rowColumn, HTuple threshold )def expand_line( image: HObject, coordinate: int, expand_type: str, row_column: str, threshold: Union[int, float] ) -> HObject

Herror expand_line( const Hobject Image, Hobject* RegionExpand, const Hlong Coordinate, const char* ExpandType, const char* RowColumn, double Threshold )

Herror T_expand_line( const Hobject Image, Hobject* RegionExpand, const Htuple Coordinate, const Htuple ExpandType, const Htuple RowColumn, const Htuple Threshold )

HRegion HImage::ExpandLine( Hlong Coordinate, const HString& ExpandType, const HString& RowColumn, const HTuple& Threshold ) const

HRegion HImage::ExpandLine( Hlong Coordinate, const HString& ExpandType, const HString& RowColumn, double Threshold ) const

HRegion HImage::ExpandLine( Hlong Coordinate, const char* ExpandType, const char* RowColumn, double Threshold ) const

HRegion HImage::ExpandLine( Hlong Coordinate, const wchar_t* ExpandType, const wchar_t* RowColumn, double Threshold ) const (Windows only)

HRegion HImage.ExpandLine( int coordinate, string expandType, string rowColumn, HTuple threshold )

HRegion HImage.ExpandLine( int coordinate, string expandType, string rowColumn, double threshold )

Description🔗

expand_lineExpandLine generates a region by expansion, starting at a given line (row or column). The expansion is terminated when the current gray value differs by more than Thresholdthresholdthreshold from the mean gray value along the line (ExpandTypeexpandTypeexpand_type = 'mean'"mean") or from the previously added gray value (ExpandTypeexpandTypeexpand_type = 'gradient'"gradient").

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.

Parameters🔗

Imageimageimage (input_object) singlechannelimage(-array) → object (byte)HObject (byte)HImage (byte)HObject (byte)Hobject (byte)

Input image.

RegionExpandregionExpandregion_expand (output_object) region(-array) → objectHObjectHRegionHObjectHobject *

Extracted segments.

Coordinatecoordinatecoordinate (input_control) integer → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Row or column coordinate.

Default: 256256
Suggested values: 16, 64, 128, 200, 256, 300, 400, 51116, 64, 128, 200, 256, 300, 400, 511
Restriction: Coordinate >= 0

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

Stopping criterion.

Default: 'gradient'"gradient"
List of values: 'gradient', 'mean'"gradient", "mean"

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

Segmentation mode (row or column).

Default: 'row'"row"
List of values: 'column', 'row'"column", "row"

Thresholdthresholdthreshold (input_control) number → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)Union[int, float]Htuple (double / Hlong)

Threshold for the expansion.

Default: 3.03.0
Suggested values: 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 13.0, 17.0, 20.0, 30.00.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 13.0, 17.0, 20.0, 30.0
Value range: 0 ≤ Threshold ≤ 255 (lin)
Minimum increment: 1.0
Recommended increment: 1.0

Example🔗

(C)

read_image(&Image,"fabrik")\;
gauss_filter(Image,&Gauss,5)\;
expand_line(Gauss,&Reg,100,"mean","row",5.0)\;
set_colored(WindowHandle,12)\;
disp_region(Maxima,WindowHandle)\;
(C++)
#include "HIOStream.h"
#if !defined(USE_IOSTREAM_H)
using namespace std\;
#endif
#include "HalconCpp.h"
using namespace Halcon\;

int main (int argc, char *argv[])
{
  HImage   image (argv[1]),
           gauss\;
  HWindow  win\;
 win.SetDraw ("margin")\;
  win.SetColored (12)\;
 image.Display (win)\;
 gauss = image.GaussImage (5)\;
 HRegionArray reg = gauss.ExpandLine (100, "mean", "row", 5.0)\;
 reg.Display (win)\;
  win.Click ()\;
 return (0)\;
}

Combinations with other operators🔗

Combinations

Possible predecessors

binomial_filterBinomialFilter, gauss_filterGaussFilter, smooth_imageSmoothImage, anisotropic_diffusionAnisotropicDiffusion, median_imageMedianImage, affine_trans_imageAffineTransImage, rotate_imageRotateImage

Possible successors

intersectionIntersection, openingOpening, closingClosing

Alternatives

regiongrowing_meanRegiongrowingMean, expand_grayExpandGray, expand_gray_refExpandGrayRef

Module🔗

Foundation