Click here to Skip to main content
13,046,679 members (59,424 online)
Rate this:
Please Sign up or sign in to vote.
See more:
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 29-Apr-12 17:54pm
And ROI is?.. Return Of Investment? Rate Of Return? Royal Institute of Oil Painters? Risk Of Infection? :-)
BupeChombaDerrick 29-Apr-12 18:49pm
ROI is Region Of Interest. Anyways who knows exactly what it means here in the question :-)
SAKryukov 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 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
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 30 Apr 2012
Copyright © CodeProject, 1999-2017
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