def get_frame(self): ret, frame = self.cap.read() laplacian = cv2.Laplacian(frame,cv2.CV_64F) cv2.imwrite('image.jpg',np.hstack((frame,laplacian))) return open('image.jpg', 'rb').read()