Skip to content

select_shape_protoSelectShapeProtoSelectShapeProtoselect_shape_protoselect_shape_proto🔗

説明🔗

select_shape_protoSelectShapeProtoSelectShapeProtoselect_shape_protoselect_shape_proto — 互いに関連性を持つ領域を選択する。

書式🔗

select_shape_proto( region Regions, region Pattern, out region SelectedRegions, string Feature, number Min, number Max )void SelectShapeProto( const HObject& Regions, const HObject& Pattern, HObject* SelectedRegions, const HTuple& Feature, const HTuple& Min, const HTuple& Max )static void HOperatorSet.SelectShapeProto( HObject regions, HObject pattern, out HObject selectedRegions, HTuple feature, HTuple min, HTuple max )def select_shape_proto( regions: HObject, pattern: HObject, feature: MaybeSequence[str], min: Union[int, float], max: Union[int, float] ) -> HObject

Herror select_shape_proto( const Hobject Regions, const Hobject Pattern, Hobject* SelectedRegions, const char* Feature, double Min, double Max )

Herror T_select_shape_proto( const Hobject Regions, const Hobject Pattern, Hobject* SelectedRegions, const Htuple Feature, const Htuple Min, const Htuple Max )

HRegion HRegion::SelectShapeProto( const HRegion& Pattern, const HTuple& Feature, const HTuple& Min, const HTuple& Max ) const

HRegion HRegion::SelectShapeProto( const HRegion& Pattern, const HString& Feature, double Min, double Max ) const

HRegion HRegion::SelectShapeProto( const HRegion& Pattern, const char* Feature, double Min, double Max ) const

HRegion HRegion::SelectShapeProto( const HRegion& Pattern, const wchar_t* Feature, double Min, double Max ) const (Windows only)

HRegion HRegion.SelectShapeProto( HRegion pattern, HTuple feature, HTuple min, HTuple max )

HRegion HRegion.SelectShapeProto( HRegion pattern, string feature, double min, double max )

説明🔗

オペレーター select_shape_protoSelectShapeProto は、互いにある関連性を持 つ 2 つの領域を選択します。Regionsregionsregions のすべての領 域は Patternpatternpattern の領域の結合と比較されます。限度( Minminmin と Maxmaxmax)は特徴に依存して、絶対値またはパーセ ント(0 .. 100)で指示されます。Featurefeaturefeature に対して設定可能な値 は以下のとおりです。

実行情報🔗

実行情報
  • マルチスレッドタイプ: リエントラント(非排他なオペレーターと並列に動作)

  • マルチスレッドスコープ: グローバル(他のスレッドから呼び出される可能性あり)

  • 並列演算処理には未対応

パラメーター🔗

Regionsregionsregions (input_object) region(-array) → objectHObjectHRegionHObjectHobject

対象となる領域

Patternpatternpattern (input_object) region(-array) → objectHObjectHRegionHObjectHobject

Regionsregionsregions と比較される領域

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

結果として選択された領域

Featurefeaturefeature (input_control) string(-array) → (string)HTuple (HString)HTuple (string)MaybeSequence[str]Htuple (char*)

チェックする形状特徴

初期値: 'covers'"covers"
値のリスト: 'covers', 'distance_center', 'distance_contour', 'distance_dilate', 'fits', 'overlaps_abs', 'overlaps_rel'"covers", "distance_center", "distance_contour", "distance_dilate", "fits", "overlaps_abs", "overlaps_rel"

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

特徴の下限

初期値: 50.050.0
推奨値: 0.0, 1.0, 5.0, 10.0, 20.0, 30.0, 50.0, 60.0, 70.0, 80.0, 90.0, 95.0, 99.0, 100.0, 200.0, 400.00.0, 1.0, 5.0, 10.0, 20.0, 30.0, 50.0, 60.0, 70.0, 80.0, 90.0, 95.0, 99.0, 100.0, 200.0, 400.0
値域: 0.0 ≤ Min
最小増分: 0.001
推奨増分: 5.0

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

特徴の上限

初期値: 100.0100.0
推奨値: 0.0, 10.0, 20.0, 30.0, 50.0, 60.0, 70.0, 80.0, 90.0, 95.0, 99.0, 100.0, 200.0, 300.0, 400.00.0, 10.0, 20.0, 30.0, 50.0, 60.0, 70.0, 80.0, 90.0, 95.0, 99.0, 100.0, 200.0, 300.0, 400.0
値域: 0.0 ≤ Max
最小増分: 0.001
推奨増分: 5.0

例🔗

(C)

regiongrowing(Image,&Seg,3,3,5.0,0)\;
gen_circle(&C,100.0,100.0,MinRadius)\;
select_shape_proto(Seg,C,"fits",0.0,0.0)\;
(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[])
{
  if (argc < 2)
  {
    cout << "Usage: " << argv[0] << " <radius of circle>" << endl\;
    exit (1)\;
  }
 double   rad = atof (argv[1])\;
  HImage   img ("monkey")\;
  HWindow  w\;
 img.Display (w)\;
 HRegion       circ = HRegion::GenCircle (100, 100, rad)\;
  HRegionArray  reg  = img.Regiongrowing (3, 3, 5, 0)\;
  HRegionArray  seg  = reg.SelectShapeProto (circ, "fits", 0, 0)\;
 w.SetColor  ("red")\;
  seg.Display (w)\;
  w.Click ()\;
  return(0)\;
}

結果🔗

入力が空でない場合、オペレーター select_shape_protoSelectShapeProto は、 値 2 (H_MSG_TRUE) を返します。入力が空だった場合(入力画像が得られない場合) の動作は、オペレーター set_system('no_object_result',<Result>) で設定されます。空 の領域の場合(領域が空集合である場合)の動作は、オペレーター set_system('empty_region_result',<Result>) を通して設定さ れます。必要に応じて、例外が発生します。

他のオペレーターとの組み合わせ🔗

組み合わせ

前処理の候補

connectionConnection, draw_regionDrawRegion, gen_circleGenCircle, gen_rectangle1GenRectangle1, gen_rectangle2GenRectangle2, gen_ellipseGenEllipse

後処理の候補

select_graySelectGray, shape_transShapeTrans, reduce_domainReduceDomain, count_objCountObj

他の選択候補

select_shapeSelectShape

関連項目

openingOpening, erosion1Erosion1, distance_rr_min_dilDistanceRrMinDil, distance_rr_minDistanceRrMin

モジュール🔗

Foundation