26 #include <fvutils/rectification/rectfile.h>
27 #include <fvutils/rectification/rectinfo_lut_block.h>
35 using namespace firevision;
41 main(
int argc,
char **argv)
45 const char *s =
"qatest.rif";
71 for (
int i = 0; i < 10; ++i) {
72 uint16_t x = i, y = i, to_x = i * 2, to_y = i * 2;
73 printf(
"Mapping (%u, %u) to (%u, %u)\n", x, y, to_x, to_y);
77 for (
int i = 10; i < 20; ++i) {
78 uint16_t x = i, y = i, to_x = i * 2, to_y = i * 2;
79 printf(
"Mapping2 (%u, %u) to (%u, %u)\n", x, y, to_x, to_y);
88 for (RectificationInfoFile::RectInfoBlockVector::iterator i = blocks->begin(); i != blocks->end();
92 printf(
"Got rectification info block of unknown type");
96 printf(
"LUT: type: %u camera: %u size: %zu\n",
101 cout <<
"Looking for non-zero mappings" << endl;
102 uint16_t x, y, to_x, to_y;
103 for (y = 0; y < HEIGHT; ++y) {
104 for (x = 0; x < WIDTH; ++x) {
106 rlib->
mapping(x, y, &to_x, &to_y);
107 if ((to_x != 0) || (to_y != 0)) {
108 printf(
"(%u, %u) maps to (%u, %u)\n", x, y, to_x, to_y);
116 cout <<
"Writing to " << s << endl;
121 cout <<
"Reading from " << s << endl;
126 for (RectificationInfoFile::RectInfoBlockVector::iterator i = blocks->begin(); i != blocks->end();
130 printf(
"Got rectification info block of unknown type");
134 printf(
"LUT: type: %u camera: %u size: %zu\n",
139 cout <<
"Looking for non-zero mappings" << endl;
140 uint16_t x, y, to_x, to_y;
141 for (y = 0; y < HEIGHT; ++y) {
142 for (x = 0; x < WIDTH; ++x) {
144 rlib->
mapping(x, y, &to_x, &to_y);
145 if ((to_x != 0) || (to_y != 0)) {
146 printf(
"(%u, %u) maps to (%u, %u)\n", x, y, to_x, to_y);