Problem with filtering an image
이전 댓글 표시
Whats up folks I'm having a little problem in filtering this image: http://img15.imageshack.us/img15/9287/palhaco.png
The source code is bellow:
C = imread('Palhaco.png');
imshow(C);
figure;
g = fspecial('gaussian',15,2);
imagesc(g); colormap(gray);
surfl(g)
figure;
gC = convn(C,g,'same');
imshow(convn(C,[-1 1],'same'));
figure;
imshow(convn(gC,[-1 1],'same'));
figure;
dx = convn(g,[-1 1],'same');
imshow(convn(C,dx,'same'));
figure;
lg = fspecial('log',15,2);
lC = convn(C,lg,'same');
imshow(lC)
figure
imshow(C + .2*lC)
When I compile the program, It returns: "Integers can only be combined with integers of the same class, or scalar doubles."
I'm open to any idea at all!
댓글 수: 1
Pallavi Bidri
2019년 2월 19일
By using imtool function, check the class of both images that you want to combine.
If any image is of different class, convert it to any1 class to match with the other by using the command,
im2double(image) %converts given image to class double
im2uint8(image) % converts the given image to class uint8
generally, im2---(image) % dash after im2 can be the desired class that you want to be of
채택된 답변
추가 답변 (2개)
Rama Ratna
2011년 10월 21일
카테고리
도움말 센터 및 File Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!