diff --git a/src/tests.c b/src/tests.c index 07f52873..c72e900b 100644 --- a/src/tests.c +++ b/src/tests.c @@ -497,10 +497,68 @@ void features_VOC(int part, int total) } } +void features_VOC_image(char *image_file, char *image_dir, char *out_dir) +{ + int i,j; + network net = parse_network_cfg("cfg/voc_features.cfg"); + char image_path[1024]; + sprintf(image_path, "%s%s",image_dir, image_file); + char out_path[1024]; + sprintf(out_path, "%s%s.txt",out_dir, image_file); + printf("%s\n", image_file); + FILE *fp = fopen(out_path, "w"); + if(fp == 0) file_error(out_path); + + IplImage* src = 0; + if( (src = cvLoadImage(image_path,-1)) == 0 ) file_error(image_path); + int w = src->width; + int h = src->height; + int sbin = 8; + int interval = 10; + double scale = pow(2., 1./interval); + int m = (w