HALCON Reference Manual 10.0.2
Name
bin_thresholdbin_thresholdbin_thresholdBinThresholdBinThreshold — Segment an image using an automatically determined
threshold.
Herror bin_threshold(const Hobject Image, Hobject* Region)
Herror T_bin_threshold(const Hobject Image, Hobject* Region)
bin_thresholdbin_thresholdbin_thresholdBinThresholdBinThreshold segments a single-channel gray value image
using an automatically determined threshold. First, the relative
histogram of the gray values is determined. Then, relevant minima
are extracted from the histogram, which are used as parameters for a
thresholding operation. In order to reduce the number of minima,
the histogram is smoothed with a Gaussian, as in
auto_thresholdauto_thresholdauto_thresholdAutoThresholdAutoThreshold. The mask size is enlarged until there
is only one minimum in the smoothed histogram. The selected region
contains the pixels with gray values from 0 to the minimum or for real images
from the smallest value to the respective minimum. This
operator is, for example useful for the segmentation of dark
characters on a light paper.
- Multithreading type: reentrant (runs in parallel with non-exclusive operators).
- Multithreading scope: global (may be called from any thread).
- Automatically parallelized on tuple level.
- Automatically parallelized on internal data level.
Dark regions of the image.
read_image (Image, 'letters')
bin_threshold (Image, Seg)
connection (Seg, Connected)
read_image(&Image,"letters");
bin_threshold(Image,&Seg);
connection(Seg,&Connected);
set_shape(WindowHandle,"rectangle1");
set_colored(WindowHandle,6);
disp_region(Connected,WindowHandle);
#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] << " 'image' " << endl;
return -1;
}
HImage image(argv[1]);
HImage med;
HWindow w;
w.SetDraw("margin");
w.SetShape("rectangle1");
w.SetColored(12);
image.Display(w);
HRegionArray reg = image.BinThreshold();
HRegionArray con = reg.Connection();
cout << "Display image after BinThreshold segmentation " << endl;
con.Display(w);
w.Click();
return 0;
}
read_image (Image, 'letters')
bin_threshold (Image, Seg)
connection (Seg, Connected)
read_image (Image, 'letters')
bin_threshold (Image, Seg)
connection (Seg, Connected)
anisotropic_diffusionanisotropic_diffusionanisotropic_diffusionAnisotropicDiffusionAnisotropicDiffusion,
median_imagemedian_imagemedian_imageMedianImageMedianImage,
illuminateilluminateilluminateIlluminateIlluminate
connectionconnectionconnectionConnectionConnection,
select_shapeselect_shapeselect_shapeSelectShapeSelectShape,
select_grayselect_grayselect_graySelectGraySelectGray
auto_thresholdauto_thresholdauto_thresholdAutoThresholdAutoThreshold,
char_thresholdchar_thresholdchar_thresholdCharThresholdCharThreshold
gray_histogray_histogray_histoGrayHistoGrayHisto,
smooth_funct_1d_gausssmooth_funct_1d_gausssmooth_funct_1d_gaussSmoothFunct1dGaussSmoothFunct1dGauss,
thresholdthresholdthresholdThresholdThreshold
Foundation
| HALCON Reference Manual 10.0.2 |
Copyright © 1996-2011 MVTec Software GmbH |