how to convert pixel value to 0 and 1 only or (0 and 255) only?
8 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
yasmin ismail
el 15 de Oct. de 2023
Comentada: Dyuman Joshi
el 16 de Oct. de 2023
I tried to used (rgb2gray) and (imbinarize) for each image but I cannt get only 1 and 0 value , still have 148 and others
how to fix it?
3 comentarios
yasmin ismail
el 15 de Oct. de 2023
Editada: Walter Roberson
el 15 de Oct. de 2023
Image Analyst
el 15 de Oct. de 2023
Don't call imread (you already did that) and don't put quotes around im_bin2 in this line:
BW_groundTruth = imread('im_bin2');
Do this instead:
BW_groundTruth = im_bin2;
Respuesta aceptada
Dyuman Joshi
el 15 de Oct. de 2023
im2 = imread('Label7027_157.png');
im_gray2 = rgb2gray(im2);
im_bin2 = imbinarize(im_gray2);
all(ismember(im_bin2,[0 1]),'all')
im1 = imread('new7027-157.png');
im_gray1 = rgb2gray(im1);
im_bin1 = imbinarize(im_gray1);
all(ismember(im_bin1,[0 1]),'all')
%% Jcard index
similarity = jaccard(im_bin1,im_bin2)
2 comentarios
Dyuman Joshi
el 16 de Oct. de 2023
@yasmin ismail, That question is not related to your original question. Also, it is more related to Image processing than it is related to MATLAB. So, I will not be answering it (nor do I have enough experience with Image processing).
And I see that you have already asked a new question here - https://in.mathworks.com/matlabcentral/answers/2033924-is-there-a-method-to-capire-similarity-between-two-images
So, if my answer solved the questions you have asked, please consider accepting it.
Más respuestas (0)
Ver también
Categorías
Más información sobre Image Processing Toolbox en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!