Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image with wavelength < 780nm #4

Open
giakoumoglou opened this issue Feb 23, 2022 · 0 comments
Open

Image with wavelength < 780nm #4

giakoumoglou opened this issue Feb 23, 2022 · 0 comments

Comments

@giakoumoglou
Copy link

giakoumoglou commented Feb 23, 2022

I found a bug, where the HSI2RGB throws an error if the image has wavelengths less than 780nm. In that case in the code, when you try to truncate at 780nm, i=find(wY>780);, the variable i is empty and error occurs. That can be fixed with an if statement:

% Truncate at 780nm
i=find(wY>780);
if ~isempty(i)
    i=i(1);
    Y=Y(:,1:i);
    wY=wY(1:i);
    I=I(1:i);
    x=x(1:i);
    y=y(1:i);
    z=z(1:i);
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant