Skip to content

Commit

Permalink
added regression test
Browse files Browse the repository at this point in the history
added regression tests. it is a test set for actual bugs, thus, any of
them is one defect that once existed in the code base.
  • Loading branch information
liuliu committed May 12, 2012
1 parent 2c0c83f commit 1817dbc
Show file tree
Hide file tree
Showing 33 changed files with 328 additions and 90 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*.swp
tags
gh-pages
test/*.tests
*.tests
test/*_test
test/*.jpg
test/*.png
Expand Down
20 changes: 20 additions & 0 deletions bin/dpmfmt.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env ruby

exit unless ARGV.length == 1

files = Dir.glob(ARGV[0] + '/*.txt')

files.each do |file|
name = nil;
boxes = Array.new
File.new(file).each_line do |line|
next if line[0] == '#'
name = line[line.rindex('/') + 1, line.rindex('"') - (line.rindex('/') + 1)] if line[0, 14].downcase == "image filename"
if line[0, 16].downcase == "bounding box for"
i = line.scan(/object\s*(\d+)/)[0][0].to_i
coord = line.scan(/\((\d+),\s*(\d+)\)\s*-\s*\((\d+),\s*(\d+)\)/)[0]
boxes[i - 1] = { :x => coord[0].to_i, :y => coord[1].to_i, :width => coord[2].to_i - coord[0].to_i, :height => coord[3].to_i - coord[1].to_i }
end
end
boxes.each { |coord| print name + " " + coord[:x].to_s + " " + coord[:y].to_s + " " + coord[:width].to_s + " " + coord[:height].to_s + "\n" }
end
2 changes: 1 addition & 1 deletion bin/makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CC = clang
LDFLAGS = -L"../lib" -lccv -pthread -ljpeg -lpng -lfftw3f -lfftw3 -lz -lgsl -lblas -llinear -lm # -lgomp
CFLAGS = -O3 -msse2 -Wall -I"../lib"
CFLAGS = -O1 -msse2 -Wall -I"../lib"

TARGETS = bbffmt siftmatch bbfcreate bbfdetect swtcreate swtdetect dpmcreate dpmdetect convert

Expand Down
1 change: 1 addition & 0 deletions lib/ccv.h
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@ void ccv_visualize(ccv_matrix_t* a, ccv_dense_matrix_t** b, int type);
void ccv_flatten(ccv_matrix_t* a, ccv_matrix_t** b, int type, int flag);
void ccv_zero(ccv_matrix_t* mat);
void ccv_shift(ccv_matrix_t* a, ccv_matrix_t** b, int type, int lr, int rr);
int ccv_any_nan(ccv_matrix_t *a);

/* basic data structures ccv_util.c */

Expand Down
Loading

0 comments on commit 1817dbc

Please sign in to comment.