#pragma once #include "Card.h" // routines for one bit binary (bitmap) images class CBitmap { public: CBitmap(); // not used CBitmap(Mat m, uchar match); // create bitmap from openCV mat. CBitmap(FILE* f); // create bitmap from an open file float correlate(CBitmap cb2, bool fromTop); // return the correlation of two bitmaps. Mat b2Mat(); // create openCV Mat from bitmap int write(FILE* f); // write bitmap to an open file int read(FILE* f); // read bitmap from open file int nRows; int nCols; int bytesRow; uchar* data; private: void initOnes(); // initialize bit tables static uchar nOnes[256]; // given a UCHAR value, return the # of one bits. static uchar oneShift[8]; // table lookup for 1 << index, we think it's faster than inline. };