create a polarization image
6 次查看(过去 30 天)
显示 更早的评论
hello everyone :)
i need help to create a pol image for my final project,
the formula is:
pol image = (HH-HV) / (HH+HV)
when HH is the first image (which I used two horizintal polarizers)
and HV is the second image (which I used two vertical polarizes).
In practice I just get a black picture, instead of a sharpened picture as I would like to get using this technique.
I'm a bit involved in implementing this in MATLAB.
I will be very grateful to you soon.
Attached is the code I tried and did not work for:
close all; clear all; clc;
h=imread('ofki.jpg');h=rgb2gray(h);
% v=imread('rohbi.png'); v=rgb2gray(v);
n = imadd(h,v,'uint8');
% m = imabsdiff(h,v);
m = imsubtract(h,v);
z = abs(imdivide(m,n));
imshow(z,[]);
2 个评论
Walter Roberson
2019-5-30
Use im2double so that you are working in floating point.
Your formula can produce negative values. Where H is 0 then you get -1 for any nonzero V value and nan if H and V are both 0.
For H nonzero and V 0 then you get 1.
For H and V nonzero and H<V you get a negative greater than -1
For H and V nonzero and H>V you get a positive less than 1.
Your range is thus -1 to +1 except for some nan. You need to accommodate this in your display such as using imagesc(pol, [-1, 1])
回答(1 个)
JENNY EKOZ
2019-5-30
5 个评论
Walter Roberson
2019-5-30
I did not see anything in the data that could reasonably be used to create sharp edges.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!