91欧美超碰AV自拍|国产成年人性爱视频免费看|亚洲 日韩 欧美一厂二区入|人人看人人爽人人操aV|丝袜美腿视频一区二区在线看|人人操人人爽人人爱|婷婷五月天超碰|97色色欧美亚州A√|另类A√无码精品一级av|欧美特级日韩特级

0
  • 聊天消息
  • 系統(tǒng)消息
  • 評(píng)論與回復(fù)
登錄后你可以
  • 下載海量資料
  • 學(xué)習(xí)在線課程
  • 觀看技術(shù)視頻
  • 寫(xiě)文章/發(fā)帖/加入社區(qū)
會(huì)員中心
創(chuàng)作中心

完善資料讓更多小伙伴認(rèn)識(shí)你,還能領(lǐng)取20積分哦,立即完善>

3天內(nèi)不再提示

如何制作監(jiān)控?cái)z像機(jī)

454398 ? 來(lái)源:wv ? 2019-09-03 11:30 ? 次閱讀
加入交流群
微信小助手二維碼

掃碼添加小助手

加入工程師交流群

第1步:我們需要什么

物理計(jì)算

Arduino Uno(或另一個(gè)工作的微控制器

伺服(我使用parralax標(biāo)準(zhǔn)伺服)

Red led

220k電阻

5x電線

Javascript

P5.js

P5 DOM庫(kù)

P5串行庫(kù)

P5串行控制(處理串行通信的小程序)

ML5.js

對(duì)象

MDF 4mm

底漆噴涂

白色噴漆

淺灰色噴涂油漆

黑色噴漆

黑色太陽(yáng)鏡鏡片(或其他)

第2步:進(jìn)行姿勢(shì)估計(jì)工作

如何制作監(jiān)控?cái)z像機(jī)

首先我們要編寫(xiě)識(shí)別人類(lèi)的草圖并在它的鼻子上放一個(gè)點(diǎn)。目標(biāo)是從這一點(diǎn)獲取水平X數(shù)據(jù)并將其發(fā)送到Arduino。

讓我們開(kāi)始吧!

在這個(gè)項(xiàng)目中,我們需要一些文件或庫(kù)來(lái)使一切正常工作:

p5.js (您可以下載完整的軟件包,因?yàn)檫@包括DOM庫(kù))

p5 DOM

p5串口(我使用了包中包含的示例中的p5.serialport.js文件) )

ML5.js(您可以將其作為鏈接包含在內(nèi),或者您可以通過(guò)這種方式下載整個(gè)本地庫(kù),這樣您就不需要連接互聯(lián)網(wǎng)以使一切正常工作)

我們擁有所有這些,我們可以將所有內(nèi)容鏈接到一個(gè)簡(jiǎn)單的HTML文件中:

接下來(lái)是我們的sketch.js文件,其中所有的魔法都發(fā)生了!

var serial;

var portName = ‘COM6’; // fill in your serial port name here, you can check the right port in Arduino or P5 serial control

var options = {

baudrate: 19200 //baudrate has to be the same in arduino

};

// this is the message that will be sent to the Arduino:

var oneMessage;

let video;

let poseNet;

let poses = [];

var noseX = []

var ifPerson = true;

//var flipHorizontal = false;

function setup() {

createCanvas(640, 480);

video = createCapture(VIDEO);

video.size(width, height);

frameRate(10);

//--------------------------------------

serial = new p5.SerialPort();

// Get a list the ports available

// You should have a callback defined to see the results. See gotList, below:

serial.list();

// Assuming our Arduino is connected, open the connection to it

serial.open(portName, options);

// When you get a list of serial ports that are available

serial.on(‘list’, gotList);

// When you some data from the serial port

serial.on(‘data’, gotData);

//-----------------------------------------

// Create a new poseNet method with a single detection

poseNet = ml5.poseNet(video, {

flipHorizontal: true,

detectionType: ‘single’

}, modelReady);

// This sets up an event that fills the global variable “poses”

// with an array every time new poses are detected

poseNet.on(‘pose’, function (results) {

poses = results;

if (results.length == 0) {

ifPerson = false;

}

//console.log(‘results: ’ + results);

});

// Hide the video element, and just show the canvas

video.hide();

}

function modelReady() {

select(‘#status’).html(‘Model Loaded’);

}

function draw() {

image(video, 0, 0, width, height);

// We can call both functions to draw all keypoints

drawKeypoints();

if (ifPerson == false) {

serial.write(‘c’);

console.log(“X”);

ifPerson = true;

} else {

oneMessage = map(oneMessage, 1, 640, 65, 115);

serial.write(oneMessage);

console.log(“browser: ” + oneMessage);

}

}

//---------------------------------

// Got the list of ports

function gotList(thelist) {

console.log(“List of Serial Ports:”);

// theList is an array of their names

for (var i = 0; i 《 thelist.length; i++) {

// Display in the console

console.log(i + “ ” + thelist[i]);

}

}

// Called when there is data available from the serial port

function gotData() {

var currentString = serial.readLine();

console.log(currentString);

}

//-------------------------------------

// A function to draw ellipses over the detected keypoints

function drawKeypoints() {

// Loop through all the poses detected

for (let i = 0; i 《 poses.length; i++) {

// For each pose detected, loop through all the keypoints

for (let j = 0; j 《 poses[i].pose.keypoints.length; j++) {

// A keypoint is an object describing a body part (like rightArm or leftShoulder)

let keypoint = poses[i].pose.keypoints[“0”];

noseX[i] = keypoint.position.x.toFixed(0);

oneMessage = (parseInt(noseX[0],10));

//console.log(typeof(oneMessage));

select(‘#noseX_1’).html(noseX.toString());

//console.log(typeof(oneMessage))

// Only draw an ellipse is the pose probability is bigger than 0.2

if (keypoint.score 》 0.2) {

fill(255, 0, 0);

noStroke();

ellipse(keypoint.position.x, keypoint.position.y, 10, 10);

}

}

}

}

就是這樣!如果您打開(kāi)html文件,您將看到網(wǎng)絡(luò)攝像頭鏡頭上方有一個(gè)紅點(diǎn)但鏡像(否則您的伺服將遠(yuǎn)離您)。您還將看到發(fā)送到Arduino的X數(shù)據(jù)

第3步:使用P5.serialcontrol

這是一個(gè)快速的。為了建立我的草圖和Arduino之間的串行通信,我們需要一個(gè)處理所有串行數(shù)據(jù)的中間人將它發(fā)送到另一個(gè)。以前人們會(huì)使用不太友好的Node.js,p5.serialcontrol修復(fù)了這個(gè)問(wèn)題。你可以在這里下載p5.serialcontrol。對(duì)于Windows用戶(hù),請(qǐng)查看Alpha 5版本。

可悲的是,p5.serialcontrol并不完美,有時(shí)會(huì)崩潰。所以要小心你發(fā)送了多少數(shù)據(jù)。

步驟4:一切Arduino

接下來(lái)是Arduino代碼并連接伺服和LED。

#include

Servo myservo;

const int redPin = 12;

int newval1, oldval1;

int servoValue;

int space = 2;

int ledState = LOW;

int pos = 0;

unsigned long currentMillis = 0; // stores the value of millis() in each iteration of loop()

unsigned long previousServoMillis = 0; // the time when the servo was last moved

unsigned long previousMillis = 0;

const long interval = 500;

int servoPosition = 90;

int servoSlowInterval = 60; // millisecs between servo moves

int servoFastInterval = 10;

int servoInterval = servoSlowInterval; // initial millisecs between servo moves

int servoDegrees = 2; // amount servo moves at each step

int servoMinDegrees = 45; // will be changed to negative value for movement in the other direction

int servoMaxDegrees = 135;

int increment; // increment to move for each interval

int updateInterval; // interval between updates

unsigned long lastUpdate; // last update of position

int counter = 0;

bool executed = false;

void servoSweep() {

if (currentMillis - previousServoMillis 》= servoInterval) {

previousServoMillis += servoInterval;

servoPosition = servoPosition + servoDegrees; // servoDegrees might be negative

if (servoPosition 《= servoMinDegrees) {

// when the servo gets to its minimum position change the interval to change the speed

if (servoInterval == servoSlowInterval) {

servoInterval = servoSlowInterval; //servoFastInterval

}

else {

servoInterval = servoSlowInterval;

}

}

if ((servoPosition 》= servoMaxDegrees) || (servoPosition 《= servoMinDegrees)) {

// if the servo is at either extreme change the sign of the degrees to make it move the other way

servoDegrees = - servoDegrees; // reverse direction

// and update the position to ensure it is within range

servoPosition = servoPosition + servoDegrees;

}

// make the servo move to the next position

myservo.write(servoPosition);

digitalWrite(redPin, LOW);

// and record the time when the move happened

}

void ledBlink () {

if (currentMillis - previousMillis 》= interval) {

previousMillis = currentMillis;

if (ledState == LOW) {

ledState = HIGH;

} else {

ledState = LOW;

}

digitalWrite(redPin, ledState);

}

}

void setup() {

myservo.attach(9); // servo

Serial.begin(19200); // initialize serial communication

//Serial.setTimeout(10);

pinMode(redPin, OUTPUT);

myservo.write(90);

}

void loop() {

currentMillis = millis();

if (executed == false) {

servoSweep();

delay(50);

}

}

void serialEvent () {

while (Serial.available()) {

newval1 = Serial.read(); //read it

//Serial.println(newval1);

if (newval1 》 0 && newval1 != ‘c’) {

executed = true;

ledBlink();

//if (newval1 《 (oldval1 - space) || newval1 》 (oldval1 + space)) { //dead band setup

myservo.write(newval1);

delay(15);

//oldval1 = newval1;

//}

}

if (newval1 == ‘c’) {

executed = false;

}

}

}

正如您所看到的,我使用了不使用delay()的代碼,因此可以隨時(shí)停止掃描功能,即如果某人被識(shí)別。

在此之后,您可以測(cè)試整個(gè)系統(tǒng)。首先插入你的Arduino與led和伺服(我在我的箭頭上進(jìn)行測(cè)試),然后啟動(dòng)p5.serialcontrol然后打開(kāi)html文件。如果一切正常,箭頭將始終指向您。如果您走出網(wǎng)絡(luò)攝像頭捕獲的圖像,伺服將掃描。

第5步:制作安全攝像頭

所有這些軟件和代碼都讓我們開(kāi)始制作東西!

我模仿了安全攝像頭的這個(gè)原型,并為激光切割機(jī)設(shè)計(jì)了它。我用木膠組裝了這些碎片。相機(jī)內(nèi)部有足夠的空間容納Arduino,它需要一些額外的孔才能將所有電線都放入其中。我還將LED放置在正確的位置,并在前面安裝了黑色鏡頭,以提供額外的安全攝像頭效果。我用一些塑料薄膜消除了led燈的光線。

接下來(lái),我準(zhǔn)備整個(gè)事情并用典型的安全攝像頭顏色繪制它。

步驟6:安裝備注

關(guān)于在某處設(shè)置此安裝的最后一些評(píng)論。安全攝像頭本身沒(méi)有攝像頭攝像頭,可以看到前面的人。我所做的是將網(wǎng)絡(luò)攝像頭隱藏在支柱中并在其前面放置一個(gè)帶孔的海報(bào),以隱藏相機(jī),這對(duì)于創(chuàng)造正確的效果至關(guān)重要。

您還可以做的就是放置相機(jī)處于一個(gè)更典型的安全攝像頭位置,就像掛在天花板或墻壁上一樣。但你可以用它做任何你想做的事!

第7步:結(jié)束結(jié)果

聲明:本文內(nèi)容及配圖由入駐作者撰寫(xiě)或者入駐合作網(wǎng)站授權(quán)轉(zhuǎn)載。文章觀點(diǎn)僅代表作者本人,不代表電子發(fā)燒友網(wǎng)立場(chǎng)。文章及其配圖僅供工程師學(xué)習(xí)之用,如有內(nèi)容侵權(quán)或者其他違規(guī)問(wèn)題,請(qǐng)聯(lián)系本站處理。 舉報(bào)投訴
收藏 人收藏
加入交流群
微信小助手二維碼

掃碼添加小助手

加入工程師交流群

    評(píng)論

    相關(guān)推薦
    熱點(diǎn)推薦

    FCB-EV9520L與CM2002V組合:寬動(dòng)態(tài)監(jiān)控攝像機(jī)的技術(shù)融合與應(yīng)用突破

    協(xié)同,為寬動(dòng)態(tài)(WDR)監(jiān)控提供了系統(tǒng)性解決辦法。這一技術(shù)融合不僅突破了傳統(tǒng)攝像機(jī)在明暗對(duì)比場(chǎng)景中的性能局限,還通過(guò)多維度適配能力重新確立了專(zhuān)業(yè)級(jí)監(jiān)控設(shè)備的行業(yè)標(biāo)準(zhǔn)。
    的頭像 發(fā)表于 03-17 15:45 ?832次閱讀

    索尼AI智能構(gòu)圖PTZ攝像機(jī)迎來(lái)固件更新

    2026年1月29日,索尼(中國(guó))有限公司表示今年4月起,將面向PTZ攝像機(jī)用戶(hù)推出一系列固件升級(jí),包括AI智能構(gòu)圖旗艦PTZ攝像機(jī)BRC-AM7 固件Ver. 3.0版與AI智能構(gòu)圖PTZ攝像機(jī)
    的頭像 發(fā)表于 02-03 09:39 ?663次閱讀

    MS41908M,網(wǎng)絡(luò)攝像機(jī)·監(jiān)控攝像機(jī)用鏡頭驅(qū)動(dòng)芯片(內(nèi)置光圈控制)

    MS41908M 是一款用于網(wǎng)絡(luò)攝像機(jī)監(jiān)控攝像機(jī)的鏡頭驅(qū)動(dòng)芯片,芯片內(nèi)置光圈控制功能;通過(guò)電壓驅(qū)動(dòng)方式以及扭矩紋 波修正技術(shù),實(shí)現(xiàn)了超低噪聲微步驅(qū)動(dòng)。 ? 主要特點(diǎn) 電壓驅(qū)動(dòng)方式,256 微步驅(qū)動(dòng)
    的頭像 發(fā)表于 11-25 14:42 ?431次閱讀
    MS41908M,網(wǎng)絡(luò)<b class='flag-5'>攝像機(jī)</b>·<b class='flag-5'>監(jiān)控</b><b class='flag-5'>攝像機(jī)</b>用鏡頭驅(qū)動(dòng)芯片(內(nèi)置光圈控制)

    智能機(jī)型崛起,傳統(tǒng)安防攝像機(jī),要被 “拍死” 在沙灘上了?

    傳統(tǒng)安防攝像機(jī)面臨智能化挑戰(zhàn),多模態(tài)智能攝像機(jī)通過(guò)多傳感器融合實(shí)現(xiàn)全場(chǎng)景感知與智能分析,重構(gòu)安防監(jiān)控核心能力。
    的頭像 發(fā)表于 11-03 09:25 ?699次閱讀
    智能機(jī)型崛起,傳統(tǒng)安防<b class='flag-5'>攝像機(jī)</b>,要被 “拍死” 在沙灘上了?

    HTD9901鏡頭驅(qū)動(dòng)芯片:攝像機(jī)與安防監(jiān)控的核心動(dòng)力保障

    ? ? ? 在攝像機(jī)與安全監(jiān)控攝像頭的運(yùn)行體系中,鏡頭驅(qū)動(dòng)芯片如同“神經(jīng)中樞”,直接決定了設(shè)備縮放、調(diào)焦的精準(zhǔn)度與運(yùn)行穩(wěn)定性,而HTD9901正是為滿(mǎn)足這一核心需求量身打造的專(zhuān)業(yè)鏡頭驅(qū)動(dòng)芯片,其內(nèi)
    的頭像 發(fā)表于 10-22 16:52 ?623次閱讀
    HTD9901鏡頭驅(qū)動(dòng)芯片:<b class='flag-5'>攝像機(jī)</b>與安防<b class='flag-5'>監(jiān)控</b>的核心動(dòng)力保障

    快速自動(dòng)聚焦4K攝像機(jī)模組——索尼FCB-ER8530

    攝像機(jī)
    szxuanzhan
    發(fā)布于 :2025年06月09日 16:12:27

    松下推出專(zhuān)業(yè)級(jí)手持攝像機(jī)AG-CX100MC

    松下公司近期發(fā)布了專(zhuān)為視頻制作、廣播電視及流媒體分發(fā)領(lǐng)域量身打造的專(zhuān)業(yè)級(jí)手持攝像機(jī)——AG-CX100MC。該攝像機(jī)支持4K 60p 10-bit超高清拍攝,旨在為專(zhuān)業(yè)用戶(hù)帶來(lái)極致的影像體驗(yàn)。
    的頭像 發(fā)表于 05-29 09:23 ?1718次閱讀

    IPC網(wǎng)絡(luò)攝像機(jī)的靜電和浪涌保護(hù)方案

    概述IPC網(wǎng)絡(luò)攝像機(jī)(IPCAMERA)是一種結(jié)合傳統(tǒng)攝像機(jī)與網(wǎng)絡(luò)技術(shù)所產(chǎn)生的新一代攝像機(jī),它可以將影像通過(guò)網(wǎng)絡(luò)傳至地球另一端,且遠(yuǎn)端的瀏覽者不需用任何專(zhuān)業(yè)軟件,只要標(biāo)準(zhǔn)的網(wǎng)絡(luò)瀏覽器即可監(jiān)視其影像
    的頭像 發(fā)表于 05-27 18:06 ?1198次閱讀
    IPC網(wǎng)絡(luò)<b class='flag-5'>攝像機(jī)</b>的靜電和浪涌保護(hù)方案

    雙光譜云臺(tái)監(jiān)控攝像機(jī),讓秸稈焚燒行為盡收眼底

    秋天是喜慶豐收的季節(jié),卻也是秸稈焚燒的易發(fā)期。為持續(xù)改善空氣質(zhì)量,做好農(nóng)作物秸稈焚燒和綜合利用工作,環(huán)保有關(guān)部門(mén)采用在高塔上安裝遠(yuǎn)距離雙光譜視頻監(jiān)控攝像機(jī),對(duì)村域范圍內(nèi)的農(nóng)田秸稈焚燒情況進(jìn)行實(shí)時(shí)監(jiān)控
    的頭像 發(fā)表于 05-14 10:56 ?743次閱讀

    索尼攝像機(jī)系統(tǒng)的使用功能

    設(shè)備使用功能和配置擴(kuò)展,增加攝像機(jī)的系統(tǒng)應(yīng)用深度和方便性快速指派RCP和CCU的靈活組合,簡(jiǎn)化調(diào)整視頻、Tally等多種信號(hào)的跟隨變動(dòng)。
    的頭像 發(fā)表于 05-07 16:30 ?2069次閱讀
    索尼<b class='flag-5'>攝像機(jī)</b>系統(tǒng)的使用功能

    索尼攝像機(jī)系統(tǒng)的應(yīng)用功能

    節(jié)目制作系統(tǒng)快速發(fā)展,索尼系統(tǒng)攝像機(jī)始終立于技術(shù)前沿,不斷推陳出新,助力實(shí)現(xiàn)用戶(hù)日益多元的需求。系統(tǒng)攝像機(jī)有一些和系統(tǒng)相關(guān)的非常規(guī)功能,屬于資深工程師嚴(yán)選推薦,以下讓我們一同探尋這些深度(秘密)的系統(tǒng)應(yīng)用功能。
    的頭像 發(fā)表于 05-06 09:45 ?1822次閱讀
    索尼<b class='flag-5'>攝像機(jī)</b>系統(tǒng)的應(yīng)用功能

    索尼發(fā)布HDC-F5500V多格式系統(tǒng)攝像機(jī)

    2025年4月,索尼(中國(guó))有限公司發(fā)布HDC-F5500V多格式系統(tǒng)攝像機(jī),這款攝像機(jī)是索尼HDC系列的新成員,搭載了Super 35mm 4K CMOS全域快門(mén)成像器,支持淺景深的電影感畫(huà)面表現(xiàn)
    的頭像 發(fā)表于 04-25 15:29 ?1233次閱讀

    安森美圖像傳感器在安防和監(jiān)控攝像機(jī)中的應(yīng)用

    安防和監(jiān)控攝像機(jī)是現(xiàn)代安防系統(tǒng)不可或缺的一部分,在監(jiān)控和記錄活動(dòng)以加強(qiáng)安全和遏制犯罪方面發(fā)揮著至關(guān)重要的作用。這些系統(tǒng)部署在各種環(huán)境中,包括住宅區(qū)、商業(yè)地產(chǎn)、工業(yè)場(chǎng)所和公共場(chǎng)所,以對(duì)場(chǎng)所進(jìn)行警示監(jiān)視。本文將為您介紹安防和
    的頭像 發(fā)表于 04-07 09:33 ?1509次閱讀