Enhanced image is not getting saved as it. Values get changed after imwrite()

조회 수: 1 (최근 30일)
Puja Bharti
Puja Bharti 2018년 10월 4일
편집: Puja Bharti 2018년 10월 7일
My ques is: if I save the enhanced image then using imshow(NSS_Img,[]) I get the same enhanced image. But if I use imshow(NSS_Img) the image is not the saved enhanced image. Please help. Actually, I want to enhance image X and save it and then crop a small portion from the saved enhanced image. But, the values of NSS_img and the image after saving is not same. my code is given below:
X = imread(imfile(image).name);
filename = imfile(image).name;
full_file = fullfile('C:\Users\Puja Bharti\Desktop\matlab\',filename);
[pathname, name, ext] = fileparts(full_file);
s1 = 'En';
s2 = filename;
s = strcat(s1,s2);
new_name = fullfile(pathname, s)
if size(X,3)==3
X = rgb2gray(X);
end
grayImage= im2double(X);
figure('Name','Original image'), imshow(grayImage)
NSS_img = NSS(grayImage); %NSS_img is enhanced image
whos NSS_img
figure('Name','final image'), imshow(NSS_img,[])
imwrite(NSS_img,new_name,'png','Mode','lossless');
  댓글 수: 7
Puja Bharti
Puja Bharti 2018년 10월 7일
편집: Puja Bharti 2018년 10월 7일
Thank you @Walter. Thank you so much...... Yes now I am getting the exact enhanced image.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Image Filtering and Enhancement에 대해 자세히 알아보기

태그

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by