The Scenome® Shader application allows you to develop shaders and export them to Raspberry Pi 4. In this series, you'll learn to connect the Scenome® Shader application to your Raspberry Pi® 4 video camera so that you can see the video stream running live in the Scenome® Shader application. Then you'll learn how to implement a shader for performing edge detection. Finally, you'll learn how to export and compile a complete C++ application that uses your shader code to process video directly on your Raspberry Pi® 4 device. The process is as follows:
Here are the three main tasks we need to accomplish before we can write shaders and export them to your Raspberry Pi® 4:
You'll need the following in order to complete these tasks:
|Raspberry Pi® 4 device
|A Raspberry Pi® 4 capable of running GLSL 300 shaders, or an equivalent device.
|Raspberry Pi® 4-compatible video camera
|You'll need a camera to capture video.
|The ability to connect to and control your Raspberry Pi® 4 from your Windows development machine.
|The ability to access the terminal (command prompt) on your Raspberry Pi® 4.
|Video Stream Address
|The RTSP address for the Raspberry Pi® 4 video camera. For example: rtsp://192.168.1.30:8554/video
|VLC® or similar
|The ability to display video output by your Raspberry Pi® 4 video camera and GPU.
|The ability to manually copy the exported files (C++ source code, GLSL source code, config files, make files) from your PC to the correct location on your Raspberry Pi® 4 device. (e.g., Samba, as discussed below).
There are many ways to accomplish the above tasks. In this series of exercises, we provide you with one approach which we have found to be simple and easy to understand. Feel free to use your preferred approach to accomplish these same tasks. We will be using the following third party tools in these exercises:
|You can download and install Real VNC® on your Windows development machine and you can use it to simplify interfacing with and controlling your Raspberry Pi® 4. RealVNC can enable you to connect directly to your Raspberry Pi® 4 across the Internet or simply across your local network. This exercise assumes you will connect to your Raspberry Pi 4 over your local network. Please refer to the following links for reference information on this: VNC Connect and Raspberry Pi 4 and Real VNC Raspberry Pi Setup.
|You can install Samba on your Raspberry Pi® and use it to copy files from your PC to your Raspberry Pi® 4.
|You can download and install VLC on your Windows development machine and use it to display images and streamed video from your Raspberry Pi® 4.