expand_lineexpand_lineExpandLineExpandLineexpand_line (算子)

名称

expand_lineexpand_lineExpandLineExpandLineexpand_line — 从给定线开始扩大区域。

警告

expand_lineexpand_lineExpandLineExpandLineExpandLineexpand_line 已过时,仅出于向后兼容性考虑而保留。

签名

expand_line(Image : RegionExpand : Coordinate, ExpandType, RowColumn, Threshold : )

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)

void ExpandLine(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)

static void HOperatorSet.ExpandLine(HObject image, out HObject regionExpand, HTuple coordinate, HTuple expandType, HTuple rowColumn, HTuple threshold)

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

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

def expand_line(image: HObject, coordinate: int, expand_type: str, row_column: str, threshold: Union[int, float]) -> HObject

描述

expand_lineexpand_lineExpandLineExpandLineExpandLineexpand_line 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 ThresholdThresholdThresholdThresholdthresholdthreshold from the mean gray value along the line (ExpandTypeExpandTypeExpandTypeExpandTypeexpandTypeexpand_type = 'mean'"mean""mean""mean""mean""mean") or from the previously added gray value (ExpandTypeExpandTypeExpandTypeExpandTypeexpandTypeexpand_type = 'gradient'"gradient""gradient""gradient""gradient""gradient").

执行信息

参数

ImageImageImageImageimageimage (输入对象)  singlechannelimage(-array) objectHImageHObjectHImageHobject (byte)

输入图像。

RegionExpandRegionExpandRegionExpandRegionExpandregionExpandregion_expand (输出对象)  region(-array) objectHRegionHObjectHRegionHobject *

Extracted segments.

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

Row or column coordinate.

默认值: 256

建议值: 16, 64, 128, 200, 256, 300, 400, 511

限制: Coordinate >= 0

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

Stopping criterion.

默认值: 'gradient' "gradient" "gradient" "gradient" "gradient" "gradient"

值列表: 'gradient'"gradient""gradient""gradient""gradient""gradient", 'mean'"mean""mean""mean""mean""mean"

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

Segmentation mode (row or column).

默认值: 'row' "row" "row" "row" "row" "row"

值列表: 'column'"column""column""column""column""column", 'row'"row""row""row""row""row"

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

Threshold for the expansion.

默认值: 3.0

建议值: 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.0

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

最小增量: 1.0

建议增量: 1.0

示例 (C++ (HALCON 5.0-10.0))

#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);
}

示例(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++ (HALCON 5.0-10.0))

#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);
}

示例 (C++ (HALCON 5.0-10.0))

#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);
}

示例 (C++ (HALCON 5.0-10.0))

#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);
}

可能的前趋

binomial_filterbinomial_filterBinomialFilterBinomialFilterBinomialFilterbinomial_filter, gauss_filtergauss_filterGaussFilterGaussFilterGaussFiltergauss_filter, smooth_imagesmooth_imageSmoothImageSmoothImageSmoothImagesmooth_image, anisotropic_diffusionanisotropic_diffusionAnisotropicDiffusionAnisotropicDiffusionAnisotropicDiffusionanisotropic_diffusion, median_imagemedian_imageMedianImageMedianImageMedianImagemedian_image, affine_trans_imageaffine_trans_imageAffineTransImageAffineTransImageAffineTransImageaffine_trans_image, rotate_imagerotate_imageRotateImageRotateImageRotateImagerotate_image

可能的后继

intersectionintersectionIntersectionIntersectionIntersectionintersection, openingopeningOpeningOpeningOpeningopening, closingclosingClosingClosingClosingclosing

替代

regiongrowing_meanregiongrowing_meanRegiongrowingMeanRegiongrowingMeanRegiongrowingMeanregiongrowing_mean, expand_grayexpand_grayExpandGrayExpandGrayExpandGrayexpand_gray, expand_gray_refexpand_gray_refExpandGrayRefExpandGrayRefExpandGrayRefexpand_gray_ref

模块

基础