How to do i reconvert my binarizied image back to original image?

Viewed 51
import cv2

im=cv2.imread('spider.png',-1)

cv2.imshow("original image",im)

cv2.waitKey(0)

gray_pic = cv2.cvtColor(im, cv2.COLOR_BGR2GRAY)

r, threshold = cv2.threshold(gray_pic, 127, 255, cv2.THRESH_BINARY) 

cv2.imshow('Binary Image',threshold)

cv2.waitKey(0) 
1 Answers

It is not possible because you lose information when you binarize the original image. You can only recover the original image when using lossless compression

Related