2014-07-29 18:12:17 +08:00
|
|
|
#ifndef CVSAMPLESOUTPUT_H
|
|
|
|
#define CVSAMPLESOUTPUT_H
|
|
|
|
|
|
|
|
#include "ioutput.h"
|
|
|
|
|
2014-08-26 12:55:59 +08:00
|
|
|
class PngDatasetOutput: public IOutput
|
2014-07-29 18:12:17 +08:00
|
|
|
{
|
|
|
|
friend IOutput* IOutput::createOutput(const char *filename, OutputType type);
|
|
|
|
public:
|
|
|
|
virtual bool write( const CvMat& img,
|
|
|
|
const CvRect& boundingBox);
|
|
|
|
|
2014-08-26 12:55:59 +08:00
|
|
|
virtual ~PngDatasetOutput(){}
|
2014-07-29 18:12:17 +08:00
|
|
|
private:
|
2014-08-26 12:55:59 +08:00
|
|
|
PngDatasetOutput()
|
2014-07-29 18:12:17 +08:00
|
|
|
: extension("png")
|
|
|
|
, destImgWidth(640)
|
|
|
|
, destImgHeight(480)
|
|
|
|
{}
|
|
|
|
|
|
|
|
virtual bool init(const char* annotationsListFileName );
|
|
|
|
|
2014-09-01 17:02:27 +08:00
|
|
|
CvRect addBoundingboxBorder(const CvRect& bbox) const;
|
2014-07-29 18:12:17 +08:00
|
|
|
private:
|
|
|
|
|
|
|
|
char annotationFullPath[PATH_MAX];
|
|
|
|
char* annotationFileName;
|
|
|
|
char* annotationRelativePath;
|
|
|
|
char* imgRelativePath;
|
|
|
|
const char* extension;
|
|
|
|
|
|
|
|
int destImgWidth;
|
|
|
|
int destImgHeight ;
|
|
|
|
};
|
|
|
|
|
2014-08-26 12:55:59 +08:00
|
|
|
class JpgDatasetOutput: public IOutput
|
2014-07-29 18:12:17 +08:00
|
|
|
{
|
|
|
|
friend IOutput* IOutput::createOutput(const char *filename, OutputType type);
|
|
|
|
public:
|
|
|
|
virtual bool write( const CvMat& img,
|
|
|
|
const CvRect& boundingBox );
|
2014-08-26 12:55:59 +08:00
|
|
|
virtual ~JpgDatasetOutput(){}
|
2014-07-29 18:12:17 +08:00
|
|
|
private:
|
2014-08-26 12:55:59 +08:00
|
|
|
JpgDatasetOutput(){}
|
2014-07-29 18:12:17 +08:00
|
|
|
};
|
|
|
|
#endif // CVSAMPLESOUTPUT_H
|