MCPcopy Create free account
hub / github.com/davisking/dlib / test_load_save_frame

Function test_load_save_frame

dlib/test/ffmpeg.cpp:150–162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

148
149 template<class pixel_type>
150 void test_load_save_frame(const std::string& filename)
151 {
152 matrix<pixel_type> img1, img2;
153 img1 = get_random_image<pixel_type>();
154
155 save_frame(img1, filename, {{"qmin", "1"}, {"qmax", "1"}});
156 load_frame(img2, filename);
157
158 DLIB_TEST(img1.nr() == img2.nr());
159 DLIB_TEST(img1.nc() == img2.nc());
160 const double similarity = psnr(img1, img2);
161 DLIB_TEST_MSG(similarity > 20.0, "psnr " << similarity);
162 }
163
164//////////////////////////////////////////////////////////////////////////////////////////////////////
165//////////////////////////////////////////////////////////////////////////////////////////////////////

Callers

nothing calls this directly

Calls 5

save_frameFunction · 0.85
load_frameFunction · 0.85
psnrFunction · 0.85
nrMethod · 0.45
ncMethod · 0.45

Tested by

no test coverage detected