Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

how to convert image in rectangle into gray??

Hello,

I am looking for logic or suggestions regarding to access the or do various operations with selected rectangles from the image. for example in given image I am able to draw rectangle by using rectangle function but I want to convert the selected rectangle parts into gray scale or to find the non zero element values for it.

image description

for (int i = 612; i >= 0; i = i-204)
{

cout << "i" << i << endl;

rectangle( roi1, Rect(i, 0, 161, 643),  (255, 255,255), 2, 8, 0 );//add this line to draw contour on main screen

}

imshow( "Display window", roi1 );

Is there any suggestions how can I do so?

Thank you very much in advance.

Regards.