18 #ifndef PIC_FILTERING_FILTER_THRESHOLD_HPP 19 #define PIC_FILTERING_FILTER_THRESHOLD_HPP 21 #include "../image.hpp" 22 #include "../histogram.hpp" 23 #include "../filtering/filter.hpp" 24 #include "../filtering/filter_luminance.hpp" 52 Image* img_ada = src[1];
54 for(
int j = box->
y0; j < box->y1; j++) {
56 for(
int i = box->
x0; i < box->x1; i++) {
57 float *dst_val = (*dst)(i, j);
58 float *img_val = (*img)(i, j);
59 float *img_ada_val = (*img_ada)(i, j);
61 dst_val[0] = img_val[0] > img_ada_val[0] ? 1.0f : 0.0f;
65 for(
int j = box->
y0; j < box->y1; j++) {
67 for(
int i = box->
x0; i < box->x1; i++) {
68 float *dst_val = (*dst)(i, j);
69 float *img_val = (*img)(i, j);
71 dst_val[0] = img_val[0] >
threshold ? 1.0f : 0.0f;
110 width = imgIn[0]->width;
111 height = imgIn[0]->height;
113 frames = imgIn[0]->frames;
The BBox class manages the creation of bounding boxes for images.
Definition: bbox.hpp:29
int channels
Definition: image.hpp:80
static Image * execute(Image *imgIn, Image *imgOut, float threshold, bool bAdaptive)
Definition: filter_threshold.hpp:116
std::vector< Image * > ImageVec
ImageVec an std::vector of pic::Image.
Definition: image_vec.hpp:29
int x0
Definition: bbox.hpp:32
static Image * execute(Image *imgIn, Image *imgOut, LUMINANCE_TYPE type=LT_CIE_LUMINANCE)
execute
Definition: display.hpp:166
The Filter class.
Definition: filter.hpp:50
The Image class stores an image as buffer of float.
Definition: filter_radial_basis_function.hpp:60
virtual Image * Process(ImageVec imgIn, Image *imgOut)
Process.
Definition: filter.hpp:390
void calculate(Image *imgIn, VALUE_SPACE type=VS_LIN, int nBin=256, BBox *box=NULL, int channel=0)
calculate computes the histogram of an input image. In the case of LDR images, they are ssumed to be ...
Definition: display.hpp:213
void OutputSize(ImageVec imgIn, int &width, int &height, int &channels, int &frames)
OutputSize.
Definition: filter_threshold.hpp:108
void ProcessBBox(Image *dst, ImageVec src, BBox *box)
ProcessBBox.
Definition: filter_threshold.hpp:43
int y0
Definition: bbox.hpp:32
The Histogram class is a class for creating, managing, loading, and saving histogram for an Image...
Definition: display.hpp:37
The FilterThreshold class.
Definition: filter_threshold.hpp:31
static Image * Otsu(Image *imgIn, Image *imgOut)
Definition: filter_threshold.hpp:123
void update(float threshold, bool bAdaptive)
update
Definition: filter_threshold.hpp:94
The Image class stores an image as buffer of float.
Definition: image.hpp:60
virtual void f(FilterFData *data)
f
Definition: filter_radial_basis_function.hpp:69
PIC_INLINE ImageVec Single(Image *img)
Single creates an std::vector which contains img; this is for filters input.
Definition: image_vec.hpp:36
Definition: bilateral_separation.hpp:25
float threshold
Definition: filter_threshold.hpp:34
FilterThreshold(float threshold=0.5f, bool bAdaptive=false)
FilterThreshold.
Definition: filter_threshold.hpp:84
float getOtsu()
getOtsu
Definition: display.hpp:516
bool bAdaptive
Definition: filter_threshold.hpp:35
Definition: display.hpp:31