Skip to content

shape_histo_allShapeHistoAllShapeHistoAllshape_histo_allT_shape_histo_all🔗

説明🔗

shape_histo_allShapeHistoAllShapeHistoAllshape_histo_allT_shape_histo_all — すべてのしきい値に沿って特徴量のヒストグラムを定義する。

書式🔗

shape_histo_all( region Region, image Image, string Feature, out histogram AbsoluteHisto, out histogram RelativeHisto )void ShapeHistoAll( const HObject& Region, const HObject& Image, const HTuple& Feature, HTuple* AbsoluteHisto, HTuple* RelativeHisto )static void HOperatorSet.ShapeHistoAll( HObject region, HObject image, HTuple feature, out HTuple absoluteHisto, out HTuple relativeHisto )def shape_histo_all( region: HObject, image: HObject, feature: str ) -> Tuple[Sequence[Union[int, float]], Sequence[float]]

Herror T_shape_histo_all( const Hobject Region, const Hobject Image, const Htuple Feature, Htuple* AbsoluteHisto, Htuple* RelativeHisto )

HTuple HRegion::ShapeHistoAll( const HImage& Image, const HString& Feature, HTuple* RelativeHisto ) const

HTuple HRegion::ShapeHistoAll( const HImage& Image, const char* Feature, HTuple* RelativeHisto ) const

HTuple HRegion::ShapeHistoAll( const HImage& Image, const wchar_t* Feature, HTuple* RelativeHisto ) const (Windows only)

HTuple HRegion.ShapeHistoAll( HImage image, string feature, out HTuple relativeHisto )

説明🔗

オペレーター shape_histo_allShapeHistoAllは、Imageimageimage のグレイ値 をもつ Regionregionregion 内で、0から255 のしきい値演算を実行します。ヒス トグラムの中の要素 \(i\) は、しきい値 \(i\) で分割された画像の連結成分 またはホールの数 (Featurefeaturefeature = 'connected_components'"connected_components", 'holes'"holes") あるいは、この 方法で分割された領域の特徴の平均値 (Featurefeaturefeature = 'convexity'"convexity", 'compactness'"compactness", 'anisometry'"anisometry") に対応します。

注意🔗

オペレーター shape_histo_allShapeHistoAll は、入力として 1 つの領域と正 確に一つのグレイ値画像予想します。shape_histo_allShapeHistoAll の実行時 間が長くなる場合があります。 オペレータshape_histo_allShapeHistoAllは与えられたRegionregionregionのみを考慮し、 入力画像Imageimageimageよりも前に設定されたドメインを無視することに注意してください。

実行情報🔗

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

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

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

パラメーター🔗

Regionregionregion (input_object) region → objectHObjectHRegionHObjectHobject

特徴検査領域

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

グレイ値画像

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

調査する特徴

初期値: 'connected_components'"connected_components"
値のリスト: 'anisometry', 'compactness', 'connected_components', 'convexity', 'holes'"anisometry", "compactness", "connected_components", "convexity", "holes"

AbsoluteHistoabsoluteHistoabsolute_histo (output_control) histogram-array → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)Sequence[Union[int, float]]Htuple (double / Hlong)

特徴の絶対分布

RelativeHistorelativeHistorelative_histo (output_control) histogram-array → (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

特徴の相対的分布

例🔗

(HDevelop)


* Simulation of shape_histo_all with feature 'connected_components':
* my_shape_histo_all(Region,Image,AbsHisto,RelHisto):
reduce_domain(Region,Image,RegionGray)
for i := 0 to 255 by 1
    threshold(RegionGray,Seg,i,255)
    connect_and_holes (Seg, NumConnected, _)
    AbsHisto[i] := NumConnected
endfor
Sum := 0
for i := 0 to 255 by 1
    Sum := Sum+AbsHisto[i]
endfor
for i := 0 to 255 by 1
    RelHisto[i] := AbsHisto[i]/Sum
endfor
(C)
/* Simulation of shape_histo_all with feature 'connected_components': */
my_shape_histo_all(Hobject Region,Hobject Image,
                 Hlong AbsHisto[], double RelHisto[])
{
  Hlong     i,sum\;
  Hobject  RegionGray,Seg\;
 reduce_domain(Region,Image,&RegionGray)\;
  for (i=0\; i<256\; i++) {
    threshold(RegionGray,&Seg,(double)i,255.0)\;
    connect_and_holes(Seg,&AbsHisto[i],NULL)\;
  }
  for (i=0\; i<256\; i++)
    sum += AbsHisto[i]\;
  for (i=0\; i<256\; i++)
    RelHist[i] = (double)AbsHisto[i]/Sum\;
}

複雑性🔗

\(F\) を入力領域の面積、\(N\) を連結要素の平均数であるとすると、実行時 間は \(O(255 (F + \sqrt{F} \sqrt{N}))\) となります。

結果🔗

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

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

組み合わせ

後処理の候補

histo_to_threshHistoToThresh, thresholdThreshold, gen_region_histoGenRegionHisto

他の選択候補

shape_histo_pointShapeHistoPoint

関連項目

compactnessCompactness, connectionConnection, connect_and_holesConnectAndHoles, convexityConvexity, count_objCountObj, entropy_grayEntropyGray, gray_histoGrayHisto

モジュール🔗

Foundation