Imshow saturating though the pixel-by-pixel data is same
Ältere Kommentare anzeigen
I've a text file with ',' delimiter with the data from the image in memory.
I have parsed it to get a Matrix then an image after converting the data to uint8. I have the same image taken with other API's.
The data read by both pixel-by-pixel looks same but display saturates at high intensity areas. i.e Display is different even though sum(sum(abs(Mat1-Mat2))) = 0
M = textread('alphabet.txt','%d','delimiter',',');
B1 = vec2mat(M); %Converts the column vector to 1280X1024 Matrix (See link for actual fn)
B1 = uint8(B1);
B2 = imread('Test.bmp');
subplot(1,2,1)
imshow(B1);
subplot(1,2,2)
imshow(B2);
Sum_of_abs_diff = sum(sum(abs(B1-B2)))
Max_Diff = max(max(B1-B2))
%Both are Zero
pause(2)
close all;
end
All code and data with images are here. Run Test.m
2 Kommentare
Walter Roberson
am 8 Jan. 2013
I do not know what a .zipx file is, but I would not expect that I can read it on my system.
Sridutt Nayak
am 8 Jan. 2013
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Images finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!