18 #ifndef PIC_FILTERING_FILTER_DISPARITY_HPP 19 #define PIC_FILTERING_FILTER_DISPARITY_HPP 21 #include "../filtering/filter.hpp" 23 #include "../features_matching/patch_comp.hpp" 49 for(
int j = box->
y0; j < box->y1; j++) {
51 for(
int i = box->
x0; i < box->x1; i++) {
53 float *prevL = (*dst)(i - 1, j );
54 float *prevU = (*dst)(i , j - 1);
62 for(
int x = minX; x < maxX; x++) {
69 if(prevL[1] >= 0.0
f) {
70 float deltaL = fabsf(prevL[0] - x);
71 reg += deltaL / maxDisparityf;
74 if(prevU[1] >= 0.0
f) {
75 float deltaU = fabsf(prevU[0] - x);
76 reg += deltaU / maxDisparityf;
87 float *out = (*dst)(i, j);
103 if(imgIn.size() == 4) {
110 imgOut =
new Image(1, imgIn[0]->width, imgIn[0]->height, 2);
114 if((imgIn[0]->width != imgOut->
width) ||
115 (imgIn[0]->height != imgOut->
height) ||
117 imgOut =
new Image(1, imgIn[0]->width, imgIn[0]->height, 2);
183 width = imgIn->
width;
The BBox class manages the creation of bounding boxes for images.
Definition: bbox.hpp:29
void OutputSize(Image *imgIn, int &width, int &height, int &channels, int &frames)
OutputSize.
Definition: filter_disparity.hpp:181
int maxDisparity
Definition: filter_disparity.hpp:34
int channels
Definition: image.hpp:80
void update(int maxDisparity, int patchSize, float lambda)
update
Definition: filter_disparity.hpp:160
T * delete_s(T *data)
delete_s
Definition: std_util.hpp:123
~FilterDisparity()
Definition: filter_disparity.hpp:151
std::vector< Image * > ImageVec
ImageVec an std::vector of pic::Image.
Definition: image_vec.hpp:29
int x0
Definition: bbox.hpp:32
float getSSDSmooth(int x0, int y0, int x1, int y1)
getSSDSmooth
Definition: patch_comp.hpp:140
int halfMaxDisparity
Definition: filter_disparity.hpp:34
The Filter class.
Definition: filter.hpp:50
void allocateSimilarTo(Image *img)
allocateSimilarTo allocate an Image with similar size of the passed by.
void ProcessBBox(Image *dst, ImageVec src, BBox *box)
ProcessBBox.
Definition: filter_disparity.hpp:44
int frames
Definition: image.hpp:80
The PatchComp class.
Definition: patch_comp.hpp:36
int y0
Definition: bbox.hpp:32
Image * setupAux(ImageVec imgIn, Image *imgOut)
setupAux
Definition: filter_disparity.hpp:101
PatchComp * pc
Definition: filter_disparity.hpp:36
#define MIN(a, b)
Definition: math.hpp:69
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
float lambda
Definition: filter_disparity.hpp:35
FilterDisparity()
FilterDisparity.
Definition: filter_disparity.hpp:134
Definition: bilateral_separation.hpp:25
bool isValid()
isValid checks if the current image is valid, which means if they have an allocated buffer or not...
#define MAX(a, b)
Definition: math.hpp:73
The FilterDisparity class.
Definition: filter_disparity.hpp:30
FilterDisparity(int maxDisparity, int patchSize, float lambda)
FilterDisparity.
Definition: filter_disparity.hpp:145
int width
Definition: image.hpp:80
int height
Definition: image.hpp:80
int patchSize
Definition: filter_disparity.hpp:34