Intel® Integrated Performance Primitives
Community support and discussions relating to developing high-performance vision, signal, security, and storage applications.
6621 Discussions

How to get which "label" corresponds to which "seed" in the Distance Transform.

rsapaico
Beginner
151 Views
Hello, I hope you can help me with the following:

I am using the Distance Transform function (ippiDistanceTransform_3x3_8u32f_C1R). My input image has the "seeds" as zeroes, and I am obtaining an output image containing the distance to those seeds.

However, I need also to know, for a given pixel (x,y) whose distance size is "d", which "seed" this distance is relative to. In other words, for each "non-feature" pixel I would like to obtain not only "distances" but also "associations" to a seed pixel.
I have searched the IPP Documentation and I could not find anything about that.

EDIT: I think what I am asking is the same as obtaining the "Voronoi Diagram" for the image, so any hints on this are also appreciated.

I hope I could made myself clear. Any hint will be highly appreciated.

Regards,
Ricardo
0 Kudos
3 Replies
Chao_Y_Intel
Employee
151 Views


Hi Ricardo,

ippiDistanceTransform is optimized functions for OpenCV function, cvDistTransform(..). It is true that these function do not record the associated seed pixel. Possibly you can modify the cvDistTransform() function ( in OpenCV cvdistransform.cpp file) and recorded the seed pixel according to the requirement in your application.

Thanks,
Chao

rsapaico
Beginner
151 Views
Hi Chao,

Thank you very much for your response.
I will see what I can do using your suggestion. If I get any good results, I will post back.

Regards,
Ricardo
lilin_f_
Beginner
151 Views

Hi,

see cv::DistanceTransformLabelTypes, just a hint.

Reply