Laplacian and sobel for image processing
古いコメントを表示
Hello im having trouble finding how to do the laplacian and sobel of an image I tried the following but none of the 2 results are like what is showed in the book The original image i'm working on is image (a)
Code I tried:
img = imread ('imagename'); A=[0 -1 0 ; -1 4 -1 ; 0 -1 0]; result1 = imfilter (img,A); result2 = conv2 (img,A);
********************
Here are the book results

採用された回答
その他の回答 (1 件)
Bruno Pop-Stefanov
2013 年 11 月 25 日
1 投票
Make sure img is in right format. imfilter will work on a grayscale uint8 image. However, conv2 will only work on a double image. Use im2double to convert it.
5 件のコメント
John Snow
2013 年 11 月 25 日
Bruno Pop-Stefanov
2013 年 11 月 25 日
Can you post a link to the image so that I can try?
John Snow
2013 年 11 月 25 日
Image Analyst
2013 年 11 月 25 日
John, my code does exactly what you wanted.
John Snow
2013 年 11 月 25 日
カテゴリ
ヘルプ センター および File Exchange で Image Transforms についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
