While I can write a whole image to a file with
cvSaveImage("image.png", img);
how can I write only a given rectangle from the image I’m working on to a file?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There’s
Matconstructor:So just use it!
Or if you use
c(notc++) interface than you have to set ROI (Region Of Interest):http://nashruddin.com/OpenCV_Region_of_Interest_(ROI)/
Your code should look like this:
If you want to work again with full image than you have to reset ROI: