#include #define PIXEL_ROW 120 #define PIXEL_COL 160 #define HEADER_LENGTH 54 #define BMP_FIGURE_SIZE (PIXEL_ROW * PIXEL_COL) extern unsigned int const imggray21[BMP_FIGURE_SIZE]; extern unsigned int const imggray22[BMP_FIGURE_SIZE]; extern unsigned int const imggray23[BMP_FIGURE_SIZE]; extern unsigned int const imggray24[BMP_FIGURE_SIZE]; extern unsigned int const imggray25[BMP_FIGURE_SIZE]; int Ix[PIXEL_ROW * PIXEL_COL]; int Iy[PIXEL_ROW * PIXEL_COL]; int It[PIXEL_ROW * PIXEL_COL]; int Vx[PIXEL_ROW * PIXEL_COL]; int Vy[PIXEL_ROW * PIXEL_COL]; extern void opticalflow(unsigned int const img1[PIXEL_ROW * PIXEL_COL], unsigned int const img2[PIXEL_ROW * PIXEL_COL], int Ix[PIXEL_ROW * PIXEL_COL], int Iy[PIXEL_ROW * PIXEL_COL], int It[PIXEL_ROW * PIXEL_COL], int w, int Vx[PIXEL_ROW * PIXEL_COL], int Vy[PIXEL_ROW * PIXEL_COL]); int main() { int index; int w = 10; opticalflow(imggray21, imggray22, Ix, Iy, It, w, Vx, Vy); for (index = 0; index < PIXEL_ROW * PIXEL_COL; index++) { printf("%10d, %10d", Vx[index], Vy[index]); } printf("\n"); opticalflow(imggray22, imggray23, Ix, Iy, It, w, Vx, Vy); for (index = 0; index < PIXEL_ROW * PIXEL_COL; index++) { printf("%10d, %10d", Vx[index], Vy[index]); } printf("\n"); opticalflow(imggray23, imggray24, Ix, Iy, It, w, Vx, Vy); for (index = 0; index < PIXEL_ROW * PIXEL_COL; index++) { printf("%10d, %10d", Vx[index], Vy[index]); } printf("\n"); opticalflow(imggray24, imggray25, Ix, Iy, It, w, Vx, Vy); for (index = 0; index < PIXEL_ROW * PIXEL_COL; index++) { printf("%10d, %10d", Vx[index], Vy[index]); } printf("\n"); return 0; }