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
cmake_minimum_required(VERSION 3.17) | |
project(Foo) | |
find_package(PkgConfig REQUIRED) | |
pkg_check_modules(LIBAV REQUIRED IMPORTED_TARGET | |
libavdevice | |
libavfilter | |
libavformat | |
libavcodec |
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 path = require('path'); | |
const { exec } = require('child_process'); | |
const fs = require('fs'); | |
const rimraf = require('rimraf'); | |
function renameOutputFolder(buildFolderPath, outputFolderPath) { | |
return new Promise((resolve, reject) => { | |
fs.rename(buildFolderPath, outputFolderPath, (err) => { | |
if (err) { | |
reject(err); |
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
from ctypes import * | |
from fcntl import ioctl | |
# See ioctl.h of your architecture for appropriate constants here. | |
# This has been tested only on x86 | |
_IOC_NRBITS = 8 | |
_IOC_TYPEBITS = 8 | |
_IOC_NRSHIFT = 0 | |
_IOC_TYPESHIFT = _IOC_NRSHIFT + _IOC_NRBITS |
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
# if input image is in range 0..1, please first multiply img by 255 | |
# assume image is ndarray of shape [height, width, channels] where channels can be 1, 3 or 4 | |
def imshow(img): | |
import cv2 | |
import IPython | |
_,ret = cv2.imencode('.jpg', img) | |
i = IPython.display.Image(data=ret) | |
IPython.display.display(i) |
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
#include <fstream> | |
void writeCSV(string filename, Mat m) | |
{ | |
ofstream myfile; | |
myfile.open(filename.c_str()); | |
myfile<< cv::format(m, cv::Formatter::FMT_CSV) << std::endl; | |
myfile.close(); | |
} |
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
import gi | |
gi.require_version('Gst', '1.0') | |
from gi.repository import GObject, Gst | |
Gst.debug_set_active(True) | |
Gst.debug_set_default_threshold(3) | |
GObject.threads_init() | |
Gst.init(None) |
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
/* gcc gdk-gstappsrc-stream.c -Wall `pkg-config --cflags --libs gstreamer-app-0.10 gdk-pixbuf-2.0` -o gdkstream */ | |
#include <gst/gst.h> | |
#include <gst/app/gstappsrc.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <gdk-pixbuf/gdk-pixbuf.h> |