필터 지우기
필터 지우기

what does count pixel =0 indicates?

조회 수: 1 (최근 30일)
yasmin ismail
yasmin ismail 2023년 7월 13일
이동: Voss 2023년 7월 31일
After I applied stretching method and try to find threshold I got zero at count pixels as shown in image , what does it means and it happens only when I used png format or tif, while jpg I got concve curve for threshold.
My model is working well even with this fixed line but I want know why it happens and what does it means?

답변 (2개)

DGM
DGM 2023년 7월 14일
편집: DGM 2023년 7월 14일
I don't know what app this is, and I don't know what the image is or how it has been processed, so I'm going to have to assume some things.
  1. I assume that the thresholding is not inclusive of the specified lower boundary (i.e. >, not >=)
  2. I assume that the image is binarized full-scale uint8
Given #2, all pixels should be either 0 or 255. There should be zero pixels which are between (but not equal to) the specified thresholds, so the result should be black.
The reason the JPG image gives results is because it has damaged the image.
Even if the image is not strictly binarized, JPG will still alter values, leading to different results.
If my assumptions are incorrect, feel free to clarify.
  댓글 수: 2
Image Analyst
Image Analyst 2023년 7월 14일
DGM
DGM 2023년 7월 14일
Ah. Then the lower test is inclusive of 0. I didn't notice that was an empty histogram. I don't know how OP would get that, even from an improperly-scaled image.

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


Image Analyst
Image Analyst 2023년 7월 14일
It looks like your input image is practically binary already, because there is no histogram shown in the plot. Is it already binary? If so, you don't want to threshold it again. What is the input image's class? Logical, uint8, or double? Regardless the histogram y axis should show something, not -1 to 1.
Please attach the image just before you pass it in to my thresholding program so I can check to make sure everything is working normally. The app should work with any class of variable, e.g. uint8, double, etc.
  댓글 수: 12
yasmin ismail
yasmin ismail 2023년 7월 31일
이동: Voss 2023년 7월 31일
and this comment to binarize the image
stretched_Image(stretched_Image == 255) = 0;
?
Image Analyst
Image Analyst 2023년 7월 31일
이동: Voss 2023년 7월 31일
That creates a logical image of where stretched_Image equals 255 and then it sets all those pixel locations to a value of 0.
Again, never save images to JPG, as Walter said, because it corrupts the image and generates noisy artifacts.
Not sure what "stretched" means but if you did something like imadjust before continuing to process the image, that is almost always unneeded and just slows down the process. If you do something like binarize the image, the threshold will be found and the image will get binarized correctly regardless if you stretched the contrast or not, so might as well save time and not do it.

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

카테고리

Help CenterFile Exchange에서 Convert Image Type에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by