Detect People with Raspberry Pi and MATLAB Online
Learn how to use your Raspberry Pi™ with MATLAB Online™ to detect upright people. Remotely access your Raspberry Pi from anywhere that has an Internet connection. Connect to your Raspberry Pi camera module and use the peopleDetectorACF
and the detect()
method to return bounding boxes and scores for the people detected in the live video.
Download the code used in this video.
Published: 22 Jul 2019
In this demo, I will show you how to detect people from a Pi camera using a Raspberry Pi™ and MATLAB Online™.
If you haven’t set up your Raspberry Pi in MATLAB Online, please refer to the documentation to learn how.
Use the command raspilist to see the online Raspberry Pis. You need to connect to your board using the function raspi(). You can either specify a Raspberry Pi or use the default which connects to the most recent board.
Here, I’m using a Raspberry Pi camera Module V2, which is connected to the Pi using the ribbon cable. Connect to it by using the function cameraboard(). Here, I’m using the resolution 640 by 480.
Next, you can load the people detector. This detector was trained using a person data set. It detects upright people using aggregate channel features.
Here you can use a for loop to repeatedly take images using the snapshot() function, and use the detect() function to find the people in the image and store the results as bounding boxes and scores.
Now, you can insert these results into the image using insertObjectAnnotation() and then use imshow() to display the image to the screen.
Click Run and a figure on the right will show up.
As you can see, as people walk into frame, they are highlighted by the yellow bounding boxes along with a score at the top of the box.
We’ve successfully detected people from the Raspberry Pi camera using MATLAB Online.
For more information, please visit the documentation at mathworks.com.
Up Next:
Related Videos:
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
아시아 태평양
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)