Skip to content

Instantly share code, notes, and snippets.

View MareArts's full-sized avatar

MareArts MareArts

View GitHub Profile
@MareArts
MareArts / Extract the value of interest rows and copy that to new Mat.cpp
Created March 22, 2018 13:33
Extract the value of interest rows and copy that to new Mat
cout << "origin\n";
Mat a = (Mat_<int>(5, 5) << 1, 2, 3, 4, 5,
7, 8, 9, 10, 11,
12, 13, 14, 15, 16,
17, 18, 19, 20, 21,
22, 23, 24, 25, 26);
cout << a << endl;
cout << "\ninterest index of row - 0,3\n";
vector< int> row_index_interest;
@MareArts
MareArts / rnn save & restore test for 2 layer.py
Created March 3, 2018 21:55
rnn save & restore test for 2 layer.py
import tensorflow as tf
import numpy as np
tf.set_random_seed(777)
#teach hello: hihell -> ihello
idx2char = ['h', 'i', 'e', 'l', 'o'] #class 5
x_data = [[0, 1, 0, 2, 3, 3]] #hihell
x_one_hot = [[[1, 0, 0, 0, 0], #h 0
@MareArts
MareArts / rnn_simple_save_restore_test.py
Last active March 3, 2018 21:58
rnn save and restore test example source code
import tensorflow as tf
import numpy as np
tf.set_random_seed(777)
#teach hello: hihell -> ihello
idx2char = ['h', 'i', 'e', 'l', 'o'] #class 5
x_data = [[0, 1, 0, 2, 3, 3]] #hihell
x_one_hot = [[[1, 0, 0, 0, 0], #h 0
@MareArts
MareArts / putTextOpencvExample.cpp
Last active February 14, 2018 20:38
put text example for opencv
http://study.marearts.com/2014/03/opencv-study-write-text-on-image.html
//////////////////////////
//cvPutText, IplImage case.
CvFont * font = new CvFont;
cvInitFont(font, CV_FONT_VECTOR0, 0.5f, 1.0f, 0, 1, 8); //rate of width and height is 1:2
char szText[8];
sprintf(szText, "TextOut"); //make string
cvPutText(Image, szText, CenterPoint, font, CV_RGB(255, 255, 255)); //draw text on the IplImage* (Image)
@MareArts
MareArts / camera_pattern_position.m
Created February 11, 2018 17:37
camera pattern position
http://study.marearts.com/2013/10/opencv-246-calibration-example-source.html
clc;
close all;
%clear all;
%ImgPT=load('imagept.txt');
%ObjPT=load('objectpt.txt');
k=load('intrinsic.txt');R=load('rotation.txt');T=load('translation.txt');%S=load('ptSize.txt');
@MareArts
MareArts / mare_camera_calibration.cpp
Created February 11, 2018 17:34
camera calibration source code
http://study.marearts.com/2013/10/opencv-246-calibration-example-source.html
#include < stdio.h>
#include < opencv2\opencv.hpp>
//#include < opencv2\features2d\features2d.hpp>
//#include < opencv2\nonfree\nonfree.hpp>
//#include < opencv2\nonfree\features2d.hpp>
#include < vector>
@MareArts
MareArts / Histogram_equalization.cpp
Last active January 14, 2018 21:34
Histogram_equalization
http://study.marearts.com/2018/01/histogram-equalization-stretching.html
#include "opencv2/opencv.hpp"
#include "opencv2\highgui.hpp"
#include <iostream>
#ifdef _DEBUG
#pragma comment(lib, "opencv_core331d.lib")
#pragma comment(lib, "opencv_highgui331d.lib")
@MareArts
MareArts / compare_histo_stretchHisto.cpp
Last active December 30, 2017 22:00
compare histo and stretch histo
http://study.marearts.com/2017/12/opencv-histogram-stretching-example.html
#include "opencv2/opencv.hpp"
#include "opencv2\highgui.hpp"
#include <iostream>
#ifdef _DEBUG
#pragma comment(lib, "opencv_core331d.lib")
#pragma comment(lib, "opencv_highgui331d.lib")
@MareArts
MareArts / OpenCV_HueOfHSV_histogram.cpp
Last active December 29, 2017 00:48
Hue in HSV histogram opencv example source code
http://study.marearts.com/2017/12/hue-histogram-example-opencv-source-code.html
#include "opencv2/opencv.hpp"
#include "opencv2\highgui.hpp"
#include <iostream>
#ifdef _DEBUG
#pragma comment(lib, "opencv_core331d.lib")
@MareArts
MareArts / rgbHistogramExampleUsingCalcHist.cpp
Last active March 19, 2018 19:32
RGB histogram using clacHist function in opencv
http://study.marearts.com/2017/12/calchist-for-rgb-image-opencv-histogram.html
#include "opencv2/opencv.hpp"
#include "opencv2\highgui.hpp"
#include <iostream>
#ifdef _DEBUG
#pragma comment(lib, "opencv_core331d.lib")
#pragma comment(lib, "opencv_highgui331d.lib")
#pragma comment(lib, "opencv_imgcodecs331d.lib")