-
Notifications
You must be signed in to change notification settings - Fork 3
/
imagemanager.h
executable file
·123 lines (117 loc) · 3.22 KB
/
imagemanager.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
/*
* IMBS-MT Background Subtraction Library multi-thread
* Copyright 2016 Domenico Daniele Bloisi
*
* This file is part of IMBS and it is distributed under the terms of the
* GNU Lesser General Public License (Lesser GPL)
*
*
*
* IMBS-MT is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* IMBS-MT is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with IMBS-MT. If not, see <http://www.gnu.org/licenses/>.
*
* This file contains the C++ OpenCV based implementation for
* IMBS-MT algorithm described in
*
* Domenico D. Bloisi, Andrea Pennisi, and Luca Iocchi
* "Parallel Multi-modal Background Modeling"
* Pattern Recognition Letters
*
* Please, cite the above paper if you use IMBS-MT.
*
* IMBS-MT has been written by Domenico D. Bloisi and Andrea Pennisi
*
* Please, report suggestions/comments/bugs to
*
*/
/**
* \file imagemanager.h
*
* \class ImageManager
*
* \brief Class for managing a set of images
*
**/
#ifndef IMAGEMANAGER_H
#define IMAGEMANAGER_H
#include <iostream>
#include <vector>
#include <string.h>
#include <algorithm>
#include <stdio.h>
#if defined(_MSC_VER)
#include <tchar.h>
#include <strsafe.h>
#pragma comment(lib, "User32.lib")
#elif defined(__GNUC__) || defined(__GNUG__)
#include <dirent.h>
#endif
class ImageManager
{
public:
/**
* \brief Create a new object ImageManager
*
* \param d: directory path
*
*/
ImageManager(const std::string &d);
/**
* \brief ImageManager Destructor
*
*/
~ImageManager();
/**
* \brief Return the number of analysed images
*
*/
inline int getCount() const
{
return count;
}
/**
* \brief Return the end of the image set
*
*/
inline int getEnd() const
{
return end;
}
/**
* \brief Return the previous image
*
* \return return the previous image
*
*/
std::string next(const int &speed);
/**
* \brief Return current frame number
*
* \return return current frame number
*
*/
std::string prev(const int &speed);
private:
/**
* \brief Sort the filenames according to the natural sort algorithm
*
* \param data: the vector containing the names of the files
*
*/
void sorting(std::vector<std::string>& data);
int count, end;
std::vector<std::string> filename;
std::string dir_name;
};
#endif // IMAGEMANAGER_H