forked from Xilinx/mlir-aie
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOpenCVUtils.h
30 lines (24 loc) · 1.23 KB
/
OpenCVUtils.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
//===- OpenCVUtils.h --------------------------------------------*- C++ -*-===//
//
// This file is licensed under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
// Copyright (C) 2023, Advanced Micro Devices, Inc.
//
//===----------------------------------------------------------------------===//
#ifndef _OPENCVUTILS_H_
#define _OPENCVUTILS_H_
#include <opencv2/core/core.hpp>
#include <opencv2/videoio.hpp>
bool imageCompare(cv::Mat &test, cv::Mat &golden, int &numberOfDifferences,
double &error, bool listPositionFirstDifference = false,
bool displayResult = false, double epsilon = 0.01);
void readImage(const std::string &fileName, cv::Mat &image, int flags = 1);
void initializeSingleGrayImageTest(std::string fileName, cv::Mat &src);
void initializeSingleImageTest(std::string fileName, cv::Mat &src);
void initializeVideoCapture(cv::VideoCapture &cap);
void initializeVideoFile(cv::VideoCapture &cap, std::string fileName);
void addSaltPepperNoise(cv::Mat &src, float percentWhite, float percentBlack);
void medianBlur1D(cv::Mat src, cv::Mat &dst, int ksizeHor);
#endif // _OPENCVUTILS_H_