~paparazzi-uav/paparazzi/v5.0-manual

« back to all changes in this revision

Viewing changes to sw/ext/opencv_bebop/opencv/apps/traincascade/imagestorage.h

  • Committer: Paparazzi buildbot
  • Date: 2016-05-18 15:00:29 UTC
  • Revision ID: felix.ruess+docbot@gmail.com-20160518150029-e8lgzi5kvb4p7un9
Manual import commit 4b8bbb730080dac23cf816b98908dacfabe2a8ec from v5.0 branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef _OPENCV_IMAGESTORAGE_H_
 
2
#define _OPENCV_IMAGESTORAGE_H_
 
3
 
 
4
 
 
5
class CvCascadeImageReader
 
6
{
 
7
public:
 
8
    bool create( const std::string _posFilename, const std::string _negFilename, cv::Size _winSize );
 
9
    void restart() { posReader.restart(); }
 
10
    bool getNeg(cv::Mat &_img) { return negReader.get( _img ); }
 
11
    bool getPos(cv::Mat &_img) { return posReader.get( _img ); }
 
12
 
 
13
private:
 
14
    class PosReader
 
15
    {
 
16
    public:
 
17
        PosReader();
 
18
        virtual ~PosReader();
 
19
        bool create( const std::string _filename );
 
20
        bool get( cv::Mat &_img );
 
21
        void restart();
 
22
 
 
23
        short* vec;
 
24
        FILE*  file;
 
25
        int    count;
 
26
        int    vecSize;
 
27
        int    last;
 
28
        int    base;
 
29
    } posReader;
 
30
 
 
31
    class NegReader
 
32
    {
 
33
    public:
 
34
        NegReader();
 
35
        bool create( const std::string _filename, cv::Size _winSize );
 
36
        bool get( cv::Mat& _img );
 
37
        bool nextImg();
 
38
 
 
39
        cv::Mat     src, img;
 
40
        std::vector<std::string> imgFilenames;
 
41
        cv::Point   offset, point;
 
42
        float   scale;
 
43
        float   scaleFactor;
 
44
        float   stepFactor;
 
45
        size_t  last, round;
 
46
        cv::Size    winSize;
 
47
    } negReader;
 
48
};
 
49
 
 
50
#endif