Commit 096e37de authored by Michael Murtaugh's avatar Michael Murtaugh

new files

parent 18cb8174
Raspberry PI startup
# /etc/xdg/lxsession/LXDE-pi/autostart
@lxpanel --profile LXDE-pi
@pcmanfm --desktop --profile LXDE-pi
@xset s off
@xset -dpms
@xset s noblank
@/home/pi/start
# ALSO HAVE (with xscreensaver)
@xscreensaver -no-splash
#/home/pi/start
#!/bin/bash
chromium --kiosk --incognito http://10.9.8.7:10987/collage.html
......@@ -2,6 +2,9 @@ document.addEventListener("DOMContentLoaded", function () {
var FONT = "Logisoso",
STATIC_BASE = "";
window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame;
function imageloop (redraw) {
var that = {},
index,
......
......@@ -9,5 +9,5 @@
<script src="lib/collagecode.js"></script>
<script src="collage.js"></script>
</head>
<body><div id="content"><canvas id="canvas"></canvas></div></body>
<body id="collage"><div id="content"><canvas id="canvas"></canvas></div></body>
</html>
......@@ -2,6 +2,8 @@ document.addEventListener("DOMContentLoaded", function () {
var FONT = "Logisoso",
STATIC_BASE = "";
var sockaddr = window.location.protocol+'//'+window.location.host,
socket;
......@@ -20,7 +22,12 @@ document.addEventListener("DOMContentLoaded", function () {
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
window.addEventListener("resize", function () {
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
})
var eyepos = 0;
socket.on("bcast", function (data) {
console.log("bcast", data);
// if (data.msg == "face" || data.msg == "eye") {
......@@ -30,11 +37,12 @@ document.addEventListener("DOMContentLoaded", function () {
img.src = data.src;
img.addEventListener("load", function () {
ctx.drawImage(img, data.rect.x, data.rect.y, data.rect.width, data.rect.height,
data.rect.x + randint(0, 10),
data.rect.y + randint(0, 10),
eyepos,
10,
data.rect.width,
data.rect.height);
})
eyepos += data.rect.width + 5;
} else if (data.msg == "face") {
var img = new Image();
img.src = data.src;
......
#!/usr/bin/env python
from __future__ import print_function
import numpy as np
import cv2, os, json
import cv2, os, json, sys
#tpath = os.path.expanduser("~/opencv/opencv-3.0.0/data/haarcascades")
tpath = os.path.expanduser("~/opencv/data/haarcascades")
......@@ -41,14 +42,16 @@ def process_image (img):
# print args.input
output = []
for i in args.input:
img = cv2.imread(i)
numinput = len(args.input)
for i, path in enumerate(args.input):
print ("{0}/{1} {2}".format(i, numinput, path), file=sys.stderr)
img = cv2.imread(path)
detection, faces, eyes = process_image(img)
item={'path':args.input}
item={'path': path}
if detection:
item['faces'] = faces
item['eyes'] = eyes
output.append(item)
print json.dumps(output)
print (json.dumps(output))
settings.json:
node server_init.js > settings.json
archive.json: archive/
./getfaces.py archive/* > archive.json
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>SICV: search</title>
<link rel="stylesheet" href="styles.css">
<script src="lib/d3.min.js"></script>
<script src="lib/socket.io.js"></script>
<script src="lib/collagecode.js"></script>
<script src="search.js"></script>
</head>
<body id="search"><div id="content"><canvas id="canvas"></canvas></div></body>
</html>
document.addEventListener("DOMContentLoaded", function () {
var FONT = "Logisoso",
STATIC_BASE = "";
window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame;
var canvas = document.getElementById("canvas"),
ctx = canvas.getContext("2d");
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
window.addEventListener("resize", function () {
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
})
var sockaddr = window.location.protocol+'//'+window.location.host,
socket;
console.log("opening connection to", sockaddr);
socket = io.connect();
socket.on("connect", function (data) {
// console.log("connect");
});
socket.on("record_image", function (data) {
// console.log("record_images", data);
loop.add_image(STATIC_BASE + data.image);
})
socket.on("record_end", function (data) {
// loop.run();
});
socket.on("facedetect", function (data) {
// console.log("facedetect", data);
faces.push(data[0]);
var i = loop.next(); // now showing the analyzed frame
if (i == 29) {
console.log("end of analysis, faces:", faces.length);
state = STATE_SHOW_ANALYSIS;
loop.run();
} else {
window.setTimeout(analyzeframe, 0);
}
})
d3.json("archive.json", function (data) {
console.log("archive.json", data);
// wait for start signal...
// then loop through all the images showing them one by one...
var img = new Image();
img.addEventListener("load", function () {
ctx.drawImage(img, 0, 0);
})
img.src = data[0].path;
})
})
......@@ -8,6 +8,14 @@ body {
background: black;
}
body#collage {
background: gray;
}
body#search {
background: #22AA22;
}
#content {
position: absolute;
left: 0;
......
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>SICV: text</title>
<link rel="stylesheet" href="styles.css">
<script src="lib/d3.min.js"></script>
<script src="lib/socket.io.js"></script>
<script src="lib/collagecode.js"></script>
<script src="text.js"></script>
</head>
<body></body>
</html>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment