我正在閱讀照片並過濾出顏色,這是我在以下圖像中獲得的結果。代碼來自opencv
模塊中的示例文件夾。彩色濾光片技術OpenCV
我想喂畫面回到一個A.R Drone 2.0
,並有無人機跟着白色。我將如何做第二部分?
var cv = require('C:/users/danny/codes/node_modules/opencv/lib/opencv');
// (B)lue, (G)reen, (R)ed
var lower_threshold = [220, 220, 220];
var upper_threshold = [255, 255, 255];
//var lower_threshold = [46, 57, 83];
//var upper_threshold = [80, 96, 115];
cv.readImage('C:/users/danny/codes/node_modules/opencv/examples/files/gutter.jpg',
function(err, im) {
if (err) throw err;
if (im.width() < 1 || im.height() < 1) throw new Error('Image has no size');
im.inRange(lower_threshold, upper_threshold);
im.save('C://users/danny/codes/coin_detected.jpg');
console.log('Image saved to C://users/danny/codes/coin_detected.jpg');
});
第二部分,你的意思是計算移動無人機的軌跡?或者與Parrot SDK(http://developer.parrot.com/)連接? – Mepix
將無人機的軌跡移至白線。我一直在使用'node.js'。不知道什麼是SDK。 – Danny
該SDK是用於控制無人機的軟件開發工具包。以下是一些Parrot無人機的SDK文檔鏈接(http://developer.parrot.com/docs/SDK3/)。我認爲你的A.R. Drone 2.0將與SDK2相對應,SDK2也可以在網站上找到。 – Mepix