how to mask an image?

29 views (last 30 days)
sheno39
sheno39 on 19 Sep 2013
I = imread('E:\M.E 3rd semester\project\coding\flower.jpg');
I = rgb2gray(I);
J=ones(3,3)/9;
K = conv2(I,J,'same');
Warning: CONV2 on values of class UINT8 is obsolete. Use CONV2(DOUBLE(A),DOUBLE(B)) or CONV2(SINGLE(A),SINGLE(B)) instead.
Can anyone help to correct the error?
  2 Comments
sheno39
sheno39 on 20 Sep 2013
Thanks for your explanation. As am new to image processing in matlab it would be more helpful to me.

Sign in to comment.

Accepted Answer

Anand
Anand on 19 Sep 2013
I = im2double(imread('..'));
I = rgb2gray(I);
J = ones(3)/9;
K = conv2(I,J,'same');
  1 Comment
sheno39
sheno39 on 20 Sep 2013
thank you..

Sign in to comment.

More Answers (2)

Image Analyst
Image Analyst on 20 Sep 2013
Edited: Image Analyst on 20 Sep 2013
Regarding your comment asking for a masking demo, one of mine is attached. Click on it below to see it.

Matt J
Matt J on 19 Sep 2013
I = double(rgb2gray(I));
  3 Comments
sheno39
sheno39 on 20 Sep 2013
thank you..

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!