-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFlickr.h
96 lines (72 loc) · 2.08 KB
/
Flickr.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
// Copyright 2017 Annotator Team
#ifndef ANNOTATOR_ANNOTATORLIB_FLICKR_H
#define ANNOTATOR_ANNOTATORLIB_FLICKR_H
/************************************************************
ImageFolder class header
************************************************************/
#include "AnnotatorLib/ImageSet/AbstractImageSet.h"
#include <string>
#include <vector>
#include <AnnotatorLib/AnnotatorLibDatastructs.h>
#include <AnnotatorLib/annotatorlib_api.h>
#include <opencv2/opencv.hpp>
namespace AnnotatorLib {
namespace ImageSet {
/************************************************************/
/**
*
*/
class ANNOTATORLIB_API Flickr : public AbstractImageSet {
public:
Flickr(std::string path);
/**
*
* @return type
*/
virtual ImageSetType getType() override;
/**
*
* @param frame
* @return image
*/
virtual Image getImage(unsigned long position) override;
virtual std::string getImagePath(unsigned long /* frame */) override;
virtual bool gotoPosition(unsigned long position) override;
virtual long getPosition() override;
/**
*
* @return next
*/
virtual bool hasNext() override;
/**
*
* @return image
*/
virtual Image next() override;
/**
*
* @return size
*/
virtual unsigned int size() override;
virtual unsigned int getFPS() override;
virtual std::string getPath() override;
virtual bool equals(std::shared_ptr<AbstractImageSet> other) override;
protected:
void initFlickr();
void search();
void parseSearchResponse(std::string jsonStr);
Image urlToImage(std::string url);
long position = 0;
std::string path;
std::vector<std::string> urls;
};
/************************************************************/
/* External declarations (package visibility) */
/************************************************************/
/* Inline functions */
} // of namespace ImageSet
} // of namespace AnnotatorLib
/************************************************************
End of Camera class header
************************************************************/
#endif