After openCV saves the picture, it is a black picture solution

The saving is the imwrite function. I used dtype to print the data type of the pictures before and after saving. Before saving, it was float64, and after saving it was uint8. When the picture was printed, the pixels were all decimals, so it was a black picture.

If you want to display normally, you only need to convert the picture type back with .astype! Refer to this blog

 

Guess you like

Origin blog.csdn.net/weixin_44593822/article/details/114332813