This file contains hidden or 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
| /* | |
| * Utils.h | |
| * | |
| * Created on: 2013/06/19 | |
| * Author: root | |
| */ | |
| #include <fstream> | |
| #include <cassert> | |
| #include <cv.h> | |
| #include <sstream> |
This file contains hidden or 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
| /** | |
| * open file | |
| */ | |
| void OpenFile(ifstream& file, const char* file_list_path) { | |
| file.open(file_list_path); | |
| if (!file.is_open()) { | |
| throw "can not open file."; | |
| } | |
| } |
This file contains hidden or 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
| // Harris's corners | |
| void HarrisCorners(Mat& src, Mat& dist, vector<Point2f>& corners) { | |
| goodFeaturesToTrack(src, corners, 200, 0.01, 2, Mat(), 2, true); | |
| vector<Point2f>::iterator it_corner = corners.begin(); | |
| for (; it_corner != corners.end(); ++it_corner) { | |
| float px = it_corner->x; | |
| float py = it_corner->y; | |
| circle(dist, Point(px, py), 1, Scalar(0, 0, 255), -1); | |
| circle(dist, Point(px, py), 8, Scalar(0, 0, 255)); | |
| } |
This file contains hidden or 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
| // Hough's lines | |
| void HoughLines(Mat& src, Mat& hough_image, vector<Vec4i>& lines) { | |
| HoughLinesP(src, lines, 1, CV_PI / 180, 50, 100, 5); | |
| vector<Vec4i>::iterator it = lines.begin(); | |
| for (; it != lines.end(); ++it) { | |
| Vec4i lin = *it; | |
| line(hough_image, Point(lin[0], lin[1]), Point(lin[2], lin[3]), | |
| Scalar(0, 0, 255), 2, 4); | |
| } |
This file contains hidden or 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
| // gaussianとgrayの差分画像 | |
| absdiff(gray, gaussian, abs); |
This file contains hidden or 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
| adaptiveThreshold(gray, bin, 255, CV_ADAPTIVE_THRESH_GAUSSIAN_C,CV_THRESH_BINARY, 7, 8); | |
| threshold(abs, bin, 0, 255, cv::THRESH_BINARY | cv::THRESH_OTSU); |
This file contains hidden or 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
| /* | |
| * ImageStream.cpp | |
| * | |
| * Created on: 2013/05/14 | |
| * Author: root | |
| */ | |
| #include "SprixImageStream.h" | |
| #include <iostream> | |
| #include <sstream> |
This file contains hidden or 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
| #ifndef IMAGE_STREAM_H_ | |
| #define IMAGE_STREAM_H_ | |
| /* | |
| * ImageStream.hpp | |
| * | |
| * Created on: Jun 1, 2013 | |
| * Author: root | |
| */ | |
| #include <cv.h> |
This file contains hidden or 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
| /** | |
| * 指定したStringBuilderをファイルに書き出す | |
| * | |
| * @param filePath | |
| * @param sb | |
| */ | |
| public static void outputFile(String filePath, StringBuilder sb) { | |
| try { | |
| FileWriter fw = new FileWriter(filePath, false); | |
| PrintWriter pw = new PrintWriter(new BufferedWriter(fw)); |
This file contains hidden or 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
| <?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
| <!-- WARNING: Eclipse auto-generated file. | |
| Any modifications will be overwritten. | |
| To include a user specific buildfile here, simply create one in the same | |
| directory with the processing instruction <?eclipse.ant.import?> | |
| as the first entry and export the buildfile again. --> | |
| <project basedir="." default="build" name="jni"> | |
| <property environment="env" /> | |
| <property name="ECLIPSE_HOME" value="../../eclipse" /> | |
| <property name="debuglevel" value="source,lines,vars" /> |