How to find the wavelength from a given photo?

조회 수: 5 (최근 30일)
Pijush
Pijush 2017년 12월 8일
댓글: Image Analyst 2017년 12월 11일
I want to find the wave-length of few spectral lines like the picture below
Is it possible since i want to use these kind of pictures to find wave length and use those wavelength for using in formulas.
I don't have any other software other than mathlab like simulink.
  댓글 수: 3
Pijush
Pijush 2017년 12월 8일
no its just a image from Wikipedia. I just want a approximate value so that what ever image i use i can get a wavelength from it and i don't have to put them manually. @starStrider
Star Strider
Star Strider 2017년 12월 8일
That’s a nonstandard format (.svg), at least for MATLAB. When I tried to load it with imread, it threw an error.
Image Analyst may have some thoughts...

댓글을 달려면 로그인하십시오.

답변 (1개)

Image Analyst
Image Analyst 2017년 12월 8일
You'd have to know what column corresponds to what wavelength. For example, is column 1 defined to be 400 nm and the last column is 700 nm? If so, you can just basically take the column, turn it into a percentage of the way from left to right, then multiply by 300 (=700-400) and add 400.
[rows, columns, numberOfColorChannels] = size(rgbImage);
allColumns = 1 : columns;
wavelength = (700-400) * allColumns / columns + 400;
To get the wavelength at some particular column, say column 250, just do
wavelengthAtCol250 = wavelength(250);
  댓글 수: 8
Pijush
Pijush 2017년 12월 11일
편집: Pijush 2017년 12월 11일
i am getting error on line 2
invalid constant left hand side of assignment
>>> [1,40,3] = size(rbgImgage);
with a small arrow below the 3
the code i put was
rbgImage = imread ("s.jpg")
[1,40,3] = size(rbgImgage);
allColumns = 1 : 3;
wavelength = (700-400)*allColumns / 300 + 400;
wavelengthAtCol250 = wavelength(450);
and how to implement this code
logicalIndexes = yourImage(1, :, 1) ~= 0;
Image Analyst
Image Analyst 2017년 12월 11일
Now, I didn't do that, did I? What I did was
[rows, columns, numberOfColorChannels] = size(rgbImage);
allColumns = 1 : columns;
Why did you change it? You can't put constants on the left hand side because size() is going to try to fill up those spots with the values. Also you misspelled rgbImage.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Read, Write, and Modify Image에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by