opencv/apps/haartraining/cvsamplesoutput.h
Grigory Serebryakov 57cf3d1766 Class naming update
Documentation improvement
Bug in output format for JPG set fixed
2014-08-26 10:02:50 +04:00

50 lines
1.2 KiB
C++

#ifndef CVSAMPLESOUTPUT_H
#define CVSAMPLESOUTPUT_H
#include "ioutput.h"
class PngDatasetOutput: public IOutput
{
friend IOutput* IOutput::createOutput(const char *filename, OutputType type);
public:
virtual bool write( const CvMat& img,
const CvRect& boundingBox);
virtual ~PngDatasetOutput(){}
private:
PngDatasetOutput()
: extension("png")
, destImgWidth(640)
, destImgHeight(480)
{}
virtual bool init(const char* annotationsListFileName );
void writeImage( const CvMat& img ) const;
CvRect scaleBoundingBox(const CvSize& imgSize,
const CvRect& bbox);
private:
char annotationFullPath[PATH_MAX];
char* annotationFileName;
char* annotationRelativePath;
char* imgRelativePath;
const char* extension;
int destImgWidth;
int destImgHeight ;
};
class JpgDatasetOutput: public IOutput
{
friend IOutput* IOutput::createOutput(const char *filename, OutputType type);
public:
virtual bool write( const CvMat& img,
const CvRect& boundingBox );
virtual ~JpgDatasetOutput(){}
private:
JpgDatasetOutput(){}
};
#endif // CVSAMPLESOUTPUT_H