shape_histo_allT_shape_histo_allShapeHistoAllShapeHistoAllshape_histo_all (算子)

名称

shape_histo_allT_shape_histo_allShapeHistoAllShapeHistoAllshape_histo_all — 确定沿所有阈值的特征直方图。

签名

shape_histo_all(Region, Image : : Feature : AbsoluteHisto, RelativeHisto)

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

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

static void HOperatorSet.ShapeHistoAll(HObject region, HObject image, HTuple feature, out HTuple absoluteHisto, out HTuple relativeHisto)

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

def shape_histo_all(region: HObject, image: HObject, feature: str) -> Tuple[Sequence[Union[int, float]], Sequence[float]]

描述

算子 shape_histo_allshape_histo_allShapeHistoAllShapeHistoAllShapeHistoAllshape_histo_all carries out 255 threshold operations within RegionRegionRegionRegionregionregion with the gray values of ImageImageImageImageimageimage. The entry i in the histogram corresponds to the number of connected components/holes of this image segmented with the threshold i (FeatureFeatureFeatureFeaturefeaturefeature = 'connected_components'"connected_components""connected_components""connected_components""connected_components""connected_components", 'holes'"holes""holes""holes""holes""holes") or the mean value of the feature values of the regions segmented in this way (FeatureFeatureFeatureFeaturefeaturefeature = 'convexity'"convexity""convexity""convexity""convexity""convexity", 'compactness'"compactness""compactness""compactness""compactness""compactness", 'ansisometry'"ansisometry""ansisometry""ansisometry""ansisometry""ansisometry"), respectively.

注意

算子 shape_histo_allshape_histo_allShapeHistoAllShapeHistoAllShapeHistoAllshape_histo_all expects a region and exactly one gray value image as input. Because of the power of this operator the runtime of shape_histo_allshape_histo_allShapeHistoAllShapeHistoAllShapeHistoAllshape_histo_all is relatively large!

Note that the operator shape_histo_allshape_histo_allShapeHistoAllShapeHistoAllShapeHistoAllshape_histo_all only considers the given RegionRegionRegionRegionregionregion and ignores any previously set domain of the input image ImageImageImageImageimageimage

执行信息

参数

RegionRegionRegionRegionregionregion (输入对象)  region objectHRegionHObjectHRegionHobject

Region in which the features are to be examined.

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

灰度值图像。

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

Feature to be examined.

默认值: 'connected_components' "connected_components" "connected_components" "connected_components" "connected_components" "connected_components"

值列表: 'anisometry'"anisometry""anisometry""anisometry""anisometry""anisometry", 'compactness'"compactness""compactness""compactness""compactness""compactness", 'connected_components'"connected_components""connected_components""connected_components""connected_components""connected_components", 'convexity'"convexity""convexity""convexity""convexity""convexity", 'holes'"holes""holes""holes""holes""holes"

AbsoluteHistoAbsoluteHistoAbsoluteHistoAbsoluteHistoabsoluteHistoabsolute_histo (输出控制)  histogram-array HTupleSequence[Union[int, float]]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Absolute distribution of the feature.

RelativeHistoRelativeHistoRelativeHistoRelativeHistorelativeHistorelative_histo (输出控制)  histogram-array HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

Relative distribution of the feature.

示例(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;
}

示例(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
  

示例(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
  

示例(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
  

复杂度

If F is the area of the input region and N the mean number of connected components the runtime complexity is

结果

算子 shape_histo_allshape_histo_allShapeHistoAllShapeHistoAllShapeHistoAllshape_histo_all 返回值 2 ( H_MSG_TRUE) if an image with the defined gray values is entered. The behavior in case of empty input (no input images) is set via the operator 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>), the behavior in case of empty region is set via set_system(::'empty_region_result',<Result>:)set_system("empty_region_result",<Result>)SetSystem("empty_region_result",<Result>)SetSystem("empty_region_result",<Result>)SetSystem("empty_region_result",<Result>)set_system("empty_region_result",<Result>)。如有必要,则抛出异常。

可能的后继

histo_to_threshhisto_to_threshHistoToThreshHistoToThreshHistoToThreshhisto_to_thresh, thresholdthresholdThresholdThresholdThresholdthreshold, gen_region_histogen_region_histoGenRegionHistoGenRegionHistoGenRegionHistogen_region_histo

替代

shape_histo_pointshape_histo_pointShapeHistoPointShapeHistoPointShapeHistoPointshape_histo_point

另见

compactnesscompactnessCompactnessCompactnessCompactnesscompactness, connectionconnectionConnectionConnectionConnectionconnection, connect_and_holesconnect_and_holesConnectAndHolesConnectAndHolesConnectAndHolesconnect_and_holes, convexityconvexityConvexityConvexityConvexityconvexity, count_objcount_objCountObjCountObjCountObjcount_obj, entropy_grayentropy_grayEntropyGrayEntropyGrayEntropyGrayentropy_gray, gray_histogray_histoGrayHistoGrayHistoGrayHistogray_histo

模块

基础