summaryrefslogtreecommitdiff
path: root/tests/files
diff options
context:
space:
mode:
authorDavid Rothlisberger <david.rothlisberger@youview.com>2012-06-15 13:19:06 +0100
committerThiago Santos <ts.santos@osg.sisa.samsung.com>2014-07-28 14:22:27 -0300
commitf5992a6cdd13c5460a9dd2bef17c7502a0816237 (patch)
tree8d4be7830a9b1230262f62b8dc6f6ea225d670bc /tests/files
parentaa5e25820b0a721580b5d4054477345f66352bb8 (diff)
opencv templatematch: Set caps to BGR order
templatematch operates on BGR data. In fact, OpenCV's IplImage always stores color image data in BGR order -- this isn't documented at all in the OpenCV source code, but there are hints around the web (see for example http://www.cs.iit.edu/~agam/cs512/lect-notes/opencv-intro/opencv-intro.html#SECTION00041000000000000000 and http://www.comp.leeds.ac.uk/vision/opencv/iplimage.html ). gst_templatematch_load_template loads the template (the image to find) from disk using OpenCV's cvLoadImage, so it is stored in an IplImage in BGR order. But in gst_templatematch_chain, no OpenCV conversion functions are used: the imageData pointer of the IplImage for the video frame (the image to search in) is just set to point to the raw buffer data. Without this fix, that raw data is in RGB order, so the call to cvMatchTemplate ends up comparing the template's Blue channel against the frame's Red channel, producing very poor results.
Diffstat (limited to 'tests/files')
0 files changed, 0 insertions, 0 deletions