If i use cv2.imencode(’.jpg’,img) and then use image = cv2.imdecode(img_encode, cv2.IMREAD_COLOR) i get the error like “TypeError: buf is not a numerical tuple” but if cv2.imencode(’.jpg’,img)[1] is used then it shows the frame correctly. So, what does cv2.imencode(’.jpg’,img)[1] imply?
import numpy as np
import cv2
imgg=cv2.imread(‘filename1_dec.jpg’)
img_encode=cv2.imencode(’.jpg’,img)[1]
image = cv2.imdecode(img_encode, cv2.IMREAD_COLOR)
cv2.imshow(‘img_decode’,image)
cv2.waitKey()