diff options
-rw-r--r-- | cvg.c | 20 |
1 files changed, 9 insertions, 11 deletions
@@ -240,23 +240,23 @@ file_set(GtkFileChooserButton *widget, gpointer userdata) static IplImage * pass_through_filter(struct cvg *cvg, IplImage *image) { - IplImage *output; + IplImage *out; - output = cvCreateImage(cvGetSize(image), IPL_DEPTH_8U, 3); - cvCopy(image, output, NULL); + out = cvCreateImage(cvGetSize(image), image->depth, image->nChannels); + cvCopy(image, out, NULL); - return output; + return out; } static IplImage * gauss_filter(struct cvg *cvg, IplImage *image) { - IplImage *output; + IplImage *out; - output = cvCreateImage(cvGetSize(image), IPL_DEPTH_8U, 3); - cvSmooth(image, output, CV_GAUSSIAN, 9, 9, 0, 0); + out = cvCreateImage(cvGetSize(image), image->depth, image->nChannels); + cvSmooth(image, out, CV_GAUSSIAN, 9, 9, 0, 0); - return output; + return out; } static IplImage * @@ -268,9 +268,7 @@ good_features_to_track(struct cvg *cvg, IplImage *image) double quality_level = 0.1, min_distance = 5; int i, eig_block_size = 3, use_harris = 0; - output = cvCreateImage(cvGetSize(image), IPL_DEPTH_8U, 3); - cvCopy(image, output, NULL); - + output = pass_through_filter(cvg, image); gray_frame = cvCreateImage(cvGetSize(image), IPL_DEPTH_8U, 1); eig_image = cvCreateImage(cvGetSize(image), IPL_DEPTH_32F, 1); temp_image = cvCreateImage(cvGetSize(image), IPL_DEPTH_32F, 1); |