18 #ifndef PIC_FILTERING_FILTER_REMOVE_NUKED_HPP 19 #define PIC_FILTERING_FILTER_REMOVE_NUKED_HPP 21 #include "../filtering/filter.hpp" 46 for(
int j = box->
y0; j < box->y1; j++) {
47 for(
int i = box->
x0; i < box->x1; i++) {
49 float *tmp_data = (*src[0])(i, j);
50 float *tmp_dst = (*dst )(i, j);
52 for(
int ch = 0; ch < channels; ch++) {
57 float val = tmp_data[ch];
59 for(
int k = -1; k <= 1; k++) {
60 for(
int l = -1; l <= 1; l++) {
62 float *tmp_val = (*src[0])(i + l, j + k);
63 values[c2] = tmp_val[ch];
66 if(fabsf(tmp_val[ch] - tmp_data[ch]) > t_new) {
75 std::sort(values, values + 9);
76 tmp_dst[ch] = values[5];
The BBox class manages the creation of bounding boxes for images.
Definition: bbox.hpp:29
int channels
Definition: image.hpp:80
std::vector< Image * > ImageVec
ImageVec an std::vector of pic::Image.
Definition: image_vec.hpp:29
int x0
Definition: bbox.hpp:32
The Filter class.
Definition: filter.hpp:50
virtual Image * Process(ImageVec imgIn, Image *imgOut)
Process.
Definition: filter.hpp:390
void ProcessBBox(Image *dst, ImageVec src, BBox *box)
ProcessBBox.
Definition: filter_remove_nuked.hpp:39
int y0
Definition: bbox.hpp:32
float threshold_nuked
Definition: filter_remove_nuked.hpp:31
The Image class stores an image as buffer of float.
Definition: image.hpp:60
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
static Image * execute(Image *imgIn, Image *imgOut, float threshold_nuked=1e4)
execute
Definition: filter_remove_nuked.hpp:103
The FilterRemoveNuked class.
Definition: filter_remove_nuked.hpp:28
FilterRemoveNuked(float threshold_nuked=1e4f)
FilterRemoveNuked.
Definition: filter_remove_nuked.hpp:91