The cvBoundingRect() function can return the minimum bounding rectangle when I pass it a sequence of points as a CvSeq* structure, e.g. like I get from cvFindContours().
However when I want to find the minimum bounding rectangle enclosing two points (that I have as CvPoint structures) the function is not accepting the arguments. How to make two CvPoint structures into a format acceptable by cvBoundingRect()?
edit:
((just putting in the code))
CvSeqWriter writer;
cvStartWriteSeq( CV_32SC2, sizeof(CvSeq), sizeof(CvPoint), storage, &writer );
CV_WRITE_SEQ_ELEM( pt1, writer );
CV_WRITE_SEQ_ELEM( pt2, writer );
CvSeq* seq_pt = cvEndWriteSeq( &writer ); //two corners-pts in a seq
rect_pt = cvBoundingRect( seq_pt, 0 ); //rect_pt is a CvRect
Here is a page that describes operations on cvSeqs. It has a function to create one, and then a function to push a point on to it, which you can call twice. cvBoundingRect() can then take that cvSeq as a parameter.