Created
August 6, 2016 15:56
-
-
Save tocttou/58ef4c77d06c0190443ec721e1a233d4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
import cvfy | |
app = cvfy.register('nongh:0.0.0.0:3000:8005:0.0.0.0') | |
@cvfy.crossdomain | |
@app.listen() | |
def grayscale(): | |
image_1 = cv2.imread('/home/abc.png') ## a numpy array | |
image_2 = cv2.imread('/tmp/123.jpg') ## a numpy array | |
gray_image_1 = cv2.cvtColor(image_1, cv2.COLOR_BGR2GRAY) ## a numpy array | |
gray_image_2 = cv2.cvtColor(image_2, cv2.COLOR_BGR2GRAY) ## a numpy array | |
cvfy.sendImageArray([gray_image_1, gray_image_2], mode = 'numpy_array') | |
return 'OK' | |
app.run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment