MATLAB: How to convert image of size < 256*256unit8> into size<256*256double> on matlab

digital image processingimage acquisitionimage analysisimage processingsignal processing

i have two image(suppose a and b) of size 256*256unit8 and of size 256*256double. and i want to modulate both image so how to do? modulation means a.*b but due to different size a.*b gives an error, so how to make same size of both images?

Best Answer

But both images have the same size, only the type differs. If you get an error, it would be useful if you post the complete message and the line of code, which produces the error.
The double array might have values between 0.0 and 1.0, while the uint8 image contains values in the range of 0 to 255. For the result this might be important. So perhaps you want:
a = randi([0, 255], 256, 256, 'uint8');
b = rand(256, 256);
c = double(a)/255 .* b;