Tracking.js計算機視覺算法庫
Tracking.js 庫給瀏覽器帶來不同的計算機視覺算法和技術,通過使用流行的 HTML5 規(guī)范可以讓你實時的對網頁進行顏色跟蹤、人臉識別等等。而且該庫體積小 (~7k),接口直觀。
在線人臉識別演示:http://trackingjs.com/examples/face_tag_friends.html
示例代碼:
var colors = new tracking.ColorTracker(['magenta', 'cyan', 'yellow']);
colors.on('track', function(event) {
if (event.data.length === 0) {
// No colors were detected in this frame.
} else {
event.data.forEach(function(rect) {
// rect.x, rect.y, rect.height, rect.width, rect.color
});
}
});
tracking.track('#myVideo', colors);評論
圖片
表情
