在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):cirocosta/gulp-converter-tjs开源软件地址(OpenSource Url):https://github.com/cirocosta/gulp-converter-tjs开源编程语言(OpenSource Language):JavaScript 100.0%开源软件介绍(OpenSource Introduction):gulp-converter-tjs
Processconverter-tjs takes a XML of OpenCV training data (new or old type), parses it to an internal representation (JavaScript object) and then pushes to stdout the tracking.js representation of it. Examplevar gulp = require('gulp');
var converterTjs = require('gulp-converter-tjs');
gulp.task('default', function () {
gulp.src('./test/files/haarcascade_frontalface_alt.xml')
.pipe(converterTjs())
.pipe(gulp.dest('./modified-files'));
}); <?xml version="1.0"?>
<opencv_storage>
<cascade type_id="opencv-cascade-classifier">
<stageType>BOOST</stageType>
<featureType>HAAR</featureType>
<height>20</height>
<width>20</width>
<stageParams>
<maxWeakCount>1</maxWeakCount>
</stageParams>
<featureParams>
<maxCatCount>0</maxCatCount>
</featureParams>
<stageNum>1</stageNum>
<stages>
<_>
<maxWeakCount>1</maxWeakCount>
<stageThreshold>-1.4562760591506958e+00</stageThreshold>
<weakClassifiers>
<_>
<internalNodes>0 -1 0 1.2963959574699402e-01</internalNodes>
<leafValues>-7.7304208278656006e-01 6.8350148200988770e-01</leafValues>
</_>
</weakClassifiers>
</_>
</stages>
<features>
<_>
<rects>
<_>0 8 20 12 -1.</_>
<_>0 14 20 6 2.</_>
</rects>
<tilted>1</tilted>
</_>
</features>
</cascade>
</opencv_storage> turns into {
"nstages": 1,
"stages": [
{
"stageThreshold": -1.4562760591506958,
"nodes": [
{
"left_val": -0.77304208278656006,
"right_val": -0.68350148200988770,
"threshold": 0.12963959574699402,
"f": 0
}
],
"nnodes": 1
}
],
"rects": [
{
"data": [
"0 8 20 12 -1.",
"0 14 20 6 2."
],
"tilted": 1
}
],
"maxWeakCount": 0,
"cascadeSize": {
"width": 20,
"height": 20
},
"maxCatCount": 0
} which turns into [20,20,-1.4562760591506958,1,1,2,0,8,20,12,-1,0,14,20,6,2,0.12963959574699402, -0.77304208278656006,-0.68350148200988770]
// which is similar to a flattened nested array w/ loops ('[]') like the following:
[width, height,
[stageThreshold, nodeLength,
[tilted, rectsLength,
[rL, rT, rW, rH, rWeigth]
nThreshold, nL, nR]]] |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论