Basic attempt at injecting and reading back user data unregistered (UDU) supplemental enhancement information (SEI) with ffmpeg / libav.
Some references:
Basic attempt at injecting and reading back user data unregistered (UDU) supplemental enhancement information (SEI) with ffmpeg / libav.
Some references:
#!/usr/bin/env python3 | |
import numpy as np | |
import matplotlib.pyplot as plt | |
def wavelength_to_rgb(wavelengths, gamma=0.8): | |
'''This converts a given wavelength of light to an | |
approximate RGB color value. The wavelength must be given | |
in nanometers in the range from 380 nm through 750 nm | |
(789 THz through 400 THz). |
A simple PyTorch implementation of plane fitting with RANSAC. Some ideas are taken from: https://github.com/leomariga/pyRANSAC-3D.
In each (batched-)RANSAC iteration, a batch of triplets is sampled and assessed in parallel.
A cross-product is used to get plane equations from triplets.
The refinement, post identification of inliers, is done with an eigen decomposition of P.T @ P
where P
is the matrix of points in homogeneous coordinates.
Classicially, an SVD decomposition of P
is used but this can be slow and memory intensive with large number of points.
We thus opted for the eigen decomposition approach despite it being less numerically stable.
Hack file to get a nicer Gist name |
import numpy as np | |
import matplotlib.pyplot as plt | |
import imageio | |
url = 'https://archive.org/download/10thframekixxc64800dpi48bit/10th%20Frame%20%28Kixx%29_C64_Cassette_800dpi_48bit.tif' | |
im0 = imageio.imread(url) | |
print('im0:',np.min(im0),np.max(im0),im0.shape,im0.dtype) | |
im0gray = 0.299*np.float32(im0[:,:,0]) + 0.587*np.float32(im0[:,:,1]) + 0.114*np.float32(im0[:,:,2]) | |
im0gray = im0gray / np.max(im0gray) | |
im1 = np.uint16(np.round( im0gray*((1<<10)-1) )) |
#EXTM3U | |
#EXTINF:0,Radio France - FIP (AAC+Metadata) | |
http://radio-metadata.fr:8000/fip.m3u | |
#EXTINF:0,Radio France - FIP Reggae (AAC+Metadata) | |
http://radio-metadata.fr:8000/fipreggae.m3u | |
#EXTINF:0,Radio France - FIP World (AAC+Metadata) | |
http://radio-metadata.fr:8000/fipmonde.m3u | |
#EXTINF:0,Radio France - FIP Nouveautés (AAC+Metadata) | |
http://radio-metadata.fr:8000/fipnouveaute.m3u | |
#EXTINF:0,Radio France - FIP Electro (AAC+Metadata) |
Hack file to get a nicer Gist name |
#!/bin/sh | |
# Sanity checks | |
if ! [ -x "$(command -v gs)" ]; then | |
echo "gs is not installed -> exit" | |
exit 1 | |
fi | |
# Define some handy options to use with ghostscript | |
export PDF2PDFFLAGS="-dCompatibilityLevel=1.5 -dPDFSETTINGS=/ebook -dPrinted=false -dColorConversionStrategy=/UseDeviceIndependentColor -dDownsampleColorImages=true -dDownsampleGrayImages=true -dDownsampleMonoImages=true -dMaxSubsetPct=100 -dSubsetFonts=true -dEmbedAllFonts=true -dOptimize=true -dUseFlateCompression=true -dNOPAUSE -dBATCH -sDEVICE=pdfwrite" |
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | |
<html> | |
<head> | |
<!-- Get jquery --> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> | |
<link href="https://fonts.googleapis.com/css?family=Lato%3A300%2C300italic%2C400%2C400italic%2C700%2C700italic" rel="stylesheet" type="text/css"/> | |
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Source+Code+Pro:400,700" rel="stylesheet" type="text/css"> | |
<link rel="stylesheet" href="https://www.gstatic.com/_/atari/_/ss/k=atari.vw.-2q1obhhypir7.L.W.O/d=1/rs=AGEqA5mToJSdsBqoIabxpABkzJkjFu3hJg"/> |