mirror of
https://github.com/opencv/opencv.git
synced 2024-12-05 01:39:13 +08:00
57cf3d1766
Documentation improvement Bug in output format for JPG set fixed
50 lines
1.2 KiB
C++
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
|