18 #ifndef PIC_FILTERING_FILTER_KUWAHARA_HPP 19 #define PIC_FILTERING_FILTER_KUWAHARA_HPP 21 #include "../filtering/filter.hpp" 44 Image *source = src[0];
46 float *buf =
new float[channels * 8];
49 float *m00 = &buf[start];
51 float *m10 = &buf[start];
53 float *m01 = &buf[start];
55 float *m11 = &buf[start];
57 float *s00 = &buf[start];
59 float *s10 = &buf[start];
61 float *s01 = &buf[start];
63 float *s11 = &buf[start];
65 for(
int m = box->
z0; m < box->z1; m++) {
66 for(
int j = box->
y0; j < box->y1; j++) {
67 for(
int i = box->
x0; i < box->x1; i++) {
73 float *tmpDst = (*dst)(i, j, m);
82 for(
int l = 0; l < channels; l++) {
98 for(
int l = 0; l < channels; l++) {
114 for(
int l = 0; l < channels; l++) {
130 for(
int l = 0; l < channels; l++) {
142 for(
int l = 0; l < channels; l++) {
149 for(
int l = 0; l < channels; l++) {
156 for(
int l = 0; l < channels; l++) {
163 for(
int l = 0; l < channels; l++) {
170 float *tmpSrc = (*source)(i, j, m);
171 for(
int l = 0; l < channels; l++) {
172 tmpDst[l] = tmpSrc[l];
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
unsigned int halfKernelSize
Definition: filter_kuwahara.hpp:32
int x0
Definition: bbox.hpp:32
float * getMeanVal(BBox *box, float *ret)
getMeanVal computes the mean for the current Image.
void update(int kernelSize)
update
Definition: filter_kuwahara.hpp:197
FilterKuwahara(int kernelSize=3)
FilterKuwahara.
Definition: filter_kuwahara.hpp:188
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_kuwahara.hpp:40
int y0
Definition: bbox.hpp:32
The FilterKuwahara class.
Definition: filter_kuwahara.hpp:28
static Image * execute(Image *imgIn, Image *imgOut, int kernelSize)
execute
Definition: filter_kuwahara.hpp:214
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
unsigned int kernelSize
Definition: filter_kuwahara.hpp:31
int z0
Definition: bbox.hpp:32
float * getVarianceVal(float *meanVal, BBox *box, float *ret)
getVarianceVal computes the variance for the current Image.