expanding README: copyright
[sparrow.git] / test-find-edge-bisection.c
blobb9592430b502fc3390e429261df7d5664aca1708
1 #include "sparrow.h"
2 #include <string.h>
3 #include <math.h>
4 #include <sys/time.h>
6 #include <stdio.h>
8 #include "cv.h"
9 #include "highgui.h"
11 #define debug(format, ...) fprintf (stderr, (format),## __VA_ARGS__); fflush(stderr)
12 #define debug_lineno() debug("%-25s line %4d \n", __func__, __LINE__ )
15 #define IMG_IN_NAME "images/mask.png"
16 #define IMG_OUT_NAME "images/test-image-%s.png"
40 int main(int argc, char **argv)
42 struct timeval tv1, tv2;
43 guint32 t;
45 IplImage *mask = cvLoadImage(IMG_IN_NAME, CV_LOAD_IMAGE_UNCHANGED);
46 //IplImage *im_out = cvCreateImage(CvSize size, int depth, int channels);
47 //IplImage *im_out = cvCloneImage(im);
49 gettimeofday(&tv1, NULL);
52 IplImage *im_out = test_find_edges_hist(im_in);
53 //IplImage *im_out = test_find_edges(im_in);
56 gettimeofday(&tv2, NULL);
57 t = ((tv2.tv_sec - tv1.tv_sec) * 1000000 +
58 tv2.tv_usec - tv1.tv_usec);
59 printf("took %u microseconds (%0.5f of a frame)\n",
60 t, (double)t * (25.0 / 1000000.0));
63 char *filename;
64 if(asprintf(&filename, IMG_OUT_NAME, "final") == -1){};
65 cvSaveImage(filename, im_out, 0);
66 return EXIT_SUCCESS;