Skip to content
Snippets Groups Projects
Commit 4fd6b51a authored by Hyunseok_Sang's avatar Hyunseok_Sang
Browse files

이미지를 인코딩 하는 객체를 분화했습니다.

해당 클래스에 np.ndarray를 base64로 인코딩 하는 메서드를 추가했습니다.
parent 21b0d0fe
No related branches found
No related tags found
No related merge requests found
import cv2
import base64
class ImageEncoder:
@staticmethod
def encode_np_image_base64(image):
_, img_encoded = cv2.imencode('.jpg', image)
img_string = base64.b64encode(img_encoded).decode('utf-8')
return img_string
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment