gpt4 book ai didi

c# - 程序找不到文件 (EmguCV)

转载 作者:太空宇宙 更新时间:2023-11-03 21:51:58 24 4
gpt4 key购买 nike

我下载了 EmguCV 示例。

我尝试将默认图像更改为我的图像

默认是这样的

 static void Run()
{
var image = new Mat("lena.jpg", LoadImageType.Color); //Read the files as an 8-bit Bgr image
long detectionTime;
List<Rectangle> faces = new List<Rectangle>();
List<Rectangle> eyes = new List<Rectangle>();

//The cuda cascade classifier doesn't seem to be able to load "haarcascade_frontalface_default.xml" file in this release
//disabling CUDA module for now
bool tryUseCuda = false;

DetectFace.Detect(
image, "haarcascade_frontalface_default.xml", "haarcascade_eye.xml",
faces, eyes,
tryUseCuda,
out detectionTime);

foreach (Rectangle face in faces)
CvInvoke.Rectangle(image, face, new Bgr(Color.Green).MCvScalar, 2);
foreach (Rectangle eye in eyes)
CvInvoke.Rectangle(image, eye, new Bgr(Color.Aquamarine).MCvScalar, 2);

//display the image
ImageViewer.Show(image, String.Format(
"Completed face and eye detection using {0} in {1} milliseconds",
(tryUseCuda && CudaInvoke.HasCuda) ? "GPU"
: CvInvoke.UseOpenCL ? "OpenCL"
: "CPU",
detectionTime));
}

}

我在图像中添加了更改“lena.jpg”-“oleg.jpg”。

我将这张图片添加到项目文件夹

通过添加现有文件 - oleg.jpg。

但是当我运行我的程序时,它说“文件 oleg.jpg 不存在”

问题出在哪里?

谢谢你的帮助

最佳答案

它可以将您的图像文件放在 Bin 地毯上。

问候。

关于c# - 程序找不到文件 (EmguCV),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40129593/

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