OpenCV imwrite saving complete black jpeg

前端 未结 3 1222
萌比男神i
萌比男神i 2021-01-04 11:26

I have done some pre processing for dft , and i am trying to save this image by imwrite.

My cropped image has this information

output.type()                


        
3条回答
  •  一向
    一向 (楼主)
    2021-01-04 11:51

    A Python solution for those who come here from Google

    import numpy as np
    import cv2
    
    frame_normed = 255 * (frame - frame.min()) / (frame.max() - frame.min())
    frame_normed = np.array(frame_normed, np.int)
    
    cv2.imwrite("path/to/out/file", frame_normed)
    

提交回复
热议问题