当前位置:网站首页>Maixll dock camera usage

Maixll dock camera usage

2022-07-06 18:15:00 Salted fish shell

I play V831 The order is , First test a single hardware , Know how to use , Combined use later . So if you want to see a complete case, you can leave it alone The use of cameras and Use of screen These two articles . Just look at the following cases directly .


How the camera works

image sensor - camera
 Insert picture description here

camera (CAMERA or WEBCAM) Also known as computer cameras 、 Computer eyes 、 Electronic eye, etc , It's a video input device , It is widely used in video conferencing 、 Telemedicine and real-time monitoring . Ordinary people can also have images of each other on the Internet through cameras 、 Talking and communicating with voices .

principle : The scene passes through the lens (LENS) The generated optical image is projected onto the surface of the image sensor , To an electrical signal , after A/D( A / D conversion ) Then it becomes a digital signal .
 Insert picture description here
Then it is transmitted to the digital signal processing chip (DSP) In the process of processing , adopt USB The interface is transmitted to the computer for processing , Images can be seen through the display .
 Insert picture description here

PS: Don't delve into the principle , We don't design cameras , Just get to know

camera modular

PS: Simply talking about the use of a module , Other modules will be used in combination after the later discussion .

  1. The import module
 from maix import camera
  1. Method statement
Method explain
camera.width() Returns the width of the image configured by the current camera
camera.height() Returns the height of the image configured by the current camera
camera.config(size=(240, 240)) It is mainly used to configure cameras , Set the size of the acquired image
camera.capture() Capture an image and return _maix_image.image
camera.close() close 、 Release the current device
  1. Method demonstration

 Insert picture description here

 Insert picture description here
Camera usage is not difficult , We will talk about whichever case we use later .

Take pictures and save

There are many comprehensive cases of cameras , We will only do one of the simplest , Is to take photos and save . With this function , We can do personnel identification later ( Face recognition , The person in the identification library takes the next step ).
Our preservation goal is our U disc , Convenient for our subsequent extraction . The address is root/app/ Set up pictures . Format
 Insert picture description here

from maix import camera
img = camera.capture()
img.save('root/app/xianyu.jpg')

Put the above code in the IDE On
Before running the code , open U disc
ADB Get into root/app(U disc ) route

[email protected]:/# cd root/app
cd root/app
[email protected]:~/app# ls
main.py        maixhub        main.py.log    run.py        

 Insert picture description here
After running the code, I found U There are no pictures on the disk .
ADB perform ls after , You can see root/app I already have the photos we want to save . It means that the photos have been saved , however U Disk is not displayed .

[email protected]sipeed:~/app# ls
main.py        maixhub        main.py.log    run.py    xianyu.jpg

 Insert picture description here
Execute at this time reboot Restart it
 Insert picture description here

Here comes the photo .~
 Insert picture description here
Next , Use of screen , With the combination of screen and camera, we can do more

原网站

版权声明
本文为[Salted fish shell]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/187/202207061014140909.html

随机推荐