Contour questions

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Contour questions

Stefán Freyr Stefánsson
Hello.

I hope I'm not double posting but I sent this message previously through my email account but it didn't seem to get through and I can't find it in the archives on the Yahoo page.

I'm trying to match contours found in one image to another image.

The scenario is that I have two images of different sizes. In one of them (smaller one) I've managed to extract pretty clean contours of objects.

1st problem:
I would like to scale those contours over to my second image. In this pass I just want to translate the relative position of the contour points from the smaller image where they were originally computed over to the larger image. In other words, I'm just scaling the contour to match the size of the image, I'm not trying to fit the contour exactly to the corresponding object in the larger image.

2nd problem:
After I translate the contours so they apply to the larger image, I want to create a new IplImage for each contour. Each of these should contain only the contents within that contour. Anything outside the contour should be just white (or black).

Can anyone give me some pointers on how I should tackle the above problems?

Best regards, Stefan Freyr Stefansson.

Reply | Threaded
Open this post in threaded view
|

Re: Contour questions

sateesh-4
Hi,
 
1st problem:
When translating a contour, you can use a simple image resize algo for your contour positions. After that I suggest a B-Spline/ Bezier curve approximation of all the contour points will recreate your contour close to the original.

2nd problem:
I am just being curious here, why don't you use snake/gradient vector flow algorithm to get the contour and the pixels inside and then resize your image?
This will make things easier.

Sateesh.  
   



--- In [hidden email], "stefan.freyr" <stefan.freyr@...> wrote:

>
> Hello.
>
> I hope I'm not double posting but I sent this message previously through my email account but it didn't seem to get through and I can't find it in the archives on the Yahoo page.
>
> I'm trying to match contours found in one image to another image.
>
> The scenario is that I have two images of different sizes. In one of them (smaller one) I've managed to extract pretty clean contours of objects.
>
> 1st problem:
> I would like to scale those contours over to my second image. In this pass I just want to translate the relative position of the contour points from the smaller image where they were originally computed over to the larger image. In other words, I'm just scaling the contour to match the size of the image, I'm not trying to fit the contour exactly to the corresponding object in the larger image.
>
> 2nd problem:
> After I translate the contours so they apply to the larger image, I want to create a new IplImage for each contour. Each of these should contain only the contents within that contour. Anything outside the contour should be just white (or black).
>
> Can anyone give me some pointers on how I should tackle the above problems?
>
> Best regards, Stefan Freyr Stefansson.
>