我有两张非常相似的照片 这是正确识别为5x5_250词典的标记209
虽然这另一个非常相似,却无法识别, 它是同一5x5_250词典的标记207:
,另外在这张其他照片中也识别出了标记207:
我尝试更改检测器参数
params->adaptiveThreshWinSizeMin = 4;
params->adaptiveThreshWinSizeMax = 26;
params->adaptiveThreshWinSizeStep = 2;
params->minMarkerPerimeterRate = 0.01;
params->maxMarkerPerimeterRate = 4;
params->polygonalApproxAccuracyRate = 0.1;
params->perspectiveRemovePixelPerCell = 10;
但是似乎没有什么变化,所以我回到默认值, 所以我的问题是:
答案 0 :(得分:1)
由于ArUco标记检测的第一步是角点检测,因此ArUco标记周围的白色边框是必需的。 供参考,请参见page 4 of the documentation of the ArUco library。
不幸的是,切断标记周围的所谓“安静区域”是一个普遍的问题。将来,可能会帮助打印带有其他角的标记,例如:
要生成角,请运行此代码段并将其拖放到需要的位置。然后右键单击并“将图像另存为...”。
var canvas = document.getElementById("myCanvas");
var context = canvas.getContext("2d");
var theImage = null;
function redraw(){
if (!theImage){
context.font = "30px Arial";
context.fillStyle = "black";
context.fillText("Drag & Drop image here.", 10, 40);
return;
}
var width = theImage.width;
var height = theImage.height;
var nTiles = 8;
var padding = 3;
var cornerLength = 4;
var dx = width / nTiles;
var dy = height / nTiles;
canvas.width = 2 * padding * dx + width;
canvas.height = 2 * padding * dy + height;
// clear background
context.fillStyle = "#ffffff";
context.fillRect(0, 0, canvas.width, canvas.height);
// draw corners
context.fillStyle = "#000000";
context.fillRect(0, 0, dx, dy * cornerLength);
context.fillRect(0, 0, cornerLength * dx, dy);
context.fillRect(canvas.width - dx, canvas.height - dy * cornerLength, dx, dy * cornerLength);
context.fillRect(canvas.width - cornerLength * dx, canvas.height - dy, cornerLength * dx, dy);
context.fillRect(canvas.width - dx, 0, dx, dy * cornerLength);
context.fillRect(canvas.width - cornerLength * dx, 0, dx * cornerLength, dy);
context.fillRect(0, canvas.height - dy * cornerLength, dx, dy * cornerLength);
context.fillRect(0, canvas.height - dy, cornerLength * dx, dy);
// draw image
context.drawImage(theImage, padding * dx, padding * dy);
}
redraw();
function handleFile(file){
var reader = new FileReader();
reader.onload = function(){
var image = new Image();
image.src = this.result;
image.onload = function(){
theImage = image;
redraw();
}
}
reader.readAsDataURL(file);
}
canvas.addEventListener("dragover", function(e){
e.preventDefault()
e.stopPropagation()
})
canvas.addEventListener("drop", function(e){
var files = e.dataTransfer.files;
for (var i = 0; i < files.length; i++){
handleFile(files[i]);
}
e.preventDefault()
e.stopPropagation()
})
<canvas id="myCanvas" width="512" height="512"></canvas>