cloudFPGA (cF) API  1.0
The documentation of the source code of cloudFPGA (cF)
xf_ocv_ref.hpp
Go to the documentation of this file.
1 
17 
42 
54 #ifndef _XF_OCV_REF_HPP_
55 #define _XF_OCV_REF_HPP_
56 #include "xf_config_params.h"
57 
58 using namespace cv;
59 using namespace std;
60 
61 
62 void ocv_ref(cv::Mat image_input, cv::Mat& opencv_image, cv::Mat transformation_matrix) {
63 
64  for (int I1 = 0; I1 < opencv_image.rows; I1++) {
65  for (int J1 = 0; J1 < opencv_image.cols; J1++) {
66 #if GRAY
67  opencv_image.at<unsigned char>(I1, J1) = 0;
68 #else
69  opencv_image.at<cv::Vec3b>(I1, J1) = 0;
70 #endif
71  }
72  }
73 
74 #if TRANSFORM_TYPE == 1
75 #if INTERPOLATION == 1
76  cv::warpPerspective(image_input, opencv_image, transformation_matrix,
77  cv::Size(image_input.cols, image_input.rows), cv::INTER_LINEAR + cv::WARP_INVERSE_MAP,
78  cv::BORDER_TRANSPARENT, 80);
79 #else
80  cv::warpPerspective(image_input, opencv_image, transformation_matrix,
81  cv::Size(image_input.cols, image_input.rows), cv::INTER_NEAREST + cv::WARP_INVERSE_MAP,
82  cv::BORDER_TRANSPARENT, 80);
83 #endif
84 #else
85 #if INTERPOLATION == 1
86  cv::warpAffine(image_input, opencv_image, transformation_matrix, cv::Size(image_input.cols, image_input.rows),
87  cv::INTER_LINEAR + cv::WARP_INVERSE_MAP, cv::BORDER_TRANSPARENT, 80);
88 #else
89  cv::warpAffine(image_input, opencv_image, transformation_matrix, cv::Size(image_input.cols, image_input.rows),
90  cv::INTER_NEAREST + cv::WARP_INVERSE_MAP, cv::BORDER_TRANSPARENT, 80);
91 #endif
92 #endif
93 
94  cv::imwrite("opencv_output.png", opencv_image);
95 }
96 
97 
98 #endif //_XF_OCV_REF_HPP_
99 
100 
void ocv_ref(cv::Mat img_gray, cv::Mat &ocv_out_img, float Th)
Definition: xf_ocv_ref.hpp:552
The WarpTransform IP configuration header.