Last active
January 1, 2016 14:59
-
-
Save ayapi/8161498 to your computer and use it in GitHub Desktop.
opencv-nodeをっかって画像を階調反転して表示する
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
var cv = require('opencv-node'); | |
var path = require('path'); | |
var fullpath = path.resolve('./lena.png'); | |
console.log('Opening ', fullpath); | |
var src = cv.imread(fullpath, -1); | |
if(src.empty) return console.log('Error opening file'); | |
cv.namedWindow("Original", 1); | |
cv.imshow("Original", src); | |
cv.bitwise_not(src, src); | |
cv.namedWindow("RGB Invert", 1); | |
cv.imshow("RGB Invert", src); | |
cv.closeOnEsc(); | |
cv.runMessageLoop(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment