Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009 #include <stdio.h>
00010 #include <stdlib.h>
00011 #include <vl/aib.h>
00012
00013 int main()
00014 {
00015 vl_uint32 nrows = 10;
00016 vl_uint32 ncols = 3;
00017 double Pic[3*10] = {
00018 0.6813, 0.3028, 0.8216,
00019 0.3795, 0.5417, 0.6449,
00020 0.8318, 0.1509, 0.8180,
00021 0.5028, 0.6979, 0.6602,
00022 0.7095, 0.3784, 0.3420,
00023 0.4289, 0.8600, 0.2897,
00024 0.3046, 0.8537, 0.3412,
00025 0.1897, 0.5936, 0.5341,
00026 0.1934, 0.4966, 0.7271,
00027 0.6822, 0.8998, 0.3093,
00028 };
00029
00030 vl_uint32 r,c;
00031 VlAIB * aib;
00032 vl_uint * parents;
00033
00034 printf("Pic = [");
00035 for(r=0; r<nrows; r++)
00036 {
00037 for(c=0; c<ncols; c++)
00038 printf("%f ", Pic[r*ncols+c]);
00039 printf("; ...\n");
00040 }
00041 printf("];\n");
00042
00043 printf("AIB starting\n");
00044 {
00045 aib = vl_aib_new(Pic, nrows, ncols);
00046 vl_aib_process(aib);
00047
00048
00049 parents = vl_aib_get_parents(aib);
00050 for(r=0; r<2*nrows-1; r++)
00051 printf("%d => %d\n", r, parents[r]);
00052
00053 vl_aib_delete(aib);
00054 }
00055
00056
00057 printf("IB done\n");
00058 return 0;
00059 }