mirror of https://github.com/opencv/opencv.git
Open Source Computer Vision Library
https://opencv.org/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
1.2 KiB
54 lines
1.2 KiB
15 years ago
|
#ifndef _OPENCV_IMAGESTORAGE_H_
|
||
|
#define _OPENCV_IMAGESTORAGE_H_
|
||
|
|
||
14 years ago
|
#include "highgui.h"
|
||
15 years ago
|
|
||
|
using namespace cv;
|
||
|
|
||
|
class CvCascadeImageReader
|
||
|
{
|
||
|
public:
|
||
|
bool create( const String _posFilename, const String _negFilename, Size _winSize );
|
||
|
void restart() { posReader.restart(); }
|
||
|
bool getNeg(Mat &_img) { return negReader.get( _img ); }
|
||
|
bool getPos(Mat &_img) { return posReader.get( _img ); }
|
||
|
|
||
|
private:
|
||
|
class PosReader
|
||
|
{
|
||
|
public:
|
||
|
PosReader();
|
||
|
virtual ~PosReader();
|
||
|
bool create( const String _filename );
|
||
|
bool get( Mat &_img );
|
||
|
void restart();
|
||
|
|
||
|
short* vec;
|
||
|
FILE* file;
|
||
|
int count;
|
||
|
int vecSize;
|
||
|
int last;
|
||
|
int base;
|
||
|
} posReader;
|
||
|
|
||
|
class NegReader
|
||
|
{
|
||
|
public:
|
||
|
NegReader();
|
||
|
bool create( const String _filename, Size _winSize );
|
||
|
bool get( Mat& _img );
|
||
|
bool nextImg();
|
||
|
|
||
|
Mat src, img;
|
||
|
vector<String> imgFilenames;
|
||
|
Point offset, point;
|
||
|
float scale;
|
||
|
float scaleFactor;
|
||
|
float stepFactor;
|
||
|
size_t last, round;
|
||
|
Size winSize;
|
||
|
} negReader;
|
||
|
};
|
||
|
|
||
|
#endif
|