00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include <it/io.h>
00025 #include <it/mat.h>
00026 #include <it/parser.h>
00027 #include <it/filter.h>
00028
00029 int main (int argc, char *argv[])
00030 {
00031 const char *image_in = "../data/test.pgm";
00032 const char *image_out = "out.pgm";
00033 mat m, mt;
00034 mat filter;
00035 parser_t *parser = parser_init (argc, argv, "test_filter.param", NULL);
00036
00037
00038 m = mat_pgm_read (image_in);
00039 printf ("PGM %dx%d\n", mat_width (m), mat_height (m));
00040
00041 parser_print (parser);
00042
00043
00044 filter = parser_get_mat (parser, "Laplace");
00045 mt =
00046 mat_filter_fir (m, filter, mat_width (filter) / 2,
00047 mat_height (filter) / 2);
00048 mat_delete (filter);
00049 mat_pgm_write (image_out, mt);
00050 mat_delete (mt);
00051
00052
00053 mat_delete (m);
00054
00055
00056 return 0;
00057 }