twain3/ImageProcess/ImageApplyUVMerge.h

33 lines
1.1 KiB
C++
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* ====================================================
* ¹¦ÄÜ£ºUVͼÓëԭͼºÏ²¢¡£¸ù¾Ýԭͼ¾ÀÆ«¡¢²Ã¼ôÒÔ¼°ÐýתÇé¿ö£¬UV¸´ÖÆԭͼµÄ´¦Àí£¬²¢ÇÒÓëԭͼƴ½ÓΪһÕÅͼ¡£
¸Ã¹¦ÄÜÓÃÓÚUVÒ»Ìå»úÖС£
* ×÷ÕߣºÁõ¶¡Î¬
* Éú³Éʱ¼ä£º2020/7/20
* ×î½üÐÞ¸Äʱ¼ä£º2020/7/20
* °æ±¾ºÅ£ºv1.0 2020/7/20
* ====================================================
*/
#ifndef IMAGE_APPLY_UV_MERGE_H
#define IMAGE_APPLY_UV_MERGE_H
#include "ImageApply.h"
class CImageApplyUVMerge
{
public:
CImageApplyUVMerge();
~CImageApplyUVMerge();
void Apply(cv::Mat& image, const cv::Mat& uv, int dpi = 200, int thresh = 100);
static cv::Mat Apply(const cv::Mat& image, const cv::Mat& uv, const cv::RotatedRect& uvRoi, bool isDesaskew, int angle);
private:
void purgeQR_kernal(cv::Mat& image, const cv::Rect& roi, std::map<int, cv::Scalar> map_color, int dpi, int threshold);
cv::Scalar getColor(const cv::Mat& image, int col, int threshold);
void update_lutData(int contrast);
cv::Mat lut;
};
#endif // !IMAGE_APPLY_UV_MERGE_H