summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cvg.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/cvg.c b/cvg.c
index 82c1085..42c02f4 100644
--- a/cvg.c
+++ b/cvg.c
@@ -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);