diff options
author | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2012-05-25 09:27:46 +0200 |
---|---|---|
committer | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2012-05-25 09:27:46 +0200 |
commit | 4b524e3026d5b1efedaf83e730d3e21cc924dc3b (patch) | |
tree | c4437452993988f249179beffd88b70a84d387c3 | |
parent | 724b8953b587548cab615aacfd3c78f518f67c8f (diff) | |
download | cv-4b524e3026d5b1efedaf83e730d3e21cc924dc3b.tar.gz cv-4b524e3026d5b1efedaf83e730d3e21cc924dc3b.tar.bz2 cv-4b524e3026d5b1efedaf83e730d3e21cc924dc3b.zip |
cvg: Use image depth and channels properties in blits
-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); |