Publishing 2019 R1 content
[platform/upstream/dldt.git] / inference-engine / samples / validation_app / image_decoder.hpp
1 // Copyright (C) 2018-2019 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
3 //
4
5 #pragma once
6
7 #include <map>
8
9 #include <opencv2/core/core.hpp>
10 #include <opencv2/core/mat.hpp>
11 #include <opencv2/imgproc/imgproc.hpp>
12
13 #include <string>
14 #include <vector>
15 #include "ie_blob.h"
16
17 #include "PreprocessingOptions.hpp"
18
19 using namespace cv;
20 using namespace InferenceEngine;
21
22 class ImageDecoder {
23 public:
24     /**
25      * @brief Load single image to blob
26      * @param name - image file name
27      * @param blob - blob object to load image data to
28      * @return original image sizes
29      */
30     Size loadToBlob(std::string name, Blob& blob, PreprocessingOptions preprocessingOptions);
31
32     /**
33      * @brief Load a list of images to blob
34      * @param names - list of images filenames
35      * @param blob - blob object to load images data to
36      * @return original image size
37      */
38     std::map<std::string, cv::Size> loadToBlob(std::vector<std::string> names, Blob& blob, PreprocessingOptions preprocessingOptions);
39
40     /**
41      * @brief Insert image data to blob at specified batch position.
42      *        Does no checks if blob has sufficient space
43      * @param name - image file name
44      * @param batch_pos - batch position image should be loaded to
45      * @param blob - blob object to load image data to
46      * @return original image size
47      */
48     Size insertIntoBlob(std::string name, int batch_pos, Blob& blob, PreprocessingOptions preprocessingOptions);
49 };