Convert Spectral Radiance to RGB for Animal Eyes

版本 2.0.2 (116.6 KB) 作者: Cynthia
This function converts spectral radiance to RGB values that simulate real colors for animal eyes on an sRGB-calibrated display.
57.0 次下载
更新时间 2018/12/31

查看许可证

This function calculates the best-fit RGB values to make the color patches on a virtual stimulus look as color realistic as possible to another animal's visual system on an sRGB-calibrated display. This was originally written to accompany the paper:

Tedore C and Johnsen S. 2017. Using RGB displays to portray color realistic imagery to animal eyes. Current Zoology 63, 27-34, https://doi.org/10.1093/cz/zow076,

and has since been updated to accommodate any number of photoreceptor classes. Accompanying the m-file is a user input file called 'Spectral_Radiance_to_RGB_User_Spectra.xlsx' which the function reads and is essential to its functionality.

Upon running the function, the user will be prompted to input:
1. their study species' number of photoreceptor classes
2. the desired 0-255 level of the G phosphor for the background (sets the brightness of the background and can be tweaked over multiple runs to improve fit)

The function then reads the user input file. Into this file, the user must have inserted:
1. the spectral sensitivity of each of the study animal's photoreceptor classes
2. the radiance spectrum of each of the RGB display's phosphors
3. the background radiance spectrum to be simulated
4. the object color patch radiance spectra to be simulated

The best-fit b-factors and background and color patch RGB values will be printed in the command window and output as variables to the workspace.
bFactors = best-fit b-factors for each photoreceptor class (see Tedore & Johnsen 2017 for explanation)
backgrnd = best-fit RGB values for the background
colorPatches = best-fit RGB values for each color patch. Also shown for diagnostic purposes are the target and best obtained quantum catches for each photoreceptor class.
Bar charts showing the target versus best-fit quantum catches for each color patch will also be displayed.

If the animal has a UV photoreceptor class and the fit remains poor after tweaking the background brightness, the user should remove the UV photoreceptor class from the excel input file and re-run the function, specifying one fewer photoreceptor classes when prompted. The function will then calculate the best possible fit to the remaining photoreceptor classes.

For questions, please do not hesitate to contact the author directly or leave a comment below.

引用格式

Cynthia (2024). Convert Spectral Radiance to RGB for Animal Eyes (https://www.mathworks.com/matlabcentral/fileexchange/69853-convert-spectral-radiance-to-rgb-for-animal-eyes), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2017b
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Polygons 的更多信息
标签 添加标签

Community Treasure Hunt

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

Start Hunting!
版本 已发布 发行说明
2.0.2

improved computational efficiency

2.0.1

updated Description

2.0.0