Skip to content

Instantly share code, notes, and snippets.

View omaralvarez's full-sized avatar
🎯
Focusing

Omar Alvarez omaralvarez

🎯
Focusing
View GitHub Profile
@A03ki
A03ki / ICNR.md
Last active December 30, 2025 12:35
Implementation of ICNR with PyTorch
@gwaldron
gwaldron / gist:a56b0e77e7fa8587b698717d21f9366d
Last active February 15, 2020 13:45
Building OSG and osgEarth in GL CORE profile
Here are the steps for building OSG in the OpenGL CORE Profile
once you have configured CMake as usual.
1. Download the GL CORE include folder from Khronos:
https://www.khronos.org/registry/OpenGL/api/GL/
2. Put it in a folder somewhere. You can put it in a folder called glcore, or
you can make a "GL" folder in the include folder of the OSG repository and
put it there.
@janpaul123
janpaul123 / SimpleBlobDetector.js
Last active June 1, 2025 12:54
OpenCV SimpleBlobDetector port to OpenCV.js
// Port of https://github.com/opencv/opencv/blob/a50a355/modules/features2d/src/blobdetector.cpp
// But with special `faster` option which has slightly different semantics,
// but is a whole bunch faster.
function diff(v1, v2) {
if (v1.x !== undefined) return { x: v1.x - v2.x, y: v1.y - v2.y };
return v1.map((value, index) => value - v2[index]);
}
function norm(vector) {
@mbinna
mbinna / effective_modern_cmake.md
Last active March 19, 2026 06:40
Effective Modern CMake

Effective Modern CMake

Getting Started

For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.

After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](https://www.amazon.de/Large-Scale-Soft

@renshuki
renshuki / ubuntu_agnoster_install.md
Last active March 18, 2026 03:38
Ubuntu 16.04 + Terminator + Oh My ZSH with Agnoster Theme

Install Terminator (shell)

sudo add-apt-repository ppa:gnome-terminator
sudo apt-get update
sudo apt-get install terminator

Terminator should be setup as default now. Restart your terminal (shortcut: "Ctrl+Alt+T").

Install ZSH

@erogol
erogol / CaffeBatchPrediction.cpp
Created July 13, 2015 12:54
Caffe c++ batch based prediction
#include "caffeclassifier.h"
CaffeClassifier::CaffeClassifier(const string& model_file,
const string& trained_file,
const string& mean_file,
const string& label_file,
const bool use_GPU,
const int batch_size) {
if (use_GPU)
Caffe::set_mode(Caffe::GPU);
@allanmac
allanmac / assert_cuda.c
Last active September 17, 2024 18:34
A tiny example of CUDA + OpenGL interop with write-only surfaces and CUDA kernels. Uses GLFW+GLAD.
//
//
//
#include <stdlib.h>
#include <stdio.h>
//
//
//
@ddemidov
ddemidov / Makefile
Last active June 8, 2020 21:47
VexCL - OpenGL interaction
hello: hello.cpp
g++ -std=c++0x -O3 -o hello hello.cpp -I$(VEXCL_ROOT) \
-lGL -lglut -lGLEW -lOpenCL -lboost_system
@olasd
olasd / stream_to_youtube.sh
Created March 28, 2014 19:58
Stream video to youtube via ffmpeg
#! /bin/bash
#
# Diffusion youtube avec ffmpeg
# Configurer youtube avec une résolution 720p. La vidéo n'est pas scalée.
VBR="2500k" # Bitrate de la vidéo en sortie
FPS="30" # FPS de la vidéo en sortie
QUAL="medium" # Preset de qualité FFMPEG
YOUTUBE_URL="rtmp://a.rtmp.youtube.com/live2" # URL de base RTMP youtube
import cv2
import numpy as np
def in_front_of_both_cameras(first_points, second_points, rot, trans):
# check if the point correspondences are in front of both images
rot_inv = rot
for first, second in zip(first_points, second_points):
first_z = np.dot(rot[0, :] - second[0]*rot[2, :], trans) / np.dot(rot[0, :] - second[0]*rot[2, :], second)
first_3d_point = np.array([first[0] * first_z, second[0] * first_z, first_z])