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!