Skip to content

Instantly share code, notes, and snippets.

# https://subscription.packtpub.com/book/data/9781788474443/9/ch09lvl1sec12/restoring-a-3d-point-from-two-observations-through-triangulation
import cv2
import numpy as np
# camera projection matrices
P1 = np.eye(3, 4, dtype=np.float32)
P2 = np.eye(3, 4, dtype=np.float32)
P2[0, 3] = -1
@n1ckfg
n1ckfg / resizeNN_old.js
Last active June 7, 2023 01:55 — forked from gncgnc/resizeNN.js
Extends p5.Image to handle nearest neighbor resizing for scaling small images (e.g. pixel art) without blurring. You can also make regular images into pixelated images by shrinking then growing them with this method (a la MS Paint.)
/**
* Resize the image to a new width and height using nearest neigbor algorithm. To make the image scale
* proportionally, use 0 as the value for the wide or high parameter.
* For instance, to make the width of an image 150 pixels, and change
* the height using the same proportion, use resize(150, 0).
* Otherwise same usage as the regular resize().
*
* Note: Disproportionate resizing squashes the "pixels" from squares to rectangles.
* This works about 10 times slower than the regular resize. Any suggestions for performance increase are welcome.
*/
@n1ckfg
n1ckfg / resizeNN.js
Created June 6, 2023 18:11 — forked from GoToLoop/resizeNN.js
Extends p5.Image to handle nearest neighbor resizing for scaling images w/o blurring.
/**
* Resize the image to a new width and height using nearest neighbor algorithm.
* To make the image scale proportionally,
* use 0 as the value for the wide or high parameters.
* For instance, to make the width of an image 150 pixels,
* and change the height using the same proportion, use resize(150, 0).
* Otherwise same usage as the regular resize().
*
* Note: Disproportionate resizing squashes "pixels" from squares to rectangles.
* This works about 10 times slower than the regular resize.
# https://blenderartists.org/t/how-to-select-bone-child-objects-in-one-click/660780/16
bl_info = {
"name": "Select Siblings",
"author": "Stanislav Blinov",
"version": (1, 0, 0),
"blender": (3, 0, 0),
"description": "Select siblings in object mode (respecting distinct bone parents)",
"category": "Object",
}
import numpy as np
import open3d as o3d
rgb = o3d.io.read_image("rgb_image.jpg")
depth = o3d.io.read_image("depth_image.png")
#intrinsics = o3d.io.read_pinhole_camera_intrinsic("intrinsics.json")
intrinsics = o3d.camera.PinholeCameraIntrinsic(640, 480, fx=525.0, fy=525.0, cx=319.5, cy=239.5)
rgbd = o3d.geometry.RGBDImage.create_from_color_and_depth(rgb, depth)
@n1ckfg
n1ckfg / bookmarklet.js
Created November 23, 2022 21:53 — forked from bramus/bookmarklet.md
Mastodon User Page Bookmarklet
javascript:(function(){
const MY_MASTO_LOCAL_DOMAIN = 'front-end.social'; /* 👈 Change this value */
const MY_MASTO_WEB_DOMAIN = MY_MASTO_LOCAL_DOMAIN; /* 👈 Only change this value if your Masto host is hosted an different domain than the LOCAL_DOMAIN */
function tryAndGetUserName() {
/* Profile with a moved banner (e.g. https://mastodon.social/@bramus): follow that link */
const userNewProfile = document.querySelector('.moved-account-banner .button')?.getAttribute('href');
if (userNewProfile) {
return userNewProfile.substring(2);
}
# https://www.geeksforgeeks.org/python-tweepy-getting-the-id-of-a-user/
import tweepy
import json
import time
import urllib.request
# You get these from https://developer.twitter.com/en/apps
# New signups at https://developer.twitter.com
consumer_key = ""
# https://www.geeksforgeeks.org/python-tweepy-getting-the-id-of-a-user/
import tweepy
consumer_key = ""
consumer_secret = ""
access_token = ""
access_token_secret = ""
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
// https://openprocessing.org/sketch/20534/#
int dim = 50;
int interval = int(dim * 0.4);
void setup() {
size (500, 500);
println(dim + ", " + interval);
noStroke();
}
I am attesting that this GitHub handle n1ckfg is linked to the Tezos account tz1Tk4FSuhQZ8aqNaGs49NZkuKV3MSYCnDPM for tzprofiles
sig:edsigu4rCz5z3qP5byMkJayHaxFbcZxJJWVrP4f6vLwAdodAtXfHtmXthPmNNm2izzqmTqcK99KX4zMLyw2MmfENenjXZXjVnXP