gpt4 book ai didi

c++ - 'tesseract/baseapi.h' 错误

转载 作者:行者123 更新时间:2023-11-28 07:06:04 28 4
gpt4 key购买 nike

当我在 opencv 中运行这个程序时,出现以下错误。

fatal error C1083: Cannot open include file: 'tesseract/baseapi.h': No such file or directory

#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <tesseract/baseapi.h>
#include <iostream>

// Covert RGB to CMYK using the formula from
void rgb2cmyk(cv::Mat& src, std::vector<cv::Mat>& cmyk)
{
CV_Assert(src.type() == CV_8UC3);

cmyk.clear();
for (int i = 0; i < 4; ++i)
cmyk.push_back(cv::Mat(src.size(), CV_32F));

for (int i = 0; i < src.rows; ++i)
{
for (int j = 0; j < src.cols; ++j)
{
cv::Vec3b p = src.at<cv::Vec3b>(i,j);

float r = p[2] / 255.;
float g = p[1] / 255.;
float b = p[0] / 255.;
float k = (1 - std::max(std::max(r,g),b));

cmyk[0].at<float>(i,j) = (1 - r - k) / (1 - k);
cmyk[1].at<float>(i,j) = (1 - g - k) / (1 - k);
cmyk[2].at<float>(i,j) = (1 - b - k) / (1 - k);
cmyk[3].at<float>(i,j) = k;
}
}
}

最佳答案

在你的项目设置的“Additional Include Directories”中添加头文件目录的路径

关于c++ - 'tesseract/baseapi.h' 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21746380/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com