Quantcast

cvLut for morphological operation (clean, bridge,...)

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

cvLut for morphological operation (clean, bridge,...)

sonmi0
Hi,

I need to do some morphological operation on images , as for example clean and bridge.

I saw that matlab use LUTs to do this ( bwmorph.m, lutbridge.m)

I found the cvLut function for OpenCV
Matlab use a 512x1 vector as lut, instead cvLut use a 256x1 vector

If I understand well matlab use a matrix for the combinations like:
1   8   64
2   16  128
4   32  256

I thought that cvLut use
1   8  32
2      64
4  16  128

It's right?
Could someone help me?

Thanks,
sonmi


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: cvLut for morphological operation (clean, bridge,...)

sonmi0
I searched for connect and morphological operations but I don't find anything.

Can someone help me?

Have a nice day
Ruggero

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: cvLut for morphological operation (clean, bridge,...)

sonmi0
I found the answer,

       1  8   64
M =    2  16  128
       4  32  256

- filter2D image and M
- split the image from 0-255 and 256-511
- remap from 256-511 to 0-255
- split the matlab lut (512 to 2*256)
- cvlut for the first and the second part
- add the two images


Sonmi

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: cvLut for morphological operation (clean, bridge,...)

dash
This post has NOT been accepted by the mailing list yet.
Hello,

I want to apply Matlab's lookup table (512 element, 9bits) to OpenCV (256 element, 8 bits). How can I do so? How has the person at this post done so?

http://opencv-users.1802565.n2.nabble.com/template/NamlServlet.jtp?macro=print_post&node=5629924

In my opinion, they've filtered according to a matrix M. Divided the image on the basis of colorspace (???) (How to do such a thing) then applied the broken down LUT's twice and then added the results. I want to do this for binary images.

Please help me with this.

Best

JW
Loading...