Please enable JavaScript to view this site.

Waijung 2 User Guide

Navigation: ESP32 target > Tutorials > ESP32-CAM

Project 3: Move algorithm in project 2 to run in ESP32

Scroll Prev Top Next More

In this project, we focus on doing image processing on the target. Since processing requires a bit of computational power it will be slower than the IP camera examples.

This will have a similar result in the following link example. ESP32 IP Camera Image Processing in Simulink

 

camera_project_3_1

 

Since we are going to use video streaming, we have to establish the connection of the esp32. The above picture shows how it can be achieved.

Output from the Wifi Setup block is used to trigger the “If Action Subsystem”.

 

camera_project_3_2

 

There are clear differences between the previous example and this. The camera block has three output ports created. Moreover, we use new block called "Memory block" from Waijung. The Image processing subsystem from the previous example is copied and pasted here to run the algorithm.

 

camera_project_3_3

 

From the Project 2: ESP32 IP Camera Image Processing in Simulink example, we already have tuned values for constant blocks that circled in blue color. User cannot change this during the run-time because this code is going to upload to the esp32 target.

 

Note: Dilate Block, Blob Analysis Block, and Draw Shapes block are required to run this example. It can be found in the “Computer Vision Toolbox”

How to configure Waijung camera block for this example

 

In this example, we have to select the camera block mask values similar to the following picture.

camera_project_3_4

1.Select the stream Mode to “Stream to target”

2.Select the target stream mode to “stream to Simulink”

 This will open three output ports to do the image processing

3.Enter the Image Buffer name that has been mentioned in the memory block.

 

Flow of the camera image

 

The flow of the camera will go to the image processing subsystem. Then it will have a processed image with the boxes if there are any compatible colors. Finally, the image will save to the memory block before sending it to the HTTP server.

 

Users can view the camera image as Project 0: ESP32 IP Camera method (Web browser) or Project 1: Simulink Acquire ESP32 IP Camera method (Simulink).

 

Please find the example files from here:

esp32_camera_demo3.slx

 

Copyright 2023 Aimagin Co.,Ltd. Rev.779