Skip to content

Commit

Permalink
show median in pdq-downsample-demo
Browse files Browse the repository at this point in the history
  • Loading branch information
johnkerl committed Aug 2, 2019
1 parent 19e0103 commit 7092b04
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions hashing/pdq/cpp/bin/pdq-downsample-demo.cpp
Expand Up @@ -3,6 +3,7 @@

#include <pdq/cpp/io/pdqio.h>
#include <pdq/cpp/hashing/pdqhashing.h>
#include <pdq/cpp/hashing/torben.h>
#include <pdq/cpp/downscaling/downscaling.h>

#include <stdlib.h>
Expand Down Expand Up @@ -124,6 +125,11 @@ int main(int argc, char* argv[]) {
snprintf(tapName, tapbuflen, "7-dct-%s", filename);
floatMatrixToCImgOrDump(&buffer16x16[0][0], 16, 16, tapName, gfmt, do_dump);

if (do_dump) {
float dct_median = torben(&buffer16x16[0][0], 16 * 16);
printf("Median: %.4f\n", dct_median);
printf("\n");
}

dct16OriginalToRotate90(buffer16x16, buffer16x16Aux);
snprintf(tapName, tapbuflen, "7-dct-r90-%s", filename);
Expand Down

0 comments on commit 7092b04

Please sign in to comment.