views:

409

answers:

2

hi everyone, i need to compute Laplacian Matrix-L for an image(nXn) in opencv...computing goes as follows.......... δij − 1/|wk|{[1+1/(ε/|wk|+σ2)][(Ii-µk)*(Ij −µk)]}.... for all(i,j)∈wk,summing over k yields (i,j)th element of L. where Here δij is the Kronecker delta,µk and σ2k are the mean & variance of intensities in the window wk around k,and |wk| is the number of pixels in this window.wk is 3X3 window... here am not clear about 2 things... 1.what ll be the size of L?nXn or (nXn)X(nXn)??
2.how to select Ii and Ij separately in 2D image? The original paper is here(( http://www.wisdom.weizmann.ac.il/~levina/papers/Matting-Levin-Lischinski-Weiss-CVPR06.pdf)...I have Matlab implementation(http://read.pudn.com/downloads98/sourcecode/graph/texture_mapping/400605/getLaplacian1.m__.htm#googtrans/auto/en ) but dont know anything in it...you u can analyze it... is there anyone to crack the meaning of above equation??my head is almost blank now...

A: 

If you can have a connection between any pixel and any other pixel, then I'd think the size of L would be n^2 by n^2.

Second question, I don't know.

John at CashCommons
thanx 4 reply....ya its affinity among (i,j) before summation over k...but am not able to visualize it a n^2 X n^2 matrix
ajith
If you have a 100x100 image, your L matrix is 10,000 x 10,000. Just map your pixels to the line index as 100*i + j or something like that.
John at CashCommons
k...what about Ii and Ij??
ajith
after 70 views also my problem is not solved..y?...:(
ajith
ajith: Your question as posed is mainly a computation question, and there's a fair bit of background someone would need to understand what you need. I think your question is more about the image processing problem you have rather than implementing it in code. SO is for programming questions and answers. If you have *code* that's not working, you'll likely get more help. As of now you're still struggling with understanding your problem, so unless you find someone who's solved your problem before, you're not likely going to get an answer here. But post some code and we'll try again.
John at CashCommons
@John:here am pasting what i have done so far in computing L...please go throgh...
ajith
+1  A: 

You should take a look at

K. He, J. Sun and X. Tang. Fast Matting Using Large Kernel Matting Laplacian Matrices. CVPR, 2010.

I think it is easier to understand there, and - probably even more important -, they describe a significantly faster approach.

zerm
@zerm:ya...I did implemented it after a week of effort...now this paper came...want to checkout this also...are u working on this?
ajith
@ajith I'm thinking about giving it a try. I currently have no serious work to do with that, rather toying around in my spare time. If you managed to get the original approach done in OpenCV, i would be more than glad if you could share, however!
zerm
@zerm:yesh..some how I did it...but its darn slow...takes 2 mins to get output..just drop a mail to [email protected] your contact mail id...
ajith