Extract contour of an image and plot it

3 ビュー (過去 30 日間)
Easir Papon
Easir Papon 2019 年 4 月 26 日
コメント済み: Image Analyst 2023 年 7 月 29 日
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.
Picture4.png

採用された回答

Walter Roberson
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 件のコメント
Jean-Parfait
Jean-Parfait 2023 年 7 月 29 日
Thank you
Image Analyst
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 ExchangeContour Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by