Cov txheej txheem:

HackerBox 0024: Vision Quest: 11 Cov Kauj Ruam
HackerBox 0024: Vision Quest: 11 Cov Kauj Ruam

Video: HackerBox 0024: Vision Quest: 11 Cov Kauj Ruam

Video: HackerBox 0024: Vision Quest: 11 Cov Kauj Ruam
Video: Hackerbox 0025 Flair Ware 2024, Kaum ib hlis
Anonim
HackerBox 0024: Lub Zeem Muag Quest
HackerBox 0024: Lub Zeem Muag Quest

Vision Quest - Lub hlis no, HackerBox Hackers tab tom sim ua Computer Vision thiab Servo Motion Tracking. Cov Lus Qhia no muaj cov ntaub ntawv rau ua haujlwm nrog HackerBox #0024, uas koj tuaj yeem khaws tau ntawm no thaum cov khoom siv kawg. Tsis tas li, yog tias koj xav tau txais HackerBox zoo li txoj cai no hauv koj lub mailbox txhua lub hlis, thov sau npe ntawm HackerBoxes.com thiab koom nrog kev tawm tsam!

Cov Ntsiab Lus thiab Kawm Lub Hom Phiaj rau HackerBox 0024:

  • Kev sim nrog Computer Vision
  • Teeb tsa OpenCV (Lub Zeem Muag Computer)
  • Programming Arduino Nano los ntawm Arduino IDE
  • Tswj Servo Motors nrog Arduino Nano
  • Sib dhos Cov Neeg Kho Tshuab Pan thiab Tilt Assembly
  • Tswj Yias thiab Tilt Motion nrog Microcontroller
  • Ua Lub ntsej muag taug qab siv OpenCV

HackerBoxes yog lub npov muab kev pabcuam txhua hli rau DIY khoom siv hluav taws xob thiab tshuab computer. Peb yog cov nyiam ua haujlwm, tsim khoom, thiab sim ua. Peb yog cov neeg ua npau suav npau suav. HACK THE PLANET!

Kauj Ruam 1: HackerBox 0024: Cov Ntsiab Lus Box

HackerBox 0024: Cov Ntsiab Lus Box
HackerBox 0024: Cov Ntsiab Lus Box
  • HackerBoxes #0024 Daim Npav Siv Tau
  • Peb Bracket Pan thiab Tilt Assembly
  • Ob MG996R Servos nrog Cov Khoom Siv
  • Ob Aluminium Circular Servo Couplers
  • Arduino Nano V3 - 5V, 16MHz, MicroUSB
  • Lub Koob Yees Duab Los Ua Ke nrog USB Cable
  • Peb Lenses nrog Universal Clip Mount
  • Kev Tshuaj Kho Mob Cwj mem Teeb
  • Dupont Txiv neej/Poj Niam Jumpers
  • MicroUSB Cable
  • Tshwj xeeb OpenCV Decal
  • Tshwj xeeb Dia de Muertos Decal

Qee qhov lwm yam uas yuav pab tau:

  • Ntoo rooj ntoo me me rau lub hauv paus lub koob yees duab
  • Soldering hlau, cov laug, thiab cov cuab yeej siv yooj yim
  • Khoos phis tawj rau kev khiav cov cuab yeej software

Qhov tseem ceeb tshaj, koj yuav xav tau kev nkag siab ntawm kev taug txuj kev nyuaj, DIY tus ntsuj plig, thiab xav paub xav paub hacker. Hardcore DIY cov khoom siv hluav taws xob tsis yog kev nrhiav tsis tseem ceeb, thiab peb tsis tso dej rau koj. Lub hom phiaj yog kev vam meej, tsis yog kev ua tiav. Thaum koj mob siab rau thiab txaus siab rau kev taug txuj kev nyuaj, kev txaus siab ntau tuaj yeem tau los ntawm kev kawm thev naus laus zis tshiab thiab vam tias yuav tau txais qee qhov haujlwm ua haujlwm. Peb hais kom ua txhua kauj ruam qeeb, ua tib zoo mloog cov ntsiab lus, thiab tsis txhob maj mus thov kev pab.

NUG NUG NUG cov lus nug: Peb nyiam nug txhua tus HackerBox cov tswv cuab muaj txiaj ntsig zoo tiag tiag. Thov siv ob peb feeb los tshuaj xyuas FAQ ntawm HackerBoxes lub vev xaib ua ntej txhawm rau tiv toj kev txhawb nqa. Thaum peb pom tseeb xav pab txhua tus tswv cuab ntau li qhov tsim nyog, feem ntau ntawm peb cov email txhawb nqa cuam tshuam nrog cov lus nug yooj yim uas tau hais meej meej hauv FAQ. Ua tsaug rau koj nkag siab!

Kauj Ruam 2: Khoos Phis Tawj Lub Zeem Muag

Khoos phis tawj Lub Zeem Muag
Khoos phis tawj Lub Zeem Muag

Lub khoos phis tawj pom kev yog thaj chaw sib tham uas cuam tshuam nrog cov khoos phis tawj tau txais kev nkag siab qib siab los ntawm cov duab lossis yeeb yaj kiab. Los ntawm kev xav ntawm kev tsim vaj tsev, lub zeem muag hauv computer nrhiav kom siv lub luag haujlwm uas tib neeg qhov muag pom tau ua tau. Raws li kev qhuab qhia txuj ci, lub zeem muag hauv computer tau txhawj xeeb nrog txoj kev xav tom qab cov txheej txheem dag uas rho cov ntaub ntawv los ntawm cov duab. Cov duab cov ntaub ntawv tuaj yeem ua ntau hom, xws li ntu ntu video, saib los ntawm ntau lub koob yees duab, lossis ntau cov ntaub ntawv los ntawm lub tshuab kuaj mob. Raws li kev qhuab qhia thev naus laus zis, lub khoos phis tawj lub zeem muag nrhiav kev siv nws cov kev xav thiab cov qauv rau kev tsim kho lub khoos phis tawj lub zeem muag. Sub-domains ntawm lub khoos phis tawj suav nrog suav nrog rov tsim kho qhov xwm txheej, tshawb pom qhov tshwm sim, taug qab cov vis dis aus, paub qhov khoom, kwv yees kwv yees li 3D, kev kawm, ntsuas ntsuas, kwv yees kwv yees, thiab rov kho duab.

Nws yog qhov nthuav kom nco ntsoov tias lub zeem muag hauv computer tuaj yeem suav tias yog qhov ntxeev ntawm lub khoos phis tawj duab.

Kauj Ruam 3: Ua thiab OpenCV

Ua thiab OpenCV
Ua thiab OpenCV

Kev ua yog cov software hloov pauv yooj yim sketchbook thiab cov lus rau kev kawm paub yuav ua li cas tus lej hauv cov ntsiab lus ntawm kev kos duab. Kev ua haujlwm tau txhawb nqa kev paub txog software hauv kev kos duab thiab pom kev paub hauv kev siv thev naus laus zis. Muaj ntau txhiab tus tub ntxhais kawm, kws ua yeeb yam, tsim qauv, tshawb fawb, thiab nyiam ua haujlwm uas siv Kev Ua Haujlwm rau kev kawm thiab ua qauv.

OpenCV (Open Source Computer Vision Library) yog lub khoos phis tawj qhib qhov muag pom kev thiab tshuab kev kawm software. OpenCV tau tsim los muab cov txheej txheem ib txwm muaj rau kev siv lub khoos phis tawj lub zeem muag thiab ua kom nrawm dua kev siv lub tshuab kev nkag siab hauv cov khoom lag luam. OpenCV lub tsev qiv ntawv muaj ntau dua 2500 qhov ua tau zoo ntawm cov txheej txheem, uas suav nrog cov txheej txheem ua tiav ntawm ob qho tib si qub thiab niaj hnub pom ntawm lub khoos phis tawj lub zeem muag thiab lub tshuab kev kawm paub algorithms. Cov txheej txheem no tuaj yeem siv los tshuaj xyuas thiab paub lub ntsej muag, txheeb xyuas cov khoom, cais tib neeg kev ua hauv yeeb yaj kiab, taug qab lub koob yees duab txav, taug qab cov khoom txav, thiab lwm yam.

Nruab OpenCV hauv Kev Ua los ntawm Cov Ntaub Ntawv> Piv txwv cov ntawv qhia los ntawm xaiv "Ntxiv Piv Txwv" thiab tom qab ntawd hauv Libraries tab txhim kho ob qho yeeb yaj kiab thiab OpenCV cov tsev qiv ntawv. Qhib tus piv txwv LiveCamTest rau lub ntsej muag yooj yim taug qab. Txheeb xyuas qee qhov lwm yam OpenCV rau kev ua piv txwv ntawm no.

Cov peev txheej ntxiv:

Pib Nrog Computer Lub Zeem Muag yog cov phiaj xwm phau ntawv muab cov ntsiab lus nkag yooj yim rau kev muaj tswv yim sim nrog lub zeem muag computer. Nws qhia txog cov cai thiab cov ntsiab lus tsim nyog los tsim kho cov phiaj xwm hauv computer.

Programming Computer Vision nrog Python yog phau ntawv O'Reilly ntawm PCV, qhib qhov Python module rau khoos phis tawj pom.

Kawm OpenCV

Khoos Phis Tawj Lub Zeem Muag: Algorithms thiab Cov Ntawv Thov

Mastering OpenCV

Stanford Course CS231n Convolutional Neural Networks for Visual Recognition (16 Yeeb Yaj Kiab)

Chris Urmson TED Tham Txog Yuav ua li cas lub tsheb tsis muaj neeg pom txoj kev

Kauj Ruam 4: Arduino Nano Microcontroller Platform

Arduino Nano Microcontroller Platform
Arduino Nano Microcontroller Platform

Peb tuaj yeem siv txhua lub platform microntroller rau kev tswj hwm servos hauv peb lub lauj kaub thiab qaij lub koob yees duab mount. Arduino Nano yog qhov ua kom zoo nkauj, ua tau zoo rau lub rooj noj mov, ua haujlwm me me Arduino board nrog USB ua ke. Nws yog amazingly puv-featured thiab yooj yim rau hack.

Nta:

  • Microcontroller: Atmel ATmega328P
  • Qhov Voltage: 5V
  • Digital I/O Pins: 14 (6 PWM)
  • Analog Input Pins: 8
  • DC Tam Sim No rau I/O Pin: 40 mA
  • Flash nco: 32 KB (2KB rau bootloader)
  • SIB: 2 KB
  • EEPROM: 1 KB
  • Moos Ceev: 16 MHz
  • Medidas: 17 mm x 43 mm

Qhov kev hloov pauv tshwj xeeb ntawm Arduino Nano yog xim dub Robotdyn tsim. Lub interface yog los ntawm lub nkoj MicroUSB chaw nres nkoj uas sib xws nrog tib lub MicroUSB cables siv nrog ntau lub xov tooj ntawm tes thiab ntsiav tshuaj.

Arduino Nanos muaj lub built-in USB/Serial choj nti. Ntawm qhov kev hloov pauv tshwj xeeb no, tus choj choj yog CH340G. Nco ntsoov tias muaj ntau yam lwm yam ntawm USB/Serial choj chips siv ntawm ntau hom Arduino cov laug cam. Cov chips no tso cai rau koj lub khoos phis tawj USB chaw nres nkoj sib txuas lus nrog cov lej txuas ntawm Arduino tus txheej txheem ua haujlwm.

Lub khoos phis tawj lub operating system xav tau Tus Tsav Tsheb Sib Txuas los sib tham nrog USB/Serial nti. Tus tsav tsheb tso cai rau IDE tham nrog Arduino board. Cov cuab yeej siv tshwj xeeb uas xav tau yog nyob ntawm ob qho OS version thiab tseem yog hom USB/Serial nti. Rau CH340 USB/Serial chips, muaj cov tsav tsheb muaj rau ntau lub tshuab ua haujlwm (UNIX, Mac OS X, lossis Windows). Tus tsim khoom ntawm CH340 muab cov tsav tsheb ntawm no.

Thaum koj xub ntsaws Arduino Nano rau hauv USB chaw nres nkoj ntawm koj lub khoos phis tawj, lub zog ntsuab yuav tsum tuaj thiab tsis ntev tom qab lub xiav LED yuav tsum pib ntsais muag qeeb. Qhov no tshwm sim vim tias Nano tau npaj ua ntej nrog BLINK qhov haujlwm, uas tau ua haujlwm ntawm lub npe tshiab Arduino Nano.

Kauj Ruam 5: Arduino Integrated Development Environment (IDE)

Arduino Integrated Development Environment (IDE)
Arduino Integrated Development Environment (IDE)

Yog tias koj tseem tsis tau teeb tsa Arduino IDE, koj tuaj yeem rub nws los ntawm Arduino.cc

Yog tias koj xav tau cov ntaub ntawv qhia ntxiv rau kev ua haujlwm hauv Arduino ecosystem, peb hais kom txheeb xyuas cov lus qhia rau HackerBoxes Starter Rhiav.

Txuas Nano mus rau hauv MicroUSB cable thiab lwm qhov kawg ntawm txoj hlua rau hauv USB chaw nres nkoj ntawm lub khoos phis tawj, tso tawm Arduino IDE software, xaiv qhov tsim nyog USB chaw nres nkoj hauv IDE hauv cov cuab yeej> chaw nres nkoj (yuav muaj lub npe nrog "wchusb" hauv nws). Kuj tseem xaiv "Arduino Nano" hauv IDE hauv cov cuab yeej> pawg thawj coj.

Thaum kawg, thauj khoom ib qho piv txwv code:

Cov ntaub ntawv-> Piv txwv-> Pib-> Blink

Qhov no yog qhov chaws uas tau tso ua ntej mus rau Nano thiab yuav tsum tau khiav tam sim no kom maj mam ntsais qhov xiav LED. Raws li, yog tias peb thauj tus lej piv txwv no, tsis muaj dab tsi yuav hloov pauv. Hloov chaw, cia hloov kho txoj cai me ntsis.

Saib ze, koj tuaj yeem pom tias qhov haujlwm qhib LED, tos 1000 milliseconds (ib pliag), tig LED tawm, tos lwm thib ob, thiab tom qab ntawd ua txhua yam ntxiv - mus ib txhis.

Hloov kho cov cai los ntawm kev hloov ob qho ntawm "ncua (1000)" nqe lus rau "ncua (100)". Qhov kev hloov kho no yuav ua rau LED ntsais kaum zaus sai dua, puas yog?

Cia peb thauj cov cai hloov pauv mus rau hauv Nano los ntawm nyem lub pob UPLOAD (lub cim xub) nyob saum koj li kev cai hloov kho. Saib hauv qab cov cai rau cov ntaub ntawv xwm txheej: "suav" thiab tom qab ntawd "xa tawm". Thaum kawg, IDE yuav tsum qhia "Uploading Complete" thiab koj cov LED yuav tsum ntsais muag sai dua.

Yog tias muaj, nrog koj zoo siab! Koj nyuam qhuav raug nyiag koj thawj daim ntawm cov lej kos.

Thaum koj cov ntawv ntsais ntsais tau rub thiab khiav, vim li cas ho tsis pom tias koj puas tuaj yeem hloov pauv txoj cai kom ua rau LED ntsais ntsais sai dua ob zaug thiab tom qab ntawd tos ob peb feeb ua ntej rov ua dua? Muab nws sim! Yuav ua li cas txog qee qhov qauv? Thaum koj ua tiav ntawm kev pom lub txiaj ntsig xav tau, coding nws, thiab saib xyuas nws kom ua haujlwm raws li tau npaj tseg, koj tau ua cov kauj ruam loj rau dhau los ua cov cuab yeej muaj peev xwm hacker.

Kauj Ruam 6: Servo Motors

Servo Tsav
Servo Tsav

Servo motors feem ntau yog tswj los ntawm kev rov ua cov hluav taws xob ua hluav taws xob qhov twg qhov dav ntawm cov mem tes qhia txog txoj haujlwm ntawm servo. Cov mem tes dav hloov kho (PWM) tswj lub teeb liab feem ntau tsim los ntawm ib qho kev tswj hwm microcontroller xws li Arduino.

Kev nyiam ua haujlwm me me, xws li MG996R, tau txuas nrog los ntawm tus qauv peb-xaim txuas: ob lub xov hlau rau DC lub zog hluav taws xob thiab ib lub xaim rau nqa kev tswj lub plab. MG996R servos muaj qhov ua haujlwm npau npau npau npau ntawm 4.8-7.2 VDC.

Kauj Ruam 7: Sib dhos lub Yias thiab Tilt Mechanism

Sib dhos Yias thiab Tilt Mechanism
Sib dhos Yias thiab Tilt Mechanism
  1. Rub ob qho tib si MG996R servos los ntawm lawv lub hnab thiab tso tseg cov khoom siv ntxiv rau tam sim no.
  2. Txuas ib qho txhuas, cov khoom siv sib txuas rau txhua qhov kev pabcuam. Nco ntsoov tias cov couplers tuaj hauv lub hnab sib cais los ntawm servos. Lub coupler yog ib qho nruj heev. Pib los ntawm nias lub coupler mus rau qhov kawg ntawm qhov kev tso tawm servo thiab tom qab ntawd xov ib qho ntsia hlau rau hauv qhov chaw nruab nrab. Zawm cov xov kom rub tus txuas mus rau qhov tso tawm servo.
  3. Nco ntsoov tias muaj peb kab zauv rau lub yias-qaij sib dhos-ob lub thawv-kab zauv thiab ib qho U-bracket.
  4. Mount ib qho ntawm lub npov-kab zauv mus rau lub voj voog txhuas rau ib qho ntawm cov kev pabcuam. Peb yuav hu qhov no servo lub lauj kaub servo. Taw qhia lub thawv-khawm nrog nws cov phab ntsa nruab nrab tiv thaiv lub voj voog txhuas xws li ob sab phab ntsa ntawm lub thawv nkhaus ntsej muag deb ntawm lub lauj kaub servo. Siv qhov chaw nruab nrab ntawm phab ntsa nruab nrab ntawm lub thawv ntawv. Qhov kev npaj no yuav tsum tso cai rau lub lauj kaub servo kom tig lub npov txuas-bracket ib ncig thaum nws tau ua haujlwm.
  5. Muab lwm qhov servo (qaij servo) rau hauv lub thawv-bracket uas tau txuas rau lub voj voog txhuas ntawm lub lauj kaub servo. Siv tsawg kawg ob lub txiv ntseej thiab ntsia hlau txhawm rau txhawm rau qaij servo - ib qho ntawm txhua sab.
  6. Tuav lub U-bracket, ntxig cov tooj dag "coj" los ntawm sab hauv ntawm U los ntawm ib qho ntawm qhov loj pivot mounting qhov.
  7. Muab U-bracket nrog cov kabmob coj mus rau qhov qaij servo uas yog sab hauv lub npov bracket xws li lwm qhov loj pivot mounting qhov (ib qho tsis muaj cov kabmob) ua raws nrog lub voj voog txhuas ntawm lub qaij servo.
  8. Siv cov ntsia hlau txuas rau U-bracket mus rau lub voj voog txhuas ntawm ib sab ntawm U-bracket.
  9. Nyob rau lwm sab ntawm U-bracket, nruj ib qho ntsia hlau los ntawm cov kabmob thiab nkag mus rau hauv lub qhov me me hauv lub thawv-bracket tsis pub dhau. Qhov no yuav tsum tso cai rau U-bracket tig ib ncig ntawm lub thawv-bracket tom qab thaum lub qaij servo tau ua haujlwm.

Kauj Ruam 8: Mounting Pan thiab Tilt Assembly

Mounting Pan thiab Tilt Assembly
Mounting Pan thiab Tilt Assembly
Mounting Pan thiab Tilt Assembly
Mounting Pan thiab Tilt Assembly

Lub thawv ntawv txuas ntxiv tuaj yeem ntswj mus rau lub rooj ntoo ntoo me me los ua lub hauv paus lub koob yees duab raws li qhia hauv daim duab. Thaum kawg, lub lauj kaub servo tau teeb tsa nyob rau hauv lub thawv uas txuas ntxiv uas siv tsawg kawg ob lub txiv ntoo thiab ntsia liaj qhov rooj txhawm rau txuas cov servo rau lub bracket - ib qho ntawm txhua sab.

Kauj Ruam 9: Hlau thiab Kuaj Lub Yias thiab Tilt Sib dhos

Hlau thiab Kuaj Cov Yias thiab Tilt Sib Dhos
Hlau thiab Kuaj Cov Yias thiab Tilt Sib Dhos

Txhawm rau xaim cov servos raws li cov phiaj xwm, nws nrawm tshaj plaws tsuas yog txiav thawj tus poj niam txuas los ntawm servos thiab tom qab ntawd siv qee tus poj niam DuPont jumper xaus kom tau txais lub teeb liab thiab kab hauv av txuas rau Nano pins.

Lub Nano tsis muaj tam sim no txaus ntawm 5V muab lub zog rau servos los ntawm USB, yog li xav tau kev pab ntxiv. Qhov no tuaj yeem yog txhua yam hauv 4.8-7.2 Volt ntau. Piv txwv li, plaub lub roj teeb AA (hauv koob) yuav ua haujlwm zoo. Ib lub rooj zaum los yog phab ntsa-wart kuj yog qhov kev xaiv zoo.

Cov piv txwv yooj yim Arduino code txuas ntawm no raws li PanTiltTest.ino tuaj yeem siv los ntsuas kev tswj hwm ntawm ob lub servos los ntawm kev saib xyuas txuas ntawm Arduino IDE. Teem tus saib xyuas baud tus nqi kom haum rau 9600bps teeb tsa hauv qhov piv txwv piv txwv. Nkag mus rau lub kaum qhov tseem ceeb ntawm 0 thiab 180 degrees yuav tso cov servos kom haum.

Thaum kawg, USB Lub Koob Yees Duab Module (lossis lwm yam ntsuas) tuaj yeem ntsia rau U-Bracket ntawm Pan-Tilt Assembly los siv rau hauv kev taug qab daim ntawv thov.

Kauj Ruam 10: Nrhiav ntsej muag nrog OpenCV

Image
Image
Hack Lub Ntiaj Teb
Hack Lub Ntiaj Teb

Lub tshuab pom lub ntsej muag-taug qab cov txheej txheem tuaj yeem ua tiav los ntawm kev sib txuas cov kab ke raws li pom hauv daim duab thaiv. SerialServoControl kos duab rau Arduino tuaj yeem pom nyob hauv Sparkfun kev qhia hauv qab no nrog rau kev ua piv txwv cuam tshuam nrog siv OpenCV, Kev Ua Haujlwm, Arduino, USB Lub Koob Yees Duab, thiab Pan/Tilt Assembly los taug qab tib neeg lub ntsej muag. Qhov kev qhia siv ob lub servos los teeb tsa lub koob yees duab txhawm rau ua kom lub ntsej muag nyob hauv cov kab yeeb yaj kiab txawm tias tus neeg siv txav mus los ntawm chav. Piv txwv li tus lej hauv C#, txheeb xyuas GitHub chaw cia khoom rau CamBot video.

Kauj Ruam 11: Hack Lub Ntiaj Teb

Yog tias koj tau nyiam qhov Instrucable thiab xav kom muaj lub thawv khoom siv hluav taws xob thiab khoos phis tawj thev naus laus zis zoo li qhov no xa mus rau koj lub thawv ntawv txhua lub hlis, thov koom nrog peb los ntawm SUBSCRIBING HERE.

Mus txog thiab qhia koj qhov ua tiav hauv cov lus hauv qab no lossis ntawm HackerBoxes Facebook Page. Muaj tseeb qhia rau peb paub yog tias koj muaj lus nug lossis xav tau kev pab nrog dab tsi. Ua tsaug rau koj ua ib feem ntawm HackerBoxes. Thov khaws koj cov lus pom thiab tawm tswv yim tuaj. HackerBoxes yog koj lub thawv. Cia peb ua tej yam zoo!

Pom zoo: