rectangle

detecting rectangle and the 4 corner coordinates from an image in opencv

hello i was going through the the program "square.c" in the sample of opencv which is working fyn in detecting rectangles in a given image and generates outline.. the array pt[] store the boundry points of rectangle....but what i need is only the 4 corner points of the rectangle...... need help thanks ...

create rectangles at runtime

I am trying to create rectangles and the number of rectangles is depend on data passed from database. for example, if number = 5, the program will generate 5 rectangles. Also, these rectangles must be able to follow my rectangle property settings, like height, width,color...put them in one line at the end. is there a way to do that? I ...