Skip to content

Instantly share code, notes, and snippets.

View raaka1's full-sized avatar

Ravi Kiran raaka1

View GitHub Profile

Color Conversion using OpenCV

注意OpenCV讀取影像的影像格式是BGR而不是RGB,所以後續不管是要使用OpenCV提供的API轉換色彩空間或者自行取值運算都要特別注意。以下我們會提供RGB與YCrCb、HSV、HSL、CIE-Lab、XYZ等色彩轉換的公是與方法。

cv::Mat srcImg = cv::imread("lena.jpg", CV_LOAD_IMAGE_COLOR);

//BGR to Gray Color Space
cv::Mat bgr2grayImg;
@raaka1
raaka1 / gstreamer-module-build-cluster.md
Created December 28, 2018 11:47 — forked from Brainiarc7/gstreamer-module-build-cluster.md
Guide: How to build gstreamer from source on Ubuntu 16.04 for loading via the modules system

Build gstreamer from source (git checkouts):

Install build dependencies:

sudo apt-get install gtk-doc-tools liborc-0.4-0 liborc-0.4-dev libvorbis-dev libcdparanoia-dev libcdparanoia0 cdparanoia libvisual-0.4-0 libvisual-0.4-dev libvisual-0.4-plugins libvisual-projectm vorbis-tools vorbisgain libopus-dev libopus-doc libopus0 libopusfile-dev libopusfile0 libtheora-bin libtheora-dev libtheora-doc libvpx-dev libvpx-doc libvpx3 libqt5gstreamer-1.0-0 libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libflac++-dev libavc1394-dev libraw1394-dev libraw1394-tools libraw1394-doc libraw1394-tools libtag1-dev libtagc0-dev libwavpack-dev wavpack

Extras:

@raaka1
raaka1 / CONCURRENCY.md
Created August 18, 2018 19:17 — forked from montanaflynn/CONCURRENCY.md
Examples of sequential, concurrent and parallel requests in node.js

Concurrency in JavaScript

Javascript is a programming language with a peculiar twist. Its event driven model means that nothing blocks and everything runs concurrently. This is not to be confused with the same type of concurrency as running in parallel on multiple cores. Javascript is single threaded so each program runs on a single core yet every line of code executes without waiting for anything to return. This sounds weird but it's true. If you want to have any type of sequential ordering you can use events, callbacks, or as of late promises.

while inotifywait -q -e modify main/*.cpp >/dev/null; do
cmake .
make
done
@raaka1
raaka1 / LevelDb
Created December 11, 2016 14:43
LEVELDB hello world
#include <cassert>
#include <leveldb/db.h>
#include <iostream>
#include <string>
using namespace std;
int main() {
leveldb::DB* db;
leveldb::Options options;
options.create_if_missing = true;
https://iamabhik.wordpress.com/tag/text-detection/
1: IplImage* img = cvLoadImage("C:\\samples\\test\\32.jpg");
2: IplImage* img1=cvCreateImage(cvSize(img->width,img->height),img->depth, 1 );
3: cvConvertImage(img, img1,0);
4: IplImage* img2=cvCreateImage(cvSize(img->width,img->height),img->depth, 1 );
@raaka1
raaka1 / gpu_hog.cpp
Created November 12, 2016 16:40 — forked from joshuajnoble/gpu_hog.cpp
passing SVM to gpu::HOG
// might need to check
// http://stackoverflow.com/questions/15033363/obtaining-weights-in-cvsvm-the-svm-implementation-of-opencv/15070681#15070681
// for more info on how to get the svm from the CvSVM object to pass to HOG
#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
#include <iomanip>
#include <stdexcept>
@raaka1
raaka1 / gpu_hog.cpp
Created November 10, 2016 15:57 — forked from yoggy/gpu_hog.cpp
OpenCV cv::HOGDescriptor & cv::gpu::HOGDescriptor sample
#include <SDKDDKVer.h>
#include <Windows.h>
#pragma warning(disable:4819)
#pragma warning(disable:4996)
// for OpenCV2
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/objdetect/objdetect.hpp"
#include "opencv2/gpu/gpu.hpp"
cmake_minimum_required(VERSION 2.8)
project( SmartCow )
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(OpenCV REQUIRED)
find_package(CUDA REQUIRED)
@raaka1
raaka1 / opencv_blackfly.cpp
Created September 28, 2016 06:54 — forked from kevinhughes27/opencv_blackfly.cpp
A simple program showing how to capture from a Point Grey Research Camera and display the image using OpenCV
#include "FlyCapture2.h"
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <iostream>
using namespace FlyCapture2;
int main()