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
GCC = g++ | |
CFLAGS = -O2 -MMD -Wall -Wextra | |
SRCS = main.cpp sample.cpp | |
TARGET = main | |
OBJS = $(SRCS:.cpp=.o) | |
DEPS = $(SRCS:.cpp=.d) | |
.cpp.o: | |
$(GCC) $(CFLAGS) -c $< -o $@ |
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
#!/usr/bin/ruby -Ks | |
# -Ks:convert code to Shift_JIS | |
dirpath = ARGV[0] # directory path XXX/ | |
def rename_files(_dirpath) | |
fnames = Dir.glob _dirpath+'**' | |
fnames_created = fnames.map { |fname| | |
[fname, File.mtime(fname)] |
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
#include <highgui.h> | |
#include <cv.h> | |
#include <cxcore.h> | |
#include <assert.h> | |
#include <iostream> | |
#include <sstream> | |
#include <math.h> | |
#include "fileio_util.hpp" |
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
#include <iostream> | |
#include <cmath> | |
#include <vector> | |
#include <list> | |
#include <numeric> | |
template <template<class T, class Allocator = std::allocator<T> > class Container> | |
double mean(Container<double> & x) | |
{ | |
return std::accumulate(x.begin(), x.end(), 0.0) / x.size(); |
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
std::map< uchar, cv::Point, std::greater<uchar> > reliabilities; | |
int max_size = this->reliabilities.size() * percent/100.0; | |
std::map<uchar,cv::Point>::iterator map_itr = reliabilities.begin(); | |
for(int i=0; i<max_size; i++){ | |
// map_itr.first; | |
// draw | |
cv::Point img_pt = (*map_itr).second; | |
int graycode_x = this->decoded_dataX.at<unsigned short>(img_pt.y, img_pt.x); | |
int graycode_y = this->decoded_dataY.at<unsigned short>(img_pt.y, img_pt.x); |
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
#!/usr/bin/ruby | |
def merge(ary1,ary2) | |
idx1 = 0 | |
idx2 = 0 | |
result = Array.new | |
while result.length < ary1.length + ary2.length | |
ary1val = idx1 <= ary1.length-1 ? ary1[idx1] : -1 | |
ary2val = idx2 <= ary2.length-1 ? ary2[idx2] : -1 |
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
#!/usr/bin/ruby | |
def qsort(first,last,ary) | |
if first >= last | |
return | |
end | |
target = ary[first] | |
buf1 = Array.new |
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
#include <sstream> | |
#include <string> | |
#include <vector> | |
#include <map> | |
#include <algorithm> | |
#include <iostream> | |
#include <cstdio> | |
#include <cstdlib> | |
#include <cmath> | |
#include <utility> |
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
#include <sstream> | |
#include <string> | |
#include <vector> | |
#include <map> | |
#include <algorithm> | |
#include <iostream> | |
#include <cstdio> | |
#include <cstdlib> | |
#include <cmath> | |
#include <utility> |
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
#include <sstream> | |
#include <string> | |
#include <vector> | |
#include <map> | |
#include <algorithm> | |
#include <iostream> | |
#include <cstdio> | |
#include <cstdlib> | |
#include <cmath> | |
#include <utility> |
OlderNewer