Skip to content

Loading supervised data, Bug #36

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

Closed
JeremyAlain opened this issue Dec 19, 2018 · 1 comment
Closed

Loading supervised data, Bug #36

JeremyAlain opened this issue Dec 19, 2018 · 1 comment

Comments

@JeremyAlain
Copy link

I had the following problem. I exported images form Lightroom and resized the long axis to be 512. I think that this does something with the format...because when I import the image with cv2.imread("file_name", -1) and I then print the array I have values that are in the 20-thousand range such as 23435. I think these are hex values for RGB(but no sure). What then happens is that cv2 has no problem reading the file or writing to it. But if you then try to multiply your output which is in the range of 0-1 times 255 you will just get a trash image.

So in case you get an image which is just rubish noise, you are most likely experiencing this. It took me several hours to find that out. The solution is simple.

Just change cv2.imread("filename", -1) to cv2.imread("filename",1).
This will then assume the image is colored and will directly cast the values into the rgb(0-255) range.

@nothinglo
Copy link
Owner

I think it is not a bug. It just depends on your format of the images.

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

2 participants