From: Suman Nath (sknath@cmu.edu)
Date: 01/31/03
TO be on the safe side, use the following:
// calculate the smallest bounding box
// so minX = maximum of smaller X's
minX = max(pt[0].x, pt[1].x);
minY = max(pt[0].y, pt[3].y);
maxX = min(pt[2].x, pt[3].x);
maxY = min(pt[1].y, pt[2].y);
CvRect roi; // some of the OpenCV APIs takes this parameter
// Set bounding box of image
roi.x = minX;
roi.y = minY;
roi.height = abs(maxY - minY);
roi.width = abs(maxX - minX);
Hope this will help.
Look at the calibrate.cc file to see how we used FindUniqueSquares4,
extracted the rectangles out of the list returned by FindUniqueSquares4, and
finally used getImagePart.
- Suman
-----Original Message-----
From: owner-irisnet-course@intel-iris.net
[mailto:owner-irisnet-course@intel-iris.net]On Behalf Of Ginger Perng
Sent: Thursday, January 30, 2003 9:30 PM
To: irisnet-course@intel-iris.net
Subject: GetImagePart
Hi.
I am trying to use GetImagePart after I get the coordinates from
FindUniqueSquare4 to extract the image from the webcam picture. However,
I am running into the problem of
OpenCV Error: Sizes of input arguments do not match
in function [cvcolor.cpp:649]:cvCvtColor():
OpenCV: terminating the application
p0: 64, 176 -- p1: 64, 285 -- p2: 165, 285 -- p3: 165,176
64, 176, 101, 109
The p0-p1 are the CvPoints that I got from FindUniqueSquare4 and the last
four points are the x,y, width, and height values that I tried to use to
make GetImagePart work. It doesn't seem to barf on GetImagePart, but when
I try to display the image, that is when I get the previous error. Do you
know what could be wrong? Thanks
Ginger
This archive was generated by hypermail 2.1.5 : 06/10/04 EDT