RAPP Platform  v0.6.0
RAPP Platform is a collection of ROS nodes and back-end processes that aim to deliver ready-to-use generic services to robots
 All Classes Namespaces Files Functions Variables Macros
qr_detector.h
Go to the documentation of this file.
1 /******************************************************************************
2 Copyright 2015 RAPP
3 
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7 
8  http://www.apache.org/licenses/LICENSE-2.0
9 
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15 
16 ******************************************************************************/
17 
18 #ifndef RAPP_QR_DETECTOR_NODE
19 #define RAPP_QR_DETECTOR_NODE
20 
21 #include <iostream>
22 
23 #include <opencv2/core/core.hpp>
24 #include <opencv2/highgui/highgui.hpp>
25 #include <opencv2/objdetect/objdetect.hpp>
26 #include <opencv2/imgproc/imgproc.hpp>
27 
28 // QR detection utilized the zbar library
29 #include <zbar.h>
30 
35 struct QrCode
36 {
37  cv::Point center;
38  std::string message;
39 };
40 
46 {
47  public:
48 
52  QrDetector(void);
53 
59  std::vector<QrCode> findQrs(std::string file_name);
60 
66  std::vector<QrCode> detectQrs(const cv::Mat& img);
67 
68  private:
74  cv::Mat loadImage(std::string file_name);
75 };
76 
77 #endif // RAPP_QR_DETECTOR_NODE
cv::Mat loadImage(std::string file_name)
Loads an image into a cv::Mat structure.
Definition: qr_detector.cpp:32
cv::Point center
Definition: qr_detector.h:37
QrDetector(void)
Default constructor.
Definition: qr_detector.cpp:23
std::string message
Definition: qr_detector.h:38
std::vector< QrCode > findQrs(std::string file_name)
Detects QRs in an image file.
Provides the QR detection functionality.
Definition: qr_detector.h:45
std::vector< QrCode > detectQrs(const cv::Mat &img)
Detects QRs in a cv::Mat.
Definition: qr_detector.cpp:43
Structure holding the essential info for a QR code.
Definition: qr_detector.h:35