54 #ifndef _XF_OCV_REF_HPP_
55 #define _XF_OCV_REF_HPP_
62 void ocv_ref(cv::Mat image_input, cv::Mat& opencv_image, cv::Mat transformation_matrix) {
64 for (
int I1 = 0; I1 < opencv_image.rows; I1++) {
65 for (
int J1 = 0; J1 < opencv_image.cols; J1++) {
67 opencv_image.at<
unsigned char>(I1, J1) = 0;
69 opencv_image.at<cv::Vec3b>(I1, J1) = 0;
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);
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);
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);
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);
94 cv::imwrite(
"opencv_output.png", opencv_image);
void ocv_ref(cv::Mat img_gray, cv::Mat &ocv_out_img, float Th)