pyufunc.img_CV_to_bytes#

pyufunc.img_CV_to_bytes(img)#

Convert OpenCV numpy array to image bytes.

Parameters:

img (np.ndarray) – OpenCV numpy array

Returns:

image bytes

Return type:

bytes

Example

>>> from pyufunc import img_CV_to_bytes, img_show
>>> import cv2
>>> img = cv2.imread('test.jpg')
>>> img_b = img_CV_to_bytes(img)
>>> img_show(img)