opencv2.4.4在vs2010里调试的时候,出现Cannot find or open the PDB file,没有结果输出(读取桌面的一幅图)。但在ctrl+F5时,却提示生成成功,但是也没有输出。然后用网上的办法下载了很多的字符pdb,但是图中所示的这两项的pdb却一直下载不到,求助大神!!
opencv2.4.4在vs2010里调试的时候,出现Cannot find or open the PDB file
答案:2 悬赏:80
解决时间 2021-02-02 22:00
- 提问者网友:斯文败类
- 2021-02-02 04:55
最佳答案
- 二级知识专家网友:佛说妍妍很渣
- 2021-02-02 05:56
.pdb文件仅仅涉及符号表的存储,用于debug阶段,编译/链接是不妨碍的。除非你一定要查看这两个DLL中的Symbols,否则可以不关注的
全部回答
- 1楼网友:为你轻狂半世殇
- 2021-02-02 07:21
opencv
整个项目的结构图:
编写detectfacedemo.java,代码如下:
[java] view
plaincopyprint?
package com.njupt.zhb.test;
import org.opencv.core.core;
import org.opencv.core.mat;
import org.opencv.core.matofrect;
import org.opencv.core.point;
import org.opencv.core.rect;
import org.opencv.core.scalar;
import org.opencv.highgui.highgui;
import org.opencv.objdetect.cascadeclassifier;
//
// detects faces in an image, draws boxes around them, and writes the results
// to "facedetection.png".
//
public class detectfacedemo {
public void run() {
system.out.println("\nrunning detectfacedemo");
system.out.println(getclass().getresource("lbpcascade_frontalface.xml").getpath());
// create a face detector from the cascade file in the resources
// directory.
//cascadeclassifier facedetector = new cascadeclassifier(getclass().getresource("lbpcascade_frontalface.xml").getpath());
//mat image = highgui.imread(getclass().getresource("lena.png").getpath());
//注意:源程序的路径会多打印一个‘/’,因此总是出现如下错误
//因此,我们将第一个字符去掉
string xmlfilepath=getclass().getresource("lbpcascade_frontalface.xml").getpath().substring(1);
cascadeclassifier facedetector = new cascadeclassifier(xmlfilepath);
mat image = highgui.imread(getclass().getresource("we.jpg").getpath().substring(1));
// detect faces in the image.
// matofrect is a special container class for rect.
matofrect facedetections = new matofrect();
facedetector.detectmultiscale(image, facedetections);
system.out.println(string.format("detected %s faces", facedetections.toarray().length));
// draw a bounding box around each face.
for (rect rect : facedetections.toarray()) {
core.rectangle(image, new point(rect.x, rect.y), new point(rect.x + rect.width, rect.y + rect.height), new scalar(0, 255, 0));
}
// save the visualized detection.
string filename = "facedetection.png";
system.out.println(string.format("writing %s", filename));
highgui.imwrite(filename, image);
}
}
package com.njupt.zhb.test;
import org.opencv.core.core;
import org.opencv.core.mat;
import org.opencv.core.matofrect;
import org.opencv.core.point;
import org.opencv.core.rect;
import org.opencv.core.scalar;
import org.opencv.highgui.highgui;
import org.opencv.objdetect.cascadeclassifier;
//
// detects faces in an image, draws boxes around them, and writes the results
// to "facedetection.png".
//
public class detectfacedemo {
public void run() {
system.out.println("\nrunning detectfacedemo");
system.out.println(getclass().getresource("lbpcascade_frontalface.xml").getpath());
// create a face detector from the cascade file in the resources
// directory.
//cascadeclassifier facedetector = new cascadeclassifier(getclass().getresource("lbpcascade_frontalface.xml").getpath());
//mat image = highgui.imread(getclass().getresource("lena.png").getpath());
//注意:源程序的路径会多打印一个‘/’,因此总是出现如下错误
//因此,我们将第一个字符去掉
string xmlfilepath=getclass().getresource("lbpcascade_frontalface.xml").getpath().substring(1);
cascadeclassifier facedetector = new cascadeclassifier(xmlfilepath);
mat image = highgui.imread(getclass().getresource("we.jpg").getpath().substring(1));
// detect faces in the image.
// matofrect is a special container class for rect.
matofrect facedetections = new matofrect();
facedetector.detectmultiscale(image, facedetections);
system.out.println(string.format("detected %s faces", facedetections.toarray().length));
// draw a bounding box around each face.
for (rect rect : facedetections.toarray()) {
core.rectangle(image, new point(rect.x, rect.y), new point(rect.x + rect.width, rect.y + rect.height), new scalar(0, 255, 0));
}
// save the visualized detection.
string filename = "facedetection.png";
system.out.println(string.format("writing %s", filename));
highgui.imwrite(filename, image);
}
}
3.编写测试类:
[java] view
plaincopyprint?
package com.njupt.zhb.test;
public class testmain {
public static void main(string[] args) {
system.out.println("hello, opencv");
// load the native library.
system.loadlibrary("opencv_java246");
new detectfacedemo().run();
}
}
//运行结果:
//hello, opencv
//
//running detectfacedemo
///e:/eclipse_jee/workspace/javaopencv246/bin/com/njupt/zhb/test/lbpcascade_frontalface.xml
//detected 8 faces
//writing facedetection.png
package com.njupt.zhb.test;
public class testmain {
public static void main(string[] args) {
system.out.println("hello, opencv");
// load the native library.
system.loadlibrary("opencv_java246");
new detectfacedemo().run();
}
}
//运行结果:
//hello, opencv
//
//running detectfacedemo
///e:/eclipse_jee/workspace/javaopencv246/bin/com/njupt/zhb/test/lbpcascade_frontalface.xml
//detected 8 faces
//writing facedetection.png
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯
• 手机登qq时,显示手机磁盘不足,清理后重新登 |
• 刺客的套装怎么选啊? |