2 * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 #ifndef __MEDIA_VISION_OBJECTDECODER_H__
18 #define __MEDIA_VISION_OBJECTDECODER_H__
24 #include <opencv2/core.hpp>
26 #include "TensorBuffer.h"
27 #include "OutputMetadata.h"
28 #include "PostProcess.h"
31 * @file ObjectDecoder.h
32 * @brief This file contains the ObjectDecoder class definition which
33 * provides object decoder.
43 TensorBuffer mTensorBuffer;
51 float decodeScore(int idx);
52 Box decodeBox(int idx, float score, int label = -1, int offset = 0);
53 Box decodeBoxWithAnchor(int idx, int anchorIdx, float score, cv::Rect2f &anchor);
56 ObjectDecoder(TensorBuffer &buffer, OutputMetadata &metaData, int boxOffset, float scaleW, float scaleH,
57 int numberOfObjects = 0)
58 : mTensorBuffer(buffer)
60 , mBoxOffset(boxOffset)
61 , mNumberOfOjects(numberOfObjects)
66 ~ObjectDecoder() = default;
70 Boxes &getObjectAll();
76 #endif /* __MEDIA_VISION_OBJECTDECODER_H__ */