Skip to content

Instantly share code, notes, and snippets.

@shrubb
shrubb / torch-opencv-blogpost.md
Last active June 1, 2016 08:53 — forked from szagoruyko/torch-opencv-blogpost.md
"OpenCV bindings" post for Torch blog

OpenCV Bindings for Torch

The OpenCV library implements tons of useful image processing and computer vision algorithms, as well as the high-level GUI API. Written in C++, it has bindings in Python, Java, MATLAB/Octave, C#, Perl and Ruby. We present the Lua bindings that are based on Torch, made by VisionLabs with support from Facebook and Google Deepmind.

By combining OpenCV with scientific computation abilities of Torch, one gets an even more powerful framework capable of handling computer vision routines (e.g. face detection), interfacing video streams (including cameras), easier data visualization, GUI interaction and many more. In addition, most of the computationally intensive algorithms are available on GPU via Cutorch. All these features may be essentially useful for those dealing with deep learning applied to images.

Usage Examples

@shrubb
shrubb / torch-opencv-blogpost.md
Last active January 11, 2018 00:46
"OpenCV bindings" post for Torch blog

OpenCV Bindings for Torch

The OpenCV library implements tons of useful image processing and computer vision algorithms, as well as the high-level GUI API. Written in C++, it has bindings in Python, Java, MATLAB/Octave, C#, Perl and Ruby. We present the Lua bindings that are based on Torch.

By combining OpenCV with Torch's scientific computation abilities, one gets an even more powerful framework capable of handling computer vision routines (e.g. face detection), interfacing video streams (including cameras), easier data visualization, GUI interaction and many more. In addition, most of the computationally intensive algorithms are available on GPU via Cutorch. All these features may be essentially useful for those dealing with deep learning applied to images.

Usage Examples

// compile with: /D_UNICODE /DUNICODE /DWIN32 /D_WINDOWS /c
#include <windows.h>
#include <psapi.h>
#include <stdlib.h>
#include <string.h>
#include <tchar.h>
#include <stdio.h>
#include <limits.h>
#include <iostream>
#include <iostream>
#include <vector>
#include <limits.h>
int main(int, char**)
{
int n;
std::cin >> n;
std::vector<long long> count(10001);
long long minimum = INT_MAX;
@shrubb
shrubb / sorts.cpp
Last active August 29, 2015 14:27
Sorting algorithms
//
// Created by shrubb on 16.08.15.
//
#include <iostream>
#include <algorithm>
void radixSort(int *arr, size_t size) {
for (size_t i = 0; i < size; ++i) {
arr[i] ^= (1 << 31);
@shrubb
shrubb / evaluator.cpp
Created August 16, 2015 14:53
Arithmetic expression evaluator
//
// Created by shrubb on 16.08.15.
//
#include <string>
#include <iostream>
#include <algorithm>
const std::string validOps = "+-*/";
@shrubb
shrubb / olymp_template.cpp
Last active August 29, 2015 14:27
Competitive programming template
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <cstring>
#include <cmath>
@shrubb
shrubb / dqn_submit.cpp
Created July 24, 2015 03:43
DQN helper
#include <cmath>
#include <iostream>
#include <ale_interface.hpp>
#include <glog/logging.h>
#include <gflags/gflags.h>
#include "prettyprint.hpp"
#include "dqn.hpp"
#include <fstream>
#include <string>