Hello ,
I've seen many similar questions but i am still confused . I have a grayscale image and i want to normalize it.How can i do that ? I have seen that grey2mat() does the job but i am not sure .
Thank you.

 채택된 답변

Image Analyst
Image Analyst 2020년 11월 20일

0 개 추천

What's your definition of normalize? You can use mat2gray(), rescale(), or simply divide by the actual max and multiply by the desired max. It just depends on how you define it. What's your definition? How do you plan on using it?

댓글 수: 4

Gn Gnk
Gn Gnk 2020년 11월 21일
I have an assignment that is devided in steps . In the first step i applied top-hat transformation on an image . In the 2nd step i was asked to normalize the top-hat transformed image (just that nothing more ) . And then , in the 3rd step to apply the otsu's method .Just that .That's why i am so confused .
Gn Gnk
Gn Gnk 2020년 11월 21일
4th step :Binarize(im2bw) the normalized image with the threshold found in 3rd step . Hope it helps.
Image Analyst
Image Analyst 2020년 11월 21일
편집: Image Analyst 2020년 11월 21일
The second step is not necessary. Not sure why they wanted you to do it. Otsu's method can work with the original range. Rescaling the image does nothing to help it. It just finds the threshold at a different (higher) threshold than it would have with the original, unscaled image. But anyway, you can scale it like this:
imshow(topHatImage, []);
normalizedImage = mat2gray(topHatImage); % Rescale to 0-1 range.
imshow(normalizedImage, []); % Will look the same since I used [].
threshold = graythresh(normalizedImage)
mask = imbinarize(normalizedImage, threshold); % Apply Otsu method.
imshow(mask); % Display thresholded image.
Saud Alfalasi
Saud Alfalasi 2020년 11월 21일
Hi Image Analyst
May you please look at my questions
https://uk.mathworks.com/matlabcentral/answers/656073-split-rgb-image-into-blocks-24-bit?s_tid=srchtitle

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

추가 답변 (0개)

질문:

2020년 11월 20일

댓글:

2020년 11월 21일

Community Treasure Hunt

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

Start Hunting!

Translated by