ocr_crnn_process.h 479 字节
Newer Older
L
lvxiangxiang 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
//
// Created by fujiayi on 2020/7/3.
//
#pragma once

#include <vector>
#include <opencv2/opencv.hpp>


extern const std::vector<int> REC_IMAGE_SHAPE;

cv::Mat get_rotate_crop_image(const cv::Mat &srcimage, const std::vector<std::vector<int>>& box);

cv::Mat crnn_resize_img(const cv::Mat& img, float wh_ratio);

template<class ForwardIterator>
inline size_t argmax(ForwardIterator first, ForwardIterator last) {
    return std::distance(first, std::max_element(first, last));
}