@@ -122,9 +122,13 @@ void ft::FT02D_FL_process(InputArray matrix, const int radius, OutputArray outpu
122
122
int output_height = matrix.rows ();
123
123
int output_width = matrix.cols ();
124
124
125
- uchar *img_r = new uchar[output_height * output_width];
126
- uchar *img_g = new uchar[output_height * output_width];
127
- uchar *img_b = new uchar[output_height * output_width];
125
+ Mat compR (output_height, output_width, CV_8UC1);
126
+ Mat compG (output_height, output_width, CV_8UC1);
127
+ Mat compB (output_height, output_width, CV_8UC1);
128
+
129
+ uchar *img_r = compR.ptr ();
130
+ uchar *img_g = compG.ptr ();
131
+ uchar *img_b = compB.ptr ();
128
132
129
133
for (int y = 0 ; y < output_height; y++)
130
134
{
@@ -158,10 +162,6 @@ void ft::FT02D_FL_process(InputArray matrix, const int radius, OutputArray outpu
158
162
}
159
163
}
160
164
161
- Mat compR (output_height, output_width, CV_8UC1, img_r);
162
- Mat compG (output_height, output_width, CV_8UC1, img_g);
163
- Mat compB (output_height, output_width, CV_8UC1, img_b);
164
-
165
165
std::vector<Mat> oComp;
166
166
167
167
oComp.push_back (compB);
@@ -250,9 +250,13 @@ void ft::FT02D_FL_process_float(InputArray matrix, const int radius, OutputArray
250
250
int output_height = matrix.rows ();
251
251
int output_width = matrix.cols ();
252
252
253
- float *img_r = new float [output_height * output_width];
254
- float *img_g = new float [output_height * output_width];
255
- float *img_b = new float [output_height * output_width];
253
+ Mat compR (output_height, output_width, CV_32FC1);
254
+ Mat compG (output_height, output_width, CV_32FC1);
255
+ Mat compB (output_height, output_width, CV_32FC1);
256
+
257
+ float *img_r = compR.ptr <float >();
258
+ float *img_g = compG.ptr <float >();
259
+ float *img_b = compB.ptr <float >();
256
260
257
261
for (int y = 0 ; y < output_height; y++)
258
262
{
@@ -286,10 +290,6 @@ void ft::FT02D_FL_process_float(InputArray matrix, const int radius, OutputArray
286
290
}
287
291
}
288
292
289
- Mat compR (output_height, output_width, CV_32FC1, img_r);
290
- Mat compG (output_height, output_width, CV_32FC1, img_g);
291
- Mat compB (output_height, output_width, CV_32FC1, img_b);
292
-
293
293
std::vector<Mat> oComp;
294
294
295
295
oComp.push_back (compB);
0 commit comments