5# include "../_cexports/c_foundation.h"
7# include "../global.hpp"
8# include "../image.hpp"
9# include "../exception.hpp"
10# include "../value_range.hpp"
74 return Internal::DoResCallObjectOut<Image>([&](
void *&resimg) {
76 image.
Handle(), thresholds.
Handle(),
static_cast<CExports::TThresholdComparison
>(comparison), resimg));
90 template <
class RANGE>
91 inline typename TypedRange<std::unique_ptr<Image>, double, RANGE>::type
94 auto valuesRange = MakeRangeAdapter<double>(values, image.
PlanesCount());
96 return Internal::DoResCallObjectOut<Image>([&](
void *&resimg) {
99 static_cast<CExports::TThresholdComparison
>(comparison),
142 return Internal::DoResCallObjectOut<Image>([&](
void *&resimg) {
144 image.
Handle(),
static_cast<CExports::TDynamicThresholdNorm
>(norm), windowSize, threshold, resimg));
162 template <
class RANGE>
163 inline typename TypedRange<std::unique_ptr<Image>, double, RANGE>::type
168 auto thresholdsRange = MakeRangeAdapter<double>(thresholds, planesCount);
169 auto valuesRange = MakeRangeAdapter<double>(values, planesCount);
171 return Internal::DoResCallObjectOut<Image>([&](
void *&resimg) {
174 image.
Handle(),
const_cast<double *
>(thresholdsRange.Data()),
const_cast<double *
>(valuesRange.Data()),
175 static_cast<CExports::TThresholdComparison
>(comparison), resimg));
213 template <
class RANGE>
214 inline typename TypedRange<std::unique_ptr<Image>, double, RANGE>::type
258 CExports::TDRect tmpRect = {
static_cast<double>(aoi.Left()),
static_cast<double>(aoi.Top()),
259 static_cast<double>(aoi.Right()),
static_cast<double>(aoi.Bottom())};
263 Utilities::SystemInfo::ThrowLastError();
The Common Vision Blox image.
Definition decl_image.hpp:50
void RaisePixelContentChanged() const
Inform clients listening to the pixel content changed event, that the image data has been completely ...
Definition decl_image.hpp:448
int PlanesCount() const noexcept
Get the number of planes for this image.
Definition decl_image.hpp:247
Rect< int > Bounds() const noexcept
Bounding rectangle of the image in pixels.
Definition decl_image.hpp:438
Size2D< int > Size() const noexcept
Size of the image in pixels.
Definition decl_image.hpp:428
void * Handle() const noexcept
Classic API image handle.
Definition decl_image.hpp:237
static std::unique_ptr< Image > Create(Size2D< int > size, int numPlanes=1, DataType dataType=DataType::Int8BppUnsigned())
Creates an uninitialized image with the given parameters.
Definition decl_image.hpp:75
Image plane information container.
Definition decl_image_plane.hpp:29
int Plane() const noexcept
Plane index in the image, to which this plane refers to.
Definition decl_image_plane.hpp:147
const Image & Parent() const noexcept
Image to which this plane descriptor refers to.
Definition detail_image_plane.hpp:87
Rectangle object.
Definition rect.hpp:24
Container for range definitions.
Definition value_range.hpp:17
T Min() const noexcept
Gets the minimum value.
Definition value_range.hpp:47
T Max() const noexcept
Gets the maximum value.
Definition value_range.hpp:69
cvbres_t FBlobBinariseImage(IMG Src, TDRect *Rect, long Index, long Low, long High, IMG Dst)
cvbres_t CreateImageThresholdImage(IMG ImgIn, IMG ImgThreshold, TThresholdComparison Comparison, IMG &ImgOut)
cvbres_t CreateTransparentThresholdImage(IMG ImgIn, double Thresholds[], double Values[], TThresholdComparison Comparison, IMG &ImgOut)
cvbres_t CreateDynamicThresholdImageEx(IMG ImgIn, TDynamicThresholdNorm Norm, long WindowSize, double Threshold, IMG &ImgOut)
cvbres_t CreateConstantThresholdImage(IMG ImgIn, double Values[], TThresholdComparison Comparison, IMG &ImgOut)
Namespace for collection of thresholding functions from the Foundation package.
Definition threshold.hpp:28
std::unique_ptr< Image > DynamicThreshold(const Image &image, int windowSize, int threshold, DynamicThresholdNorm norm=DynamicThresholdNorm::Mean)
This function performs dynamic thresholding on the input image.
Definition threshold.hpp:139
StaticThresholding
Comparisons for static thresholding.
Definition threshold.hpp:32
@ LessThanOrEqual
Less than or Equal.
Definition threshold.hpp:36
@ GreaterOrEqual
Greater or Equal.
Definition threshold.hpp:40
@ Greater
Greater.
Definition threshold.hpp:42
@ LessThan
Less than.
Definition threshold.hpp:34
@ Equal
Equal.
Definition threshold.hpp:38
void RangeThresholdToDst(const ImagePlane &plane, ValueRange< int > range, Image &imageDst, Rect< int > aoi)
A range based binarization algorithm to the given input.
Definition threshold.hpp:256
TypedRange< std::unique_ptr< Image >, double, RANGE >::type StaticTransparentThreshold(const Image &image, const RANGE &thresholds, StaticThresholding comparison, const RANGE &values)
Create a thresholded image using a transparency approach.
Definition threshold.hpp:164
std::unique_ptr< Image > RangeThreshold(const ImagePlane &plane, ValueRange< int > range, Rect< int > aoi)
A range based binarization algorithm to the given input.
Definition threshold.hpp:294
DynamicThresholdNorm
Norm calculation approaches for dynamic thresholding.
Definition threshold.hpp:47
@ Mean
Dynamic thresholding compares versus the mean value of the threshold mask (default).
Definition threshold.hpp:49
@ MinMax
Definition threshold.hpp:52
std::unique_ptr< Image > StaticThreshold(const Image &image, const Image &thresholds, StaticThresholding comparison)
This function performs thresholding of an input image with pixel-by-pixel thresholds stored in the pi...
Definition threshold.hpp:71
Namespace for the Foundation package.
Definition decl_metric_aqs12_calibration_piece.hpp:11
Root namespace for the Image Manager interface.
Definition c_bayer_to_rgb.h:17