Laplacian edge operator

조회 수: 13 (최근 30일)
Tina
Tina 2011년 5월 30일
i coded up Laplacian edge operator using MFC c++ .. now i want to varify the result using matlab..
Laplacian Operator and Campass Gradient Operator: result is given below website: http://imm.io/626r
I used Prewitt for Compass Gradeint Operator ... How can i apply this in matlab ?
how can i apply laplacian operator in maltab.. is there any function for that ? i need a sample or example for laplacian operator in matlab.. any one can help me please ?
Thanks in Advace

채택된 답변

David Young
David Young 2011년 5월 30일
I assume that the mask you applied in C++ was
0 -1 0
-1 4 -1
0 -1 0
and not what you gave in your comment to Oleg's reply.
If that's the case, then all you'd need to do in Matlab is to call the conv2 function, something like this:
mask = [0 -1 0; -1 4 -1; 0 -1 0];
result = conv2(image, mask);
You may need to select the right option for what to do at the boundaries of the image, to match what you did in C++.
  댓글 수: 4
Tina
Tina 2011년 5월 30일
Are you there Sir David ? Can you please guide me...
I applied the above matlab statement but my result is not same as matlab ..
David Young
David Young 2011년 5월 30일
You will need to show the results so I can see what the difference is. I suggest you apply both your C++ code and Matlab code to a very small array, and show the input and the results here.

댓글을 달려면 로그인하십시오.

추가 답변 (2개)

Oleg Komarov
Oleg Komarov 2011년 5월 30일
Are you referring to discrete laplacian?
  댓글 수: 1
Tina
Tina 2011년 5월 30일
I applied this mask :
0 -4 0
-1 4 -1
0 -1 0
for laplacian in c++

댓글을 달려면 로그인하십시오.


Harsha Vardhan Rao  Avunoori
Harsha Vardhan Rao Avunoori 2011년 5월 30일
If you are interested in applying a Laplacian mask to determine the edges then you can try this
BW = edge( I,'log');
where I is your input image you can also search for edge in your MATLAB Help
  댓글 수: 1
David Young
David Young 2011년 5월 30일
This also does zero-crossing detection, so you can't compare the results directly to your C++ code.

댓글을 달려면 로그인하십시오.

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by