Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

draw rectangle change image property unexpected!

Hi, I have a question regarding the drawing function "rectangle" from opencv 3.2. I think there is a mistake.

The following methods suppose not to change the input "img", since it is a copy of "img" pass to the method. But the "rectangle" method change the property of the input "img" even no reference as input pass to the method.

See my example: // input is a copy of image void drawPatch (cv::Mat img){ rectangle (.....); } void drawCorner(cv::Mat img){ circle(....); }

int main(){

cv::Mat img = imread('1.jpg');

imshow("1", img); drawCorner(img);
imshow("2", img;) // it shows the original img, with drawn corners. no reference as input. drawPatch(img);
imshow("3", img); // it shows the drawn rectangle even no reference as input.

return 0; }

I hope that i have make my point clear. Please let me know if there is a mistake. Thx.

draw rectangle change image property unexpected!

Hi, I have a question regarding the drawing function "rectangle" from opencv 3.2. I think there is a mistake.

The following methods suppose not to change the input "img", since it is a copy of "img" pass to the method. But the "rectangle" method change the property of the input "img" even no reference as input pass to the method.

See my example: example:

// input is a copy of image
void drawPatch (cv::Mat img){
       rectangle (.....);
}
void drawCorner(cv::Mat img){
   circle(....);
}

} int main(){

main(){ cv::Mat img = imread('1.jpg');

imread('1.jpg'); imshow("1", img); drawCorner(img);
imshow("2", img;) // it shows the original img, with drawn corners. no reference as input. drawPatch(img);
imshow("3", img); // it shows the drawn rectangle even no reference as input.

return 0; }

}

I hope that i have make my point clear. Please let me know if there is a mistake. Thx.

draw rectangle change image property unexpected!

Hi, I have a question regarding the drawing function "rectangle" from opencv 3.2. I think there is a mistake.

The following methods suppose not to change the input "img", since it is a copy of "img" pass to the method. But the "rectangle" method change the property of the input "img" even no reference as input pass to the method.

See my example:

// input is a copy of image
void drawPatch (cv::Mat img){
       rectangle (.....);
}
void drawCorner(cv::Mat img){
   circle(....);
}

int main(){

cv::Mat img = imread('1.jpg');

imshow("1", img);
drawCorner(img);       
imshow("2", img;)         // it shows the original img, with without drawn corners. no reference as input.
drawPatch(img);         
imshow("3", img);        // it shows the drawn rectangle even no reference as input.  


return 0;
}

I hope that i have make my point clear. Please let me know if there is a mistake. Thx.