klaasdude | 21 Oct 09:17 2008
Picon

circular ROI

Hi guys,

i was wondering if anyone could help me. i want to select a ROI as a 
circle instead of a rectangle. 
I've read something about using a mask but till now i couldn't get it 
to work. 
Anyone can help me on this and post a hint or sample text or 
something, i'd greatly appreciate it.

Thanks

------------------------------------

Change settings: http://www.yahoogroups.com/mygroups, select
   Get Emails (get all posts)
   Daily Digest (one summary email per day)
   Read on the web (read posts on the web only)Or Unsubscribe by mailing OpenCV-unsubscribe <at> yahoogroups.com
Diego Trally | 22 Oct 12:50 2008
Picon

Re: circular ROI

You cant really set a ROI different of a rectangle.  You can use the mask in
some functions, it's just another image (same size of ROI), where the
non-zero pixels indicate pixels that will be used

2008/10/21 klaasdude <klaasdude <at> yahoo.com>

>   Hi guys,
>
> i was wondering if anyone could help me. i want to select a ROI as a
> circle instead of a rectangle.
> I've read something about using a mask but till now i couldn't get it
> to work.
> Anyone can help me on this and post a hint or sample text or
> something, i'd greatly appreciate it.
>
> Thanks
>
> 
>

--

-- 
[]'s #

[Non-text portions of this message have been removed]

------------------------------------

Change settings: http://www.yahoogroups.com/mygroups, select
   Get Emails (get all posts)
   Daily Digest (one summary email per day)
(Continue reading)

klaasdude | 23 Oct 08:23 2008
Picon

Re: circular ROI

Thx diego, i figured this part out and it's working great.
One more question, is it possible to print text to an image with 
openCV or do i need some image library to do this..
IE i need to label the different spots i want to process so i know 
what data in the console belongs to which spot in the masked image.
So only a numbering would be enough, from 1 till x numbers of spots. 
Any way to do this?

thanks again

--- In OpenCV <at> yahoogroups.com, "Diego Trally" <dtrally <at> ...> wrote:
>
> You cant really set a ROI different of a rectangle.  You can use 
the mask in
> some functions, it's just another image (same size of ROI), where 
the
> non-zero pixels indicate pixels that will be used
> 
> 2008/10/21 klaasdude <klaasdude <at> ...>
> 
> >   Hi guys,
> >
> > i was wondering if anyone could help me. i want to select a ROI 
as a
> > circle instead of a rectangle.
> > I've read something about using a mask but till now i couldn't 
get it
> > to work.
> > Anyone can help me on this and post a hint or sample text or
> > something, i'd greatly appreciate it.
(Continue reading)

jplandry | 23 Oct 18:20 2008
Picon

Re: Re: circular ROI

Have a look at

cvInitFont  & cvPutText

"klaasdude" <klaasdude <at> yahoo.com> 
Sent by: OpenCV <at> yahoogroups.com
2008-10-23 02:23
Please respond to
OpenCV <at> yahoogroups.com

To
OpenCV <at> yahoogroups.com
cc

Subject
[OpenCV] Re: circular ROI

Thx diego, i figured this part out and it's working great.
One more question, is it possible to print text to an image with 
openCV or do i need some image library to do this..
IE i need to label the different spots i want to process so i know 
what data in the console belongs to which spot in the masked image.
So only a numbering would be enough, from 1 till x numbers of spots. 
Any way to do this?

thanks again

--- In OpenCV <at> yahoogroups.com, "Diego Trally" <dtrally <at> ...> wrote:
>
> You cant really set a ROI different of a rectangle. You can use 
(Continue reading)

Entrada | 23 Oct 18:24 2008
Picon

Re: Re: circular ROI

like this:

CvFont font1;
cvInitFont(&font1, CV_FONT_HERSHEY_SIMPLEX, 0.8, 0.8, 0, 2);
cvPutText(image, temp1, cvPoint(50, 210), &font1, cvScalar(0, 0, 300));

Regards,
2008/10/23 <jplandry <at> ca.ibm.com>

>   Have a look at
>
> cvInitFont & cvPutText
>
> "klaasdude" <klaasdude <at> yahoo.com <klaasdude%40yahoo.com>>
> Sent by: OpenCV <at> yahoogroups.com <OpenCV%40yahoogroups.com>
> 2008-10-23 02:23
> Please respond to
> OpenCV <at> yahoogroups.com <OpenCV%40yahoogroups.com>
>
> To
> OpenCV <at> yahoogroups.com <OpenCV%40yahoogroups.com>
> cc
>
> Subject
> [OpenCV] Re: circular ROI
>
>
> Thx diego, i figured this part out and it's working great.
> One more question, is it possible to print text to an image with
> openCV or do i need some image library to do this..
(Continue reading)

klaasdude | 23 Oct 19:54 2008
Picon

Re: circular ROI

--- In OpenCV <at> yahoogroups.com, Entrada <entrada <at> ...> wrote:
>
> like this:
> 
> CvFont font1;
> cvInitFont(&font1, CV_FONT_HERSHEY_SIMPLEX, 0.8, 0.8, 0, 2);
> cvPutText(image, temp1, cvPoint(50, 210), &font1, cvScalar(0, 0, 300));
> 
> Regards,
> 2008/10/23 <jplandry <at> ...>
> 

Yes! Exactly what i needed, thanks.

> >   Have a look at
> >
> > cvInitFont & cvPutText
> >
> > "klaasdude" <klaasdude <at> ... <klaasdude%40yahoo.com>>
> > Sent by: OpenCV <at> yahoogroups.com <OpenCV%40yahoogroups.com>
> > 2008-10-23 02:23
> > Please respond to
> > OpenCV <at> yahoogroups.com <OpenCV%40yahoogroups.com>
> >
> > To
> > OpenCV <at> yahoogroups.com <OpenCV%40yahoogroups.com>
> > cc
> >
> > Subject
> > [OpenCV] Re: circular ROI
(Continue reading)

Jared Contrascere | 22 Oct 03:01 2008
Picon

Re:circular ROI

klassdude,

I wrote two functions for you, cvSetCircularROI() and
cvSetEllipticalROI().  The function prototypes are...

CvArr* setCircularROI(IplImage* img, CvPoint loc, int radius)
CvArr* setEllipticalROI(IplImage* img, CvRect sel)

The returned CvArr* is your mask, so make sure to save it to a local
variable and pass it as necessary.  You'll also need to use
cvReleaseImage() on it to free its memory.

Call cvReleaseROI() as usual to clear the image ROI.

//////////////------------ Begin Code ------------//////////////

CvArr* setCircularROI(IplImage* img, CvPoint loc, int radius)
{
	int size = radius * 2;

	cvSetImageROI(img, cvRect(loc.x-radius, loc.y-radius, size, size));

	IplImage* mask = cvCreateImage(cvSize(size, size), IPL_DEPTH_8U, 1);
	cvZero(mask);
	cvDrawCircle(mask, cvPoint(radius, radius), radius, cvScalar(255,
255, 255), CV_FILLED);

	return mask;
}

(Continue reading)


Gmane