Image load problem (HELP)
13 次查看(过去 30 天)
显示 更早的评论
Hi , my question is How to load different type of image into program.
I have two type of image which are 8bit depth (grayscale) and 24bit depth (RGB).
However, the wiener2 noise filter function only can read image with 8 bit depth .
The following code is my idea ,but I don't know how to define the bit depth of a /chosenfile .It is possible to work ? or any idea?
[file path] = uigetfile('*.jpg','Select any image');
chosenfile = [path file];
a = imread(chosenfile);
if BitDepth(a) == 24 ;
b=rgb2gray(a);
c=wiener2(b,[2,2]);
axes(handles.axes1)
imshow(c)
handles.c=c;
guidata(hObject, handles)
else
b=wiener2(a,[2,2]);
axes(handles.axes1)
imshow(b)
handles.b=b;
guidata(hObject, handles)
end
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Processing Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!