#include <ossimDiscrete3x3HatFilter.h>
|
| ossimDiscrete3x3HatFilter () |
|
virtual void | convolve (const float *data, double &result, float nullPixel=OSSIM_DEFAULT_NULL_PIX_FLOAT) const |
|
virtual void | convolveSubImage (const float *data, long dataWidth, double &result, float nullPixel=OSSIM_DEFAULT_NULL_PIX_FLOAT) const |
|
virtual void | convolve (const unsigned char *data, double &result, ossim_uint8 nullPixel=OSSIM_DEFAULT_NULL_PIX_UINT8) const |
|
virtual void | convolveSubImage (const unsigned char *data, long dataWidth, double &result, ossim_uint8 nullPixel=OSSIM_DEFAULT_NULL_PIX_UINT8) const |
|
virtual void | buildConvolution (double widthPercent, double heightPercent) |
|
| ossimDiscreteConvolutionKernel (long width, long height, bool doWeightedAverage=true) |
|
| ossimDiscreteConvolutionKernel (const NEWMAT::Matrix &kernel, bool doWeightedAverage=true) |
|
virtual | ~ossimDiscreteConvolutionKernel () |
|
virtual void | setKernel (const NEWMAT::Matrix &kernel) |
|
virtual void | convolve (const double *data, double &result, double nullPixel=OSSIM_DEFAULT_NULL_PIX_DOUBLE) const |
|
virtual void | convolveSubImage (const double *data, long dataWidth, double &result, double nullPixel=OSSIM_DEFAULT_NULL_PIX_DOUBLE) const |
|
virtual void | convolve (const short *data, double &result, ossim_sint16 nullPixel=OSSIM_DEFAULT_NULL_PIX_SINT16) const |
|
virtual void | convolveSubImage (const short *data, long dataWidth, double &result, ossim_sint16 nullPixel=OSSIM_DEFAULT_NULL_PIX_SINT16) const |
|
virtual void | convolve (const unsigned short *data, double &result, ossim_uint16 nullPixel=OSSIM_DEFAULT_NULL_PIX_UINT16) const |
|
virtual void | convolveSubImage (const unsigned short *data, long dataWidth, double &result, ossim_uint16 nullPixel=OSSIM_DEFAULT_NULL_PIX_UINT16) const |
|
virtual long | getWidth () const |
|
virtual long | getHeight () const |
|
const NEWMAT::Matrix & | getKernel () const |
|
Definition at line 14 of file ossimDiscrete3x3HatFilter.h.
◆ ossimDiscrete3x3HatFilter()
ossimDiscrete3x3HatFilter::ossimDiscrete3x3HatFilter |
( |
| ) |
|
Definition at line 12 of file ossimDiscrete3x3HatFilter.cpp.
16 (*theKernel)[0][0] = 0;
17 (*theKernel)[0][1] = 0;
18 (*theKernel)[0][2] = 0;
20 (*theKernel)[1][0] = 0;
21 (*theKernel)[1][1] = 1;
22 (*theKernel)[1][2] = 0;
24 (*theKernel)[2][0] = 0;
25 (*theKernel)[2][1] = 0;
26 (*theKernel)[2][2] = 0;
ossimDiscreteConvolutionKernel(long width, long height, bool doWeightedAverage=true)
◆ buildConvolution()
void ossimDiscrete3x3HatFilter::buildConvolution |
( |
double |
, |
|
|
double |
|
|
) |
| |
|
virtual |
This is used to allow me to continually adjust a convolution kernel based on where it center lies on a pixel. The xLocation and yLocation are all from the center of pixel. If I am convolving at full resolution then xLocation and yLocation should both be 0. Let's pretend that we contract an image by .5 scale factor or zooming out by a factor of 2. Then we actually of it .5 off from cneter of pixel in both the x and y direction. This information can be used to allow a kernel to adjust it's waits accordingly.
Typically if the xLocation and yLocation is directly on the center indicated by 0 vor both then the kernel defaults to 1 in the middle and all other weights are zero.
Reimplemented from ossimDiscreteConvolutionKernel.
Definition at line 274 of file ossimDiscrete3x3HatFilter.cpp.
References abs.
277 NEWMAT::RowVector row(3);
278 NEWMAT::ColumnVector col(3);
287 (*theKernel) = col*row;
◆ convolve() [1/2]
Will expect a data buffer of size width*height and is row ordered.
Reimplemented from ossimDiscreteConvolutionKernel.
Definition at line 29 of file ossimDiscrete3x3HatFilter.cpp.
36 if(data[0] != nullPixel)
38 divisor += (*theKernel)[0][0];
39 result += (*theKernel)[0][0] * data[0];
41 if(data[1] != nullPixel)
43 divisor += (*theKernel)[0][1];
44 result += (*theKernel)[0][1] * data[1];
46 if(data[2] != nullPixel)
48 divisor += (*theKernel)[0][2];
49 result += (*theKernel)[0][2] * data[2];
51 if(data[3] != nullPixel)
53 divisor += (*theKernel)[1][0];
54 result += (*theKernel)[1][0] * data[3];
56 if(data[4] != nullPixel)
58 divisor += (*theKernel)[1][1];
59 result += (*theKernel)[1][1] * data[4];
61 if(data[5] != nullPixel)
63 divisor += (*theKernel)[1][2];
64 result += (*theKernel)[1][2] * data[5];
66 if(data[6] != nullPixel)
68 divisor += (*theKernel)[2][0];
69 result += (*theKernel)[2][0] * data[6];
71 if(data[7] != nullPixel)
73 divisor += (*theKernel)[2][1];
74 result += (*theKernel)[2][1] * data[7];
76 if(data[8] != nullPixel)
78 divisor += (*theKernel)[2][2];
79 result += (*theKernel)[2][2] * data[8];
◆ convolve() [2/2]
Reimplemented from ossimDiscreteConvolutionKernel.
Definition at line 151 of file ossimDiscrete3x3HatFilter.cpp.
158 if(data[0] != nullPixel)
160 divisor += (*theKernel)[0][0];
161 result += (*theKernel)[0][0] * data[0];
163 if(data[1] != nullPixel)
165 divisor += (*theKernel)[0][1];
166 result += (*theKernel)[0][1] * data[1];
168 if(data[2] != nullPixel)
170 divisor += (*theKernel)[0][2];
171 result += (*theKernel)[0][2] * data[2];
173 if(data[3] != nullPixel)
175 divisor += (*theKernel)[1][0];
176 result += (*theKernel)[1][0] * data[3];
178 if(data[4] != nullPixel)
180 divisor += (*theKernel)[1][1];
181 result += (*theKernel)[1][1] * data[4];
183 if(data[5] != nullPixel)
185 divisor += (*theKernel)[1][2];
186 result += (*theKernel)[1][2] * data[5];
188 if(data[6] != nullPixel)
190 divisor += (*theKernel)[2][0];
191 result += (*theKernel)[2][0] * data[6];
193 if(data[7] != nullPixel)
195 divisor += (*theKernel)[2][1];
196 result += (*theKernel)[2][1] * data[7];
198 if(data[8] != nullPixel)
200 divisor += (*theKernel)[2][2];
201 result += (*theKernel)[2][2] * data[8];
◆ convolveSubImage() [1/2]
void ossimDiscrete3x3HatFilter::convolveSubImage |
( |
const float * |
data, |
|
|
long |
dataWidth, |
|
|
double & |
result, |
|
|
float |
nullPixel = OSSIM_DEFAULT_NULL_PIX_FLOAT |
|
) |
| const |
|
virtual |
Reimplemented from ossimDiscreteConvolutionKernel.
Definition at line 87 of file ossimDiscrete3x3HatFilter.cpp.
95 if(data[0] != nullPixel)
97 divisor += (*theKernel)[0][0];
98 result += (*theKernel)[0][0]*data[0];
100 if(data[1] != nullPixel)
102 divisor += (*theKernel)[0][1];
103 result += (*theKernel)[0][1]*data[1];
105 if(data[2] != nullPixel)
107 divisor += (*theKernel)[0][2];
108 result += (*theKernel)[0][2]*data[2];
112 if(data[0] != nullPixel)
114 divisor += (*theKernel)[1][0];
115 result += (*theKernel)[1][0]*data[0];
117 if(data[1] != nullPixel)
119 divisor += (*theKernel)[1][1];
120 result += (*theKernel)[1][1]*data[1];
122 if(data[2] != nullPixel)
124 divisor += (*theKernel)[1][2];
125 result += (*theKernel)[1][2]*data[2];
129 if(data[0] != nullPixel)
131 divisor += (*theKernel)[2][0];
132 result += (*theKernel)[2][0]*data[0];
134 if(data[1] != nullPixel)
136 divisor += (*theKernel)[2][1];
137 result += (*theKernel)[2][1]*data[1];
139 if(data[2] != nullPixel)
141 divisor += (*theKernel)[2][2];
142 result += (*theKernel)[2][2]*data[2];
◆ convolveSubImage() [2/2]
this allows you to pass a subImage to the convolution engine. It needs to know the width of the buffer so it can increment to the next element.
Reimplemented from ossimDiscreteConvolutionKernel.
Definition at line 210 of file ossimDiscrete3x3HatFilter.cpp.
215 double divisor = 0.0;
218 if(data[0] != nullPixel)
220 divisor += (*theKernel)[0][0];
221 result += (*theKernel)[0][0]*data[0];
223 if(data[1] != nullPixel)
225 divisor += (*theKernel)[0][1];
226 result += (*theKernel)[0][1]*data[1];
228 if(data[2] != nullPixel)
230 divisor += (*theKernel)[0][2];
231 result += (*theKernel)[0][2]*data[2];
235 if(data[0] != nullPixel)
237 divisor += (*theKernel)[1][0];
238 result += (*theKernel)[1][0]*data[0];
240 if(data[1] != nullPixel)
242 divisor += (*theKernel)[1][1];
243 result += (*theKernel)[1][1]*data[1];
245 if(data[2] != nullPixel)
247 divisor += (*theKernel)[1][2];
248 result += (*theKernel)[1][2]*data[2];
252 if(data[0] != nullPixel)
254 divisor += (*theKernel)[2][0];
255 result += (*theKernel)[2][0]*data[0];
257 if(data[1] != nullPixel)
259 divisor += (*theKernel)[2][1];
260 result += (*theKernel)[2][1]*data[1];
262 if(data[2] != nullPixel)
264 divisor += (*theKernel)[2][2];
265 result += (*theKernel)[2][2]*data[2];
The documentation for this class was generated from the following files: