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.
 
 
 
 
 
 

46 lines
1.1 KiB

#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 );
CvRect addBoundingboxBorder(const CvRect& bbox) const;
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