how can choose threshold method for image with four intensity level?

3 ビュー (過去 30 日間)
sara
sara 2016 年 4 月 28 日
コメント済み: Image Analyst 2016 年 4 月 29 日
hi all I want to choose threshold method for image with four intensity level. this is my histogram of my image:
which threshold method is better for my image? I mean if my image has The low number of intensity level which thresholding method is better? and why?
thanks

回答 (2 件)

Image Analyst
Image Analyst 2016 年 4 月 28 日
Try this
binaryImage1 = yourImage == value1;
binaryImage2 = yourImage == value2;
binaryImage3 = yourImage == value3;
binaryImage4 = yourImage == value4;
You can tell what the values are from the histogram or using unique(yourImage).
  7 件のコメント
Image Analyst
Image Analyst 2016 年 4 月 28 日
Can you attach the original image, without the red curve, and also with the full number of gray levels, not one that has been quantized so much that it's essentially worthless for medical diagnostic purposes?
Image Analyst
Image Analyst 2016 年 4 月 28 日
See attached demo.

サインインしてコメントする。


Walter Roberson
Walter Roberson 2016 年 4 月 28 日
Nearly any JPEG image is going to have more than 4 levels. JPEG uses lossy compression that is not able to exactly reconstruct images You will get aliasing effects at edges, pixels that are not exactly what you want.
You should use multithresh and imquantize . The result will be a labeled image. You might want to subtract 1 from the labels so that the black becomes 0 so that it can be ignored afterwards.
  2 件のコメント
sara
sara 2016 年 4 月 29 日
編集済み: sara 2016 年 4 月 29 日
thanks dear Image Analyst and Walter Roberson.
yes multithresh give me the good result for my images. my images have 4 segments and I want to convert these images to binary images. now, this is my question: why multithresh for these images give me the good results? Is there any reason for this?
Is multithresh good for images whit low number of intensity?
I hope I could explain my Meaning. thanks
Image Analyst
Image Analyst 2016 年 4 月 29 日
multithresh was only needed because you jpegged the image and basically ruined it. It is not needed to segment out the brain. Look at the histogram in my screenshot. See how it's not 4 spikes like in your original histogram picture you posted? The spikes have become widened because the jpegging introduced several new gray levels. We not only have the 4 original ones, but we have a bunch more. Your image got changed. This is why you never use jpeg format for image analysis if you can at all help it. multithresh basically figures out the thresholds to produce an image with the 4 original gray levels. If you had saved as a PNG file, you would not have had that problem.

サインインしてコメントする。

Community Treasure Hunt

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

Start Hunting!

Translated by