小编use*_*808的帖子

训练我们自己的分类器

现在我正在训练我自己的分类器.所以我正在使用traincascade.But当我给这个命令'opencv_traincascade -data facedet -vec vecfile.vec -bg negative.txt -npos 2650 -nneg 581 -nstages 20 -w 20 -h 20'它显示这样的错误.

PARAMETERS:
cascadeDirName: facedet
vecFileName: vecfile.vec
bgFileName: negative.txt
numPos: 2000
numNeg: 1000
numStages: 20
precalcValBufSize[Mb] : 256
precalcIdxBufSize[Mb] : 256
stageType: BOOST
featureType: HAAR
sampleWidth: 20
sampleHeight: 20
boostType: GAB
minHitRate: 0.995
maxFalseAlarmRate: 0.5
weightTrimRate: 0.95
maxDepth: 1
maxWeakCount: 100
mode: BASIC

===== TRAINING 0-stage =====
<BEGIN
POS count : consumed   2000 : 2000
NEG count : acceptanceRatio    1000 : 1
Precalculation time: 3 …
Run Code Online (Sandbox Code Playgroud)

c++ opencv image-processing

7
推荐指数
1
解决办法
1491
查看次数

如何将 XML 文件转换为 json

我想将 xml 文件转换为 json...但下面的代码显示空指针异常..我不知道出了什么问题。

public class Xmljson {  
    private URL url = null;
    private InputStream inputStream = null;  

    public void getXMLfromJson() {
        try{
            url = Xmljson.class.getClassLoader().getResource("datafile.xml");
            inputStream = url.openStream();
            String xml = IOUtils.toString(inputStream);
            JSON objJson = new XMLSerializer().read(xml);
            System.out.println("JSON data : " + objJson);
        }catch(Exception e){
            e.printStackTrace();
        }finally{
           try {
                if (inputStream != null) {
                    inputStream.close();
                }
                url = null;
            } catch (IOException ex) {}
        }
    }   

    public static void main(String[] args) {
        new Xmljson().getXMLfromJson();
    }
}
Run Code Online (Sandbox Code Playgroud)

此处显示异常

         url = …
Run Code Online (Sandbox Code Playgroud)

java xml json

1
推荐指数
1
解决办法
2万
查看次数

标签 统计

c++ ×1

image-processing ×1

java ×1

json ×1

opencv ×1

xml ×1