Michael Levit | 06fcf75 | 2022-01-12 11:53:46 +0200 | [diff] [blame^] | 1 | /*
|
| 2 | * Copyright (c) 2022 Arm Limited. All rights reserved.
|
| 3 | * SPDX-License-Identifier: Apache-2.0
|
| 4 | *
|
| 5 | * Licensed under the Apache License, Version 2.0 (the "License");
|
| 6 | * you may not use this file except in compliance with the License.
|
| 7 | * You may obtain a copy of the License at
|
| 8 | *
|
| 9 | * http://www.apache.org/licenses/LICENSE-2.0
|
| 10 | *
|
| 11 | * Unless required by applicable law or agreed to in writing, software
|
| 12 | * distributed under the License is distributed on an "AS IS" BASIS,
|
| 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 14 | * See the License for the specific language governing permissions and
|
| 15 | * limitations under the License.
|
| 16 | */
|
| 17 | #ifndef DETECTOR_POST_PROCESSING_HPP
|
| 18 | #define DETECTOR_POST_PROCESSING_HPP
|
| 19 |
|
| 20 | #include "UseCaseCommonUtils.hpp"
|
| 21 | #include "DetectionResult.hpp"
|
| 22 |
|
| 23 | namespace arm {
|
| 24 | namespace app {
|
| 25 |
|
| 26 | #if DISPLAY_RGB_IMAGE
|
| 27 | #define FORMAT_MULTIPLY_FACTOR 3
|
| 28 | #else
|
| 29 | #define FORMAT_MULTIPLY_FACTOR 1
|
| 30 | #endif /* DISPLAY_RGB_IMAGE */
|
| 31 |
|
| 32 | /**
|
| 33 | * @brief Post processing part of Yolo object detection CNN
|
| 34 | * @param[in] img_in Pointer to the input image,detection bounding boxes drown on it.
|
| 35 | * @param[in] model_output Output tesnsors after CNN invoked
|
| 36 | * @param[out] results_out Vector of detected results.
|
| 37 | * @return void
|
| 38 | **/
|
| 39 | void RunPostProcessing(uint8_t *img_in,TfLiteTensor* model_output[2],std::vector<arm::app::DetectionResult> & results_out);
|
| 40 |
|
| 41 |
|
| 42 | /**
|
| 43 | * @brief Converts RGB image to grayscale
|
| 44 | * @param[in] rgb Pointer to RGB input image
|
| 45 | * @param[out] gray Pointer to RGB out image
|
| 46 | * @param[in] im_w Input image width
|
| 47 | * @param[in] im_h Input image height
|
| 48 | * @return void
|
| 49 | **/
|
| 50 | void RgbToGrayscale(const uint8_t *rgb,uint8_t *gray, int im_w,int im_h);
|
| 51 |
|
| 52 | } /* namespace app */
|
| 53 | } /* namespace arm */
|
| 54 |
|
| 55 | #endif /* DETECTOR_POST_PROCESSING_HPP */
|