Skip to content

Instantly share code, notes, and snippets.

@tocttou
Created August 6, 2016 15:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tocttou/58ef4c77d06c0190443ec721e1a233d4 to your computer and use it in GitHub Desktop.
Save tocttou/58ef4c77d06c0190443ec721e1a233d4 to your computer and use it in GitHub Desktop.
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