Skip to content

Instantly share code, notes, and snippets.

@robosina
robosina / main.cpp
Created November 2, 2020 06:24
camera calibration in opencv
int main(int argc, char* argv[]) {
int n_boards = 0; // Will be set by input list
float image_sf = 0.5f;
float delay = 1.f;
int board_w = 0;
int board_h = 0;
if(argc < 4 || argc > 6) {
cout << "\nERROR: Wrong number of input parameters";
help( argv );
@plembo
plembo / RPIwithQEMU.md
Last active July 10, 2024 01:59
Emulating a Raspberry Pi with QEMU

Emulating a Raspberry Pi with QEMU

Goal: Emulate a Raspberry Pi with QEMU in order to run the Raspbian O/S (based on Debian Linux).

The current setup is not ideal. For one thing, the maximum RAM allowed using the "versatile-pb" firmware is 256 Mb. In addition, only the most basic peripherals, a keyboard and mouse, are supported.

A number of articles have been written on this topic. Most are outdated, and the few recent ones are missing key information.

@markjay4k
markjay4k / animated3Dplot.py
Last active July 18, 2024 02:59
animated 3D example using PyQtGraph and OpenGL
# -*- coding: utf-8 -*-
"""
Animated 3D sinc function
"""
from pyqtgraph.Qt import QtCore, QtGui
import pyqtgraph.opengl as gl
import pyqtgraph as pg
import numpy as np
import sys
@import 'https://fonts.googleapis.com/css?family=Open+Sans';
* {
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
body {
font-family: 'Open Sans', sans-serif;
line-height: 1.75em;
@jeteon
jeteon / dms2dec.py
Last active June 4, 2021 17:43 — forked from tomwhipple/dms2dec.py
Convert coordinates in DMS notation to decimal in Python.
#!/env/python
# coding=utf8
"""
Converting Degrees, Minutes, Seconds formatted coordinate strings to decimal.
Formula:
DEC = (DEG + (MIN * 1/60) + (SEC * 1/60 * 1/60))
Assumes S/W are negative.
@Overdrivr
Overdrivr / Plot.py
Created February 4, 2016 13:38
PyQtGraph animated sine and cosine functions - real smooth
# -*- coding: utf-8 -*-
from pyqtgraph.Qt import QtGui, QtCore
import numpy as np
from numpy import arange, sin, cos, pi
import pyqtgraph as pg
import sys
class Plot2D():
def __init__(self):
self.traces = dict()
@muhammadyaseen
muhammadyaseen / SCCB_Arduino.c
Last active February 22, 2023 08:05 — forked from freespace/gist:2585921
Arduino SCCB Driver for OV7670 Camera Module
#define SIO_C 2
#define SIO_D 4
#define SIO_CLOCK_DELAY 100
void setup()
{
pinMode(8,OUTPUT);
// while(1)
// {
@jctosta
jctosta / screen_cheatsheet.markdown
Last active July 23, 2024 06:50
Screen Cheatsheet

Screen Quick Reference

Basic

Description Command
Start a new session with session name screen -S <session_name>
List running sessions / screens screen -ls
Attach to a running session screen -x
Attach to a running session with name screen -r
@rdb
rdb / js_linux.py
Last active May 17, 2024 03:24
Access joysticks/game controllers from Python in Linux via the joystick driver. See https://discourse.panda3d.org/t/game-controllers-on-linux-without-pygame/14128
# Released by rdb under the Unlicense (unlicense.org)
# Based on information from:
# https://www.kernel.org/doc/Documentation/input/joystick-api.txt
import os, struct, array
from fcntl import ioctl
# Iterate over the joystick devices.
print('Available devices:')
@iikuy
iikuy / gist:8115191
Last active March 18, 2024 19:55
producer-consumer in C++11
#include <thread>
#include <iostream>
#include <queue>
std::mutex mx;
std::condition_variable cv;
std::queue<int> q;
bool finished = false;