嗨,我正在写一个Application
来计算一个中的faces
数量images
。我正在使用Haar_caash_code
xml 来计算人脸。
C#代码:
private void btnStart_Click(object sender, EventArgs e)
{
OpenFileDialog opndlg = new OpenFileDialog();
if (opndlg.ShowDialog().Equals(DialogResult.OK))
{
try
{
Image img = Image.FromFile(opndlg.FileName);
Image<Bgr, byte> BgrImg = new Image<Bgr, byte>(new Bitmap(img));
GrayImage = BgrImg.Convert<Gray, byte>();
var faces = GrayImage.DetectHaarCascade(haar, 1, 4, HAAR_DETECTION_TYPE.DO_CANNY_PRUNING, new Size(25, 25))[0]; //here Exception
MessageBox.Show(faces.Length.ToString());
}
catch (Exception ex)
{
}
}
和 dll 包括:
cudart64_32_16.dll
cufft64_32_16.dll
cvextern.dll
npp64_32_16.dll
opencv_calib3d220.dll
opencv_contrib220.dll
opencv_core220.dll
opencv_features2d220.dll
opencv_flann220.dll
opencv_gpu220.dll
opencv_highgui220.dll
opencv_imgproc220.dll
opencv_legacy220.dll
opencv_ml220.dll
opencv_objdetect220.dll
opencv_video220.dll
运行程序时出现以下错误:
`OpenCV: scale factor must be > 1...`
请帮助解决相同的问题。