Motion tracking: dump mask image when dump images is enabled

This is pure development option which is enabled by defining DUMP_FAILURE
or DUMP_ALWAYS libmv-capi.
This commit is contained in:
Sergey Sharybin 2012-11-20 12:54:28 +00:00
parent 616eb84452
commit 1dd5a89c87

@ -192,7 +192,7 @@ static void imageToFloatBuf(const libmv::FloatImage *image, int channels, float
} }
#if defined(DUMP_FAILURE) || defined (DUMP_ALWAYS) #if defined(DUMP_FAILURE) || defined (DUMP_ALWAYS)
void savePNGImage(png_bytep *row_pointers, int width, int height, int depth, int color_type, char *file_name) static void savePNGImage(png_bytep *row_pointers, int width, int height, int depth, int color_type, char *file_name)
{ {
png_infop info_ptr; png_infop info_ptr;
png_structp png_ptr; png_structp png_ptr;
@ -437,6 +437,9 @@ int libmv_trackRegion(const struct libmv_trackRegionOptions *options,
#endif #endif
saveImage("old_patch", old_patch, x1[4], y1[4]); saveImage("old_patch", old_patch, x1[4], y1[4]);
saveImage("new_patch", new_patch, x2[4], y2[4]); saveImage("new_patch", new_patch, x2[4], y2[4]);
if (options->image1_mask)
saveImage("mask", image1_mask, x2[4], y2[4]);
} }
#endif #endif