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
const DecimalJs = require('decimal.js'); | |
const Big = require('big.js'); | |
const BigInteger = require('big-integer'); | |
// const { init: initGMP, DivMode } = require('../dist/index.umd.js'); | |
const { init: initGMP, DivMode } = require('gmp-wasm'); | |
const piDecimals = require("pi-decimals"); | |
const mpzjs = require("mpzjs"); | |
function nullish(lhs, rhs) { | |
return (lhs === null || lhs === undefined) ? rhs : lhs |
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
begin | |
comment v0.1, only factors sometimes as of now | |
comment runs with this compiler: https://github.com/JvanKatwijk/algol-60-compiler | |
$ jff-algol Lehman_factor.alg | |
$ ./Lehman_factor | |
32639 3 | |
127 | |
$ | |
; |
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
#!/bin/bash | |
if [[ "$1" == "--help" ]]; then echo Format: "$0" "[options]"; exit; fi | |
read -r w h dummy < <(libcamera-vid --list-cameras | \ | |
grep "([1-9]" | cut -f3 -d: | sed "s#x# #") | |
dummy=$dummy | |
libcamera-vid -t 0 --width "$w" --height "$h" --preview=0,0,"$w","$h" "$@" |
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
#!/bin/bash | |
if [[ $# -lt 4 ]]; then echo Format: "$0" width height framerate ms [us]; exit; fi | |
if [[ $# -gt 4 ]]; then SHTR="--shutter"; else SHTR=""; fi | |
#TODO patch imx708.ko.xz, then activate with rmmod and modprobe | |
libcamera-hello --list-cameras | grep "([1-9]" | |
rm -f /dev/shm/tst.pts /dev/shm/tst.h264 | |
sleep 0.2 |
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
#!/bin/bash | |
if [[ "$1" == "--help" ]]; then echo Format: "$0" "[options]"; exit; fi | |
read -r w h dummy < <(libcamera-vid --list-cameras | \ | |
tail -1 | cut -f2 -d/ | sed "s#x# #") | |
dummy=$dummy | |
libcamera-vid -t 0 --width "$w" --height "$h" --preview=0,0,"$w","$h" "$@" |
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
#!/bin/bash | |
# shellcheck disable=SC2154 | |
# (silence shellcheck wrt $cam1 environment variable) | |
if [[ $# -lt 4 ]]; then echo "Format: [narrow=1] [cam1=1] $0 width height framerate ms [us]"; exit; fi | |
if [[ "$(( $1 % 2 ))" -eq 1 ]]; then echo "width has to be even"; exit; fi | |
if [[ "$(( $2 % 2 ))" -eq 1 ]]; then echo "height has to be even"; exit; fi | |
export SHTR=""; if [[ $# -gt 4 ]]; then SHTR="--shutter"; fi | |
export workaround=""; if [[ "" != "$(grep '=bookworm' /etc/os-release)" ]]; then workaround="--no-raw"; fi | |
export d=10; if [[ "" != "$(grep "Revision.*: ...17.$" /proc/cpuinfo)" ]]; then if [[ "$cam1" == "" ]]; then d=6; else d=4; fi; fi | |
for((m=0; m<=5; ++m)) |
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
#!/usr/bin/python3 | |
# | |
# Determine club head speed of a golf swing (high framerate video) frame: | |
# https://forums.raspberrypi.com/viewtopic.php?t=345368#p2070418 | |
import cv2 | |
import numpy as np | |
from sys import argv, exit | |
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
#!/usr/bin/python3 | |
import numpy as np | |
from picamera import PiCamera | |
win = 100, 100, 640, 480 | |
picam = PiCamera() | |
picam.resolution = (640, 480) |
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
#!/usr/bin/python3 | |
import numpy as np | |
from picamera2 import Picamera2, Preview | |
picam2 = Picamera2() | |
picam2.configure(picam2.create_preview_configuration()) | |
picam2.start_preview(Preview.QTGL, x=100, y=100, width=640, height=480) | |
picam2.start() |
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
# Based on: https://stackoverflow.com/questions/43665208/how-to-get-the-latest-frame-from-capture-device-camera-in-opencv/54755738#54755738 | |
# | |
# Added: | |
# - configurable delay handling | |
# - renamed class | |
# - per frame timestamp output | |
# | |
import cv2, threading, time, queue | |
from sys import argv |