Skip to content
This repository was archived by the owner on Oct 18, 2023. It is now read-only.

Commit 9b4fdb6

Browse files
added xmodules.face check to face recognition examples
1 parent bfe8159 commit 9b4fdb6

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

examples/faceRecognition0.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ const fs = require('fs');
22
const path = require('path');
33
const cv = require('../');
44

5+
if (!cv.xmodules.face) {
6+
return console.log('exiting: opencv4nodejs compiled without face module');
7+
}
8+
59
const basePath = '../data/face-recognition';
610
const imgsPath = path.resolve(basePath, 'imgs');
711
const nameMappings = ['daryl', 'rick', 'negan'];

examples/faceRecognition1.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ const fs = require('fs');
22
const path = require('path');
33
const cv = require('../');
44

5+
if (!cv.xmodules.face) {
6+
return console.log('exiting: opencv4nodejs compiled without face module');
7+
}
8+
59
const basePath = '../data/face-recognition';
610
const imgsPath = path.resolve(basePath, 'imgs');
711
const nameMappings = ['daryl', 'rick', 'negan'];
@@ -70,4 +74,4 @@ faces.forEach((faceRect) => {
7074
);
7175
});
7276

73-
cv.imshowWait('result', twoFacesImg);
77+
cv.imshowWait('result', twoFacesImg);

0 commit comments

Comments
 (0)