opencv4nodejs
Advanced tools
Comparing version 2.36.0 to 2.36.1
{ | ||
"name": "opencv4nodejs", | ||
"version": "2.36.0", | ||
"version": "2.36.1", | ||
"description": "Asynchronous OpenCV 3.x API for node.js", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -255,2 +255,13 @@ opencv4nodejs | ||
// load base64 encoded image | ||
const base64text='data:image/png;base64,R0lGO..';//Base64 encoded string | ||
const base64data =base64text.replace('data:image/jpeg;base64','') | ||
.replace('data:image/png;base64','');//Strip image type prefix | ||
const buffer = Buffer.from(base64data,'base64'); | ||
const image = cv.imdecode(buffer); //Image is now represented as Mat | ||
// convert Mat to base64 encoded jpg image | ||
const outBase64 = cv.imencode('.jpg', croppedImage).toString('base64'); // Perform base64 encoding | ||
const htmlImg='<img src=data:image/jpeg;base64,'+outBase64 + '>'; //Create insert into HTML compatible <img> tag | ||
// open capture from webcam | ||
@@ -257,0 +268,0 @@ const devicePort = 0; |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10355067
446