Skip to content

Instantly share code, notes, and snippets.

View Lukse's full-sized avatar

Saulius Lukse Lukse

View GitHub Profile
@Lukse
Lukse / CamTest.pde
Created October 13, 2019 14:44 — forked from companje/CamTest.pde
Kurokesu C1 Pro webcam (with modified firmware) + 1.25mm FishEye lens working in Processing
import processing.video.*;
Capture cam;
void setup() {
size(640, 480, P3D);
cam = new Capture(this, 640, 480, "i Zone 1080p Starvis Camera");
cam.start();
}
brightness (int) : min=0 max=255 step=1 default=128 value=128
contrast (int) : min=0 max=255 step=1 default=128 value=128
saturation (int) : min=0 max=255 step=1 default=128 value=128
white_balance_temperature_auto (bool) : default=1 value=1
gain (int) : min=0 max=255 step=1 default=0 value=0
power_line_frequency (menu) : min=0 max=2 default=2 value=2
0: Disabled
1: 50 Hz
2: 60 Hz
white_balance_temperature (int) : min=2000 max=7500 step=10 default=4000 value=4000 flags=inactive
brightness (int) : min=0 max=255 step=1 default=128 value=128
contrast (int) : min=0 max=255 step=1 default=128 value=128
saturation (int) : min=0 max=255 step=1 default=128 value=128
white_balance_temperature_auto (bool) : default=1 value=1
gain (int) : min=0 max=255 step=1 default=0 value=0
power_line_frequency (menu) : min=0 max=2 default=2 value=2
white_balance_temperature (int) : min=2000 max=7500 step=10 default=4000 value=4000 flags=inactive
sharpness (int) : min=0 max=255 step=1 default=128 value=128
backlight_compensation (int) : min=0 max=1 step=1 default=1 value=1
exposure_auto (menu) : min=0 max=3 default=3 value=3
ioctl: VIDIOC_ENUM_FMT
Index : 0
Type : Video Capture
Pixel Format: 'YUYV'
Name : YUYV 4:2:2
Size: Discrete 640x480
Interval: Discrete 0.033s (30.000 fps)
Interval: Discrete 0.042s (24.000 fps)
Interval: Discrete 0.050s (20.000 fps)
Interval: Discrete 0.067s (15.000 fps)
@Lukse
Lukse / 00_distortions.py
Last active October 9, 2024 16:08
7 segment LCD Optical Character Recognition
from imutils.perspective import four_point_transform
from imutils import contours
import imutils
import cv2
import json
def rot90(img, rotflag):
""" rotFlag 1=CW, 2=CCW, 3=180"""
if rotflag == 1:
img = cv2.transpose(img)
@Lukse
Lukse / LED_panel_over_MQTT.py
Created January 8, 2017 16:47
LED panel control over MQTT for Node-RED
# -*- coding: utf-8 -*-
import json
import paho.mqtt.client as paho
from PIL import Image
from PIL import ImageDraw
from PIL import ImageFont
import time
from rgbmatrix import RGBMatrix
#from samplebase import SampleBase
@Lukse
Lukse / detect_barcodes.py
Created August 21, 2016 10:21
Detect barcodes
# -*- coding: utf-8 -*-
from sys import argv
import zbar
from PIL import Image
import cv2
import numpy as np
from tqdm import trange
def detect(im):
@Lukse
Lukse / generate_qrcode.py
Created August 21, 2016 08:52
Generate QRcode
import qrcode
import cv2
import numpy
import PIL as Image
qr = qrcode.QRCode(
version=1,
error_correction=qrcode.constants.ERROR_CORRECT_M, # 15
box_size=20,
border=1,
@Lukse
Lukse / generate_barcode.py
Last active August 21, 2016 08:40
Generate barcode
from StringIO import StringIO
from PIL import Image
import cv2
import barcode
from barcode.writer import ImageWriter
import numpy as np
# print barcode.PROVIDED_BARCODES
code = barcode.get('code128', 'RN012345678LT', writer=ImageWriter())
@Lukse
Lukse / img_sum.py
Created August 15, 2016 11:01
Stack images by summing frames
import os
import fnmatch
import numpy as np
from PIL import Image
from tqdm import trange
images_in = "img"
brighness_divide = 5.0