Image processing help. Multiplication of Images gives different results at Unit16, unit 32, unit 8.
显示 更早的评论
[EDIT: 20110611 23:32 CDT - reformat - WDR]
Codes :
a=imread('b.jpg');b=imread('c.jpg');c=a.*b;imshow(c)
a1=uint16(a);b1=uint16(b);c1=a1.*b1;imshow(c1)
a2=uint32(a);b2=uint32(b);c2=a2.*b2;imshow(c2)
I am not sure how to upload the picture I am using. I will let you know the problem now.
I am trying to 2 images. a and b.
1) Using unit 8 , I get some distortions.
2) Using unit 16, I am getting the required image.
3) Using unit 32, I am getting a complete black image.
Please let me know the problem. My friend needs this for her project. She asked me, I am not sure what is the problem. Please reply. Thank you.
采纳的回答
更多回答(1 个)
Alex Taylor
2011-6-13
Hi Vijay,
Walter's answer is accurate. I just wanted to add that since you have the Image Processing Toolbox, you might look at the Image Processing functions im2uint16 and im2uint32.
Unlike the MATLAB casting functions Walter used, the Image Processing Toolbox conversion functions manage both the casting and rescaling of your data when moving to other datatypes.
doc im2uint16
类别
在 帮助中心 和 File Exchange 中查找有关 Convert Image Type 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!