How to find the wavelength from a given photo?
27 次查看(过去 30 天)
显示 更早的评论
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 个评论
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
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 个评论
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 Center 和 File 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!