IndiJones
Full Member level 2
multiplying image with mask in matlab
I have a 24 bit RGB image (bmp) that has 1024X1280X3 pixels and is of
uint8 type (matlab shows it when loading the image using 'imread'). I
would like to multiply it with a 3X3 matrix to see how the image
changes. When I do it using the following command:
Image2 = Matrix * Image1;
I get this message:
"??? Error: ==> mtimes
Integers can only be combined with integers of the same class, or
scalar doubles."
Then I converted Image1 into double using:
DoubleImage = imdouble(Image1);
And then tried to do the multiplication once again:
Image2 = Matrix1 * DoubleImage;
This time I got this error:
"??? Error: ==> mtimes
Input arguments must be 2-D."
Could anyone please tell me how am I going to do the multiplication
and then form the output image for viewing.
Thanks in advance!
I have a 24 bit RGB image (bmp) that has 1024X1280X3 pixels and is of
uint8 type (matlab shows it when loading the image using 'imread'). I
would like to multiply it with a 3X3 matrix to see how the image
changes. When I do it using the following command:
Image2 = Matrix * Image1;
I get this message:
"??? Error: ==> mtimes
Integers can only be combined with integers of the same class, or
scalar doubles."
Then I converted Image1 into double using:
DoubleImage = imdouble(Image1);
And then tried to do the multiplication once again:
Image2 = Matrix1 * DoubleImage;
This time I got this error:
"??? Error: ==> mtimes
Input arguments must be 2-D."
Could anyone please tell me how am I going to do the multiplication
and then form the output image for viewing.
Thanks in advance!