From d0c0a7d8860624dc1a45b44ad34fb0de20fbd88a Mon Sep 17 00:00:00 2001 From: Krerkkiat Chusap Date: Fri, 19 Aug 2016 15:07:20 -0400 Subject: [PATCH] Remove window form the Cylon's device config if the --no-window is passed as argument. --- app.js | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/app.js b/app.js index 714d394..54fdce6 100644 --- a/app.js +++ b/app.js @@ -111,19 +111,24 @@ var httpServer = http.createServer(function (request, response) { console.log('HTTP Server is running at http://localhost:%s', 8080); }); +var deviceConfig = { + camera: { + driver: "camera", + camera: 0, + haarcascade: __dirname + "/haarcascade_frontalface_alt.xml" + } +}; + +if (windowed === true) { + deviceConfig['window'] = { driver: "window" }; +} + Cylon.robot({ connections: { opencv: { adaptor: "opencv" } }, - devices: { - window: { driver: "window" }, - camera: { - driver: "camera", - camera: 0, - haarcascade: __dirname + "/haarcascade_frontalface_alt.xml" - } - }, + devices: deviceConfig, faces: undefined,