You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: