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 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Image Processing Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!