Hey guys I need help ,it's about image processing together with michelson interferometer

well lets just make a long story short.i need to find the beta value out of an image like the one I uploaded ,the red color in the image follows the formula: 0.5*(1-cos((2*pi/lamdaR)*beta*(nR-nG)+x.*tan(deg2rad(1))));when:lamdaR=0.65;nG=1.5184;nR=1.5146;and x it's a known vector in length of the mean averages of the red color from the uploaded image.
well it isn't that short after all...thanks..!

10 Commenti

I did my best to understand what you want to do, but I couldn’t get past ‘x it's a known vector in length of the mean averages of the red color from the uploaded image’ ?
Isolating the red channel is easy enough (thank you Image Analyst):
[B10,B10m] = imread('beta10','jpg');
B10R = B10(:,:,1); % Get red channel
but what then? (I know B10R should be cast as a double and subtracted from 255, but that’s as far as I can get.) I have no idea how that relates to the expression you posted.
Code something up to give us a clue as to what you want to do.
thank u Star Stider for helping.this is my code:
clc,clear
A='C:\Users\Sagipc\Desktop\beta10.jpg';
pic=double(imread(A,'jpg'));
pic1=mean(pic(40:1:360,80:1:500,1));%margin-free picture
pic1=(pic1-min(pic1));
pic1=pic1./max(pic1);
Im=pic1;%messured intensity
x=[1:length(Im)];
beta=[-30:30];
lamdaB=0.45;
lamdaG=0.55;
lamdaR=0.65;
%nB=1.5253;
nG=1.5184;
nR=1.5146;
for f=1:length(beta)
BETA=beta(f);
It=0.5*(1-cos((2*pi/lamdaR)*(BETA)*(nR- nG)+x.*tan(deg2rad(1))));
err(f)=sum(abs(It-Im));
end
for i=1:length(beta)
if err(i)==min(err)
fprintf('%g',beta(i));
end
end
I hope that now u understand better my problem
You forgot to attach beta10.jpg - that causes delays in answers.
It’s the image in the Question.
I’m not sure I’m any closer to understanding it, though.
Yes, but that's a screenshot or the whole figure. We can't use it with the axes in there - we need just the plain image itself.
Good point.
I still wish I had some sort of reference for the equation and process in the code. My search turned up nothing. I can’t tell if it’s working if I don’t know what it’s supposed to do.
thank u both for helping me. I'll try again to better explain myself now. I have this image that i got from Michelson Interferometer on a color ccd,now I should find beta from the image,this beta paremeter describes a mistake in the beam splitter cube. the cosine equation(describes the Interferometer) applyes for green,red,blue color seperatly.I need to basically match between the image and the cosine and to find beta. x-describes the place on the ccd, Im not sure how i should handle it either ,maybe that was the cause of the confusion. In a few simple words:I input an image and get an output beta. I'll attach a genuine image that I work with ,with beta=77 microns. Im still new with all this Matlab so I'll appreciate any help.
Do you have a source (preferably a PDF of a paper, book excerpt or other detailed explanation) for the equation you are using? If So, could you attach it?
Im sory Star Strider but I don't have anything like that.to understand this equation it is necessary to have some knowledge in optical engieering.but what is the problem with the equation? 0.5*(1-cos((2*pi/lamdaR)*beta*(nR-nG)+x.*tan(deg2rad(1)))) it's a periodic function just like the red color in the image...
It’s just easier to work from the original information rather than derived code, in the event there is an error in the code.
While I’m here though, why tan(deg2rad(1)) rather than simply tand(1)? If you’re calculating in degrees rather than radians, use the trigonometric degree functions (they all have a ‘d’ appended to their names, as tand here). They’re more accurate (and precise) than converting to radians and using the trigonometric radian functions.

Accedi per commentare.

Risposte (1)

I assume you will take just one of those color channels and take a profile and then try to fit it to that complicated equation. Maybe the Curve Fitting Toolbox can do it. I'd maybe do it just numerically. Get the profile and loop over a bunch of beta's until the residual (sum of absolute values of differences between fit and actual) is minimum. Kind of a unclever, dumb, brute force numerical approach, but it should work. Maybe someone else will have a more clever curve fitting method that is more elegant and direct.

1 Commento

thanks, but that was exactly what I was trying to fo in my code that I posted in my second comment, for some reson it doesn't work.

Accedi per commentare.

Richiesto:

il 24 Ago 2014

Commentato:

il 26 Ago 2014

Community Treasure Hunt

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

Start Hunting!

Translated by