Cov txheej txheem:

QR Code Scanner Siv OpenCV hauv Python: 7 Kauj Ruam
QR Code Scanner Siv OpenCV hauv Python: 7 Kauj Ruam
Anonim

Hauv lub ntiaj teb niaj hnub no peb pom QR code thiab Bar code tau siv yuav luag txhua qhov los ntawm cov khoom ntim khoom mus rau Kev Them Nyiaj Online thiab tam sim no-ib-hnub peb pom QR cov lej txawm tias hauv tsev noj mov kom pom cov ntawv qhia zaub mov.

Yog li tsis ntseeg tias nws yog qhov kev xav loj tam sim no. Tab sis koj puas tau xav tsis thoob tias QR code no ua haujlwm zoo li cas lossis nws tau txheeb xyuas thiab peb tau txais cov ntaub ntawv xav tau li cas? Yog tias koj tsis paub ces koj nyob hauv qhov chaw raug rau lo lus teb.

Hauv Cov Lus Qhia no koj yuav kawm paub yuav ua li cas kom koj yeej QR code Scanner siv Python thiab OpenCV

Khoom siv:

  1. Nab hab sej (3.6, 3.7, 3.8 pom zoo)
  2. OpenCV Library
  3. Tsev qiv ntawv Pyzbar

Kauj ruam 1: Kauj Ruam 1: Ntshuam Cov Tsev Qiv Ntawv

Kauj ruam 1: Ntshuam Cov Tsev Qiv Ntawv
Kauj ruam 1: Ntshuam Cov Tsev Qiv Ntawv

Cia peb pib los ntawm kev xa peb cov tsev qiv ntawv xav tau, Yog li peb yuav siv 3 lub tsev qiv ntawv

1. OpenCV

2. Nqis

3. Peb

Kauj Ruam 2: Kauj Ruam 2: Nkag Mus Rau Webcam

Kauj ruam 2: Nkag mus rau Webcam
Kauj ruam 2: Nkag mus rau Webcam

Nov peb yuav nkag mus rau peb lub vev xaib siv VideoCapture ua haujlwm los ntawm OpenCV thiab tseem teeb tsa qhov dav thiab qhov siab ntawm peb lub qhov rais tso tawm.

Nov yog lub ntsiab lus tseem ceeb yog tias yog koj siv koj lub vev xaib sab hauv ces hla 0 hauv VideoCapture muaj nuj nqi thiab yog tias koj siv exteranl webcam dhau 1

Tam sim no hauv kab 6 peb txiav txim siab qhov siab ntawm peb lub qhov rai tso tawm raws li 640 (3 yog siv rau qhov siab)

Hauv kab 7 peb txiav txim siab qhov siab ntawm peb lub qhov rai tso tawm raws li 480 (4 yog siv rau qhov siab)

Kauj Ruam 3: Kauj Ruam 3: Nyeem Ntawv

Kauj Ruam 3: Nyeem Ntawv
Kauj Ruam 3: Nyeem Ntawv

Nyeem ntas los ntawm webcam yog yooj yim heev. Koj tsuas yog xav tau ntxiv lub sijhawm voj thiab sab hauv thaum lub voj tsim ob qhov sib txawv piv txwv li rov thiab thav duab nyeem cov thav duab siv "cap.read ()".

Tam sim no tag nrho koj cov ntas yuav raug khaws cia hauv qhov sib txawv "thav duab"

Kauj Ruam 4: Kauj Ruam 4: Nyeem Cov Ntaub Ntawv Los Ntawm Barcode

Kauj Ruam 4: Nyeem Cov Ntaub Ntawv Los Ntawm Barcode
Kauj Ruam 4: Nyeem Cov Ntaub Ntawv Los Ntawm Barcode

Tam sim no peb yuav tsim lub voj uas peb yuav nyeem cov ntaub ntawv los ntawm barcode.

Yog li peb yuav siv "txiav txim siab" uas peb tau xa los txiav txim cov ntaub ntawv ntawm QR code

thiab peb yuav khaws nws hauv qhov sib txawv "myData" thiab luam tawm los xyuas seb cov ntaub ntawv puas raug lossis tsis raug

Kauj Ruam 5: Kauj Ruam 5: Teeb Duab Duab Plaub Nyob Ib puag ncig QR Code thiab Qhia Cov Ntaub Ntawv

Kauj Ruam 5: Teeb Duab Duab Plaub Nyob Ib puag ncig QR Code thiab nthuav tawm cov ntaub ntawv
Kauj Ruam 5: Teeb Duab Duab Plaub Nyob Ib puag ncig QR Code thiab nthuav tawm cov ntaub ntawv

Yog li ua ntej peb yuav tsim lub npe sib txawv pts uas yog cov ntsiab lus uas yuav muab rau peb 4 lub ntsiab lus ntawm peb tus lej QR

Tam sim no siv cov ntsiab lus no peb yuav tsim cov duab plaub nyob ib puag ncig peb QR chaws raws li qhia kab 16-18

Txhawm rau pom cov ntawv yuav siv myData sib txawv uas peb cov ntaub ntawv tau khaws cia

Kauj Ruam 6:

Duab
Duab

Thiab thaum kawg peb tau nthuav tawm peb cov duab siv "imshow" ua haujlwm hauv OpenCV

Ntawm Kab 22-23 peb tau npaj cov program tias yog peb nias "q" ces txoj haujlwm yuav xaus

Pom zoo: