当前位置:网站首页>Opencv learning (II) -- installing opencv on raspberry pie
Opencv learning (II) -- installing opencv on raspberry pie
2022-06-25 10:21:00 【Fat brother, Miss Wang】
reason
Found the old raspberry pie , Bought a camera , See if you can do the same ubuntu Do face recognition like that , After all, considering the convenience of use . You can't use a computer to make a product .
Front face recognition with single chip microcomputer , It's quite simple , But for accuracy , It may still be relatively poor , You can fool me with a picture , You may need to add some infrared to identify the human body , But with that , Why do you have to use a face photo as a key , Use a complex photo , Would it be better , Just don't let others know what photos you use , Feel safer than your face , After all, the face is always exposed . It feels better to use a QR code .
Installation method
Don't talk much , Or how to install it on raspberry pie opencv-python Well .
The system is installed by official tools , Not here .
Refer to the A stray cat -《 Super simple to teach you how to install... On raspberry pie opencv( Two )》
However, it was not installed in his way opencv, It can also be used , It was installed in a few minutes .
But I don't know if there will be any lack of libraries , Follow up findings are being solved 
So let's get started
Replace source
wget -qO- https://tech.biko.pub/resource/rpi-replace-apt-source-buster.sh | sudo bash
Upgrade software
sudo apt-get update
sudo apt-get upgrade
Installation Library
sudo apt-get install libatlas-base-dev
sudo apt-get install libjasper-dev
sudo apt-get install aptitude
sudo aptitude install libqtgui4
sudo apt-get install python3-pyqt5
sudo aptitude install libqt4-test
Note that some hints are not errors , Don't care
install opencv And upgrade numpy
sudo pip3 install opencv-python
pip3 install -U numpy
Other configuration
Turn on the camera
perform
sudo raspi-config
choice 3 Interface Options
And then camera and ssh open ,ssh Opening is convenient for transferring files .
Upload test files
I use it here. winscp Upload a previous test script , Test face recognition and camera
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# 1. Import library
import cv2
# 2. Load face model
faceModel = cv2.CascadeClassifier('/usr/local/lib/python3.9/dist-packages/cv2/data/haarcascade_frontalface_default.xml')
# 3. Turn on the camera
capture = cv2.VideoCapture(0)
# 4. Get the real-time picture of the camera
while True:
#4.1 Read the picture of each frame
ret,image = capture.read()
#4.2 Grayscale processing
gray = cv2.cvtColor(image,cv2.COLOR_RGB2GRAY)
#4.3 Check the face
# faces = faceModel.detectMultiScale(gray,1.1,3,0)
faces = faceModel.detectMultiScale(
gray,
scaleFactor=1.15,
minNeighbors=5,
minSize=(5, 5),
# flags=cv2.cv.CV_HAAR_SCALE_IMAGE
)
print(" Find out {0} Personal face !".format(len(faces)))
#4.4 Mark the face
for(x,y,w,h) in faces:
# 1. Original picture 2. Face coordinate origin 3. Height of marker 4, Line color 5, Line width
cv2.rectangle(image,(x,y),(x+w,y+h),(0,255,0),2)
#4.5 display picture
cv2.imshow(' Face recognition camera ',image)
#4.6 Pause window
if cv2.waitKey(5) & 0xFF == ord('q'):
break
# 5. Release resources
capture.release()
# 6. Destruction of the window
cv2.destroyAllWindows()
effect 
Unexpectedly, the master of dream was photographed so indistinctly .
The disadvantages of face recognition
At the beginning, we used face recognition to bring convenience and security , Later, someone used face recognition to kill people , Installed cameras in shopping malls , You can tell whether you are a first-time visitor or a regular visitor , So as to output pertinently .
Users who have done face recognition entry know , The acquiree needs to blink 、 Turn around 、 Open your mouth and other actions to cooperate with the collection “ Living information ”.
“ What kind of activation process is used for a picture , Ordinary people can make photos shake their heads 、 Blink .” Laodongyan, a professor of Law School of Tsinghua University, is right 《 China consumer daily 》 The reporters ,“ The level of software technology is relatively low .”
The human face is the most exposed biometric fingerprint , I feel that it is not suitable to use it as a security means to protect some important information .
Some people are good at forging , Some people try to solve it , Increase living judgment , Update algorithms and other technologies , But the feeling is always passive defense , It is difficult to treat symptoms in time .
Someone has begun to cheat AI 了 ,《 How to prevent face recognition ?》
Fawkes This tool can upload your photos , No machine learning . Download address 
Conclusion
Yesterday, I read several college entrance examination Chinese questions ,




See what's going on ?
Put these questions together , The purpose is too obvious , The state wants our students , It has a solid foundation , And have the spirit of daring to innovate . Learn your own skills first , Learn how to do it again , Although there are Pavilion wings , But not just drunk .
The key is coming. !
The most gratifying thing for me is , This topic in Beijing , I was right ,

Look at my previous blog and you know , I have always emphasized that learning cannot be stopped !
Although it is a little late to understand , But still hope , People who see , Can keep a learning heart .
At least it has been affirmed by the government .
边栏推荐
- Kotlin advanced set
- 链表 删除链表中的节点
- Oracle query comes with JDK version
- Basic use and principle of Minio
- DDS learning notes of opendds
- ShardingSphere-Proxy 4.1 分庫分錶
- [RPC] i/o model - Rector mode of bio, NiO, AIO and NiO
- Flask blog practice - archiving and labeling of sidebar articles
- Force buckle -104 Maximum depth of binary tree
- MySQL source code reading (II) login connection debugging
猜你喜欢
![[paper reading | depth] role based network embedding via structural features reconstruction with degree regulated](/img/70/31a4eaec3f517089b220b35af2f3b7.png)
[paper reading | depth] role based network embedding via structural features reconstruction with degree regulated

Methodchannel of flutter

P2P network core technology: Gossip protocol

Flask blog practice - realize the latest articles and search in the sidebar

WPF Prism框架

什么是 CRA

Mengyou Technology: six elements of tiktok's home page decoration, how to break ten thousand dollars in three days

How to make small programs on wechat? How to make small programs on wechat

How much does a wechat applet cost? Wechat applet development and production costs? Come and have a look

Learning notes of rxjs takeuntil operator
随机推荐
Create menu file
Oracle查询自带JDK版本
依赖属性、依赖附加属性以及类型转换
Macro application connector\
Neat Syntax Design of an ETL Language (Part 2)
西门子PLCS7-200使用(一)---开发环境和组态软件入门
SparseArray details
单片机进阶---PCB开发之照葫芦画瓢(二)
How to make a self-service order wechat applet? How to do the wechat order applet? visual editing
[paper reading | deep reading] line: large scale information network embedding
Wearable devices may reveal personal privacy
新学派:不诈骗经济学
Kotlin advanced generic
Android database security: after the user exits, the transaction rollback log still stores relevant data information
How to install SSL certificates in Microsoft Exchange 2010
Bug- solve the display length limitation of log distinguished character encoding (edittext+lengthfilter)
Mengyou Technology: tiktok live broadcast with goods elements hot topics retention skills shaping image highlight selling points
The problem of automatic page refresh after the flyer WebView pops up the soft keyboard
【论文阅读|深读】DRNE:Deep Recursive Network Embedding with Regular Equivalence
NFC read / write mode development - book summary