How to divide intensity values of one grayscale image to the intensity values of another grayscale image??

1 次查看(过去 30 天)
Please help! I have two gray scale images. I want to divide each pixel value of one image with the corresponding pixel value of the other gray scale image.
Simply put, how to divide pixels of one gray scale image to the other?
Thanks.

采纳的回答

Image Analyst
Image Analyst 2014-9-2
If they're uint8, be sure to cast to double first or else you'll get clipping.
ratioImage = double(image1) ./ double(image2);
To display, use []:
imshow(ratioimage, []);
You can cast back to uint8 if you want, but that will lose fractions less than 1, so it should only be done when you know all the numbers will be well above 1.
ratioImage = uint8(ratioImage);

更多回答(1 个)

Stephen23
Stephen23 2014-9-2
If each of your grayscale images is the same size matrix, then you can simply use the matrix right division . This also has the shorthand ./ .

类别

Help CenterFile Exchange 中查找有关 Image Processing Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by