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
import cv2 | |
import numpy as np | |
w,h = 640,480 | |
cam = cv2.VideoCapture(0) | |
cam.set(cv2.CAP_PROP_EXPOSURE,-6) | |
cv2.namedWindow("src") | |
cv2.namedWindow("dst", cv2.WINDOW_NORMAL) | |
cv2.moveWindow("dst",w,0) |
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
import py5 | |
class Quad: | |
def __init__(self, s): | |
self.p = list(map(int, s.split(" "))) | |
def load_quads(filename): | |
return [Quad(s) for s in py5.load_strings(filename)] | |
def draw_quads(xy_quads, uv_quads, tex): |
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
PImage cam, screen; | |
ArrayList<Quad> cam_quads, screen_quads; | |
void setup() { | |
size(1280, 480, P3D); | |
cam = loadImage("vis_200.png"); | |
cam_quads = load_quads("cam_quads.txt"); | |
screen_quads = load_quads("screen_quads.txt"); | |
} |
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
# By Rick Companje, 2023-08-26 | |
# Enjoy! | |
# inspired by: https://stackoverflow.com/questions/10196198/how-to-remove-convexity-defects-in-a-sudoku-square/11366549#11366549 | |
# Please let me know if you know an easier/better way to achieve this simple 2D mapping in OpenCV. | |
# Something like OpenGL vertex / texcoords approach but then in OpenCV... | |
import cv2,csv | |
import numpy as np |
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
#https://becominghuman.ai/real-time-finger-detection-1e18fea0d1d4 | |
def bgSubMasking(self, frame): | |
"""Create a foreground (hand) mask | |
@param frame: The video frame | |
@return: A masked frame | |
""" | |
fgmask = bgSubtractor.apply(frame, learningRate=0) | |
kernel = np.ones((4, 4), np.uint8) |
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
//NodeJS | |
var express = require('express'); | |
var app = express(); | |
var http = require('http').Server(app); | |
var fs = require('fs'); | |
var io = require('socket.io')(http); | |
app.use(express.static(__dirname, '/')); | |
io.on('connection', function(socket){ |
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
#!/Applications/Xcode.app/Contents/Developer/usr/bin/python3 | |
import config,json,os,subprocess,ocr2json | |
from tqdm import tqdm | |
from joblib import Parallel, delayed | |
import Quartz,Vision | |
from Cocoa import NSURL | |
from Foundation import NSDictionary | |
from wurlitzer import pipes # needed to capture system-level stderr |
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
PREFIX v: <https://archief.io/veld#> | |
PREFIX soort: <https://archief.io/soort#> | |
SELECT ?id | |
#, ?Jaar, ?Catalogusnummer, ?Beschrijving | |
FROM <https://data.netwerkdigitaalerfgoed.nl/MI2RDF/mi2rdf/graphs/HUA-beeldbank-april2020-9bestanden> | |
WHERE { | |
?foto v:id ?id . |
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
float heleCirkel = TWO_PI; //tau | |
void setup() { | |
size(500,500); | |
background(0); | |
smooth(); | |
} | |
void draw() { | |
background(0); |
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
////////////////////////////////////////////////////////////// | |
// testApp.h | |
////////////////////////////////////////////////////////////// | |
#pragma once | |
#include "ofMain.h" | |
class testApp : public ofBaseApp { | |
public: |