Extract contour of an image and plot it
3 ビュー (過去 30 日間)
古いコメントを表示
Hi,
I want to extract the contour from an image and plot the contours assuming the center of the image as the (0,0) coordinate system.
I have attached my image too.
Thanks for your help.

0 件のコメント
採用された回答
Walter Roberson
2019 年 4 月 26 日
im = rgb2gray( imread('Picture4.png') );
contour(im,4)
There is an obvious difference between specifying 2 (contour levels) or 3. However, you have to be looking fairly closely to tell the difference between 3 vs 4. You probably will not be able to tell the difference between 4 and 5.
The image appears to be consistent with the possibility that someone converted an image to black and white, and then write the image as jpeg, and then read in the jpeg and wrote it as png. That is, the values that are not 0 (black) or 255 (white) occur only in boundary positions as-if they only existed due to the way DCT handles sharp edges (it blurs them, like anti-aliasing.)
11 件のコメント
Image Analyst
2023 年 7 月 29 日
@Jean-Parfait My demo does not reverse/invert the image intensities. I think you must have changed something. Nonetheless, I've updated a few lines in the demo and the updated code is attached.

その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Contour Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
