Click here to Skip to main content
11,789,350 members (44,308 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: C++ OpenCV
HI Everyone!

I am working in image processing and in this field of programming i am a beginner.
I wanna detect rectangel on picture i am using openCV librarys and C++.
How can i set a ROI on image, with Opencv, if i have white background and about in the center of image i have an rectangle with black background.
The image size is(800*600px) and the rectangel's size (150*150px);
I dont know exactly where is that rectangle in image.
This is a gray scaled image.

Thank you advance!
Posted 28-Apr-12 21:54pm
SAKryukov at 29-Apr-12 17:54pm
And ROI is?.. Return Of Investment? Rate Of Return? Royal Institute of Oil Painters? Risk Of Infection? :-)
BupeChombaDerrick at 29-Apr-12 18:49pm
ROI is Region Of Interest. Anyways who knows exactly what it means here in the question :-)
SAKryukov at 29-Apr-12 22:43pm
Thank you very much. Anyway, abbreviations is evil in most cases, and using this one makes a question not quite valid.
BupeChombaDerrick at 30-Apr-12 8:22am
you are welcome.
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Are you asking for an algorithm to detect a rectangle or how to set and unset Region of Interest(ROI)?



to set ROI where img = image, x,y are anchor points for the rectangle



to unset ROI

Then all processing will take place within the specified region of interest (ROI).

Hope this helps

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 929
1 Maciej Los 765
2 KrunalRohit 666
3 CPallini 606
4 Richard MacCutchan 420

Advertise | Privacy | Mobile
Web02 | 2.8.1509028.1 | Last Updated 30 Apr 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100