Installing OpenCV camera vision software is optional, but since some of the projects I publish include OpenCV, I add the install guide in this feature. The above article has example code that can easily access both the Raspberry Pi Camera and a standard compatible webcam on a PC. Pi Camera Video Capture with OpenCV and Python Multithreading – Link. So it makes sense to experiment with OpenCV on the much more powerful PC before moving the final OpenCV application to the Raspberry Pi. Providing you install the same Python Modules for both Raspberry Pi and Windows, an OpenCV application can swap between two platforms easily. But instead, use special functions to keep GPIO statements confined and organised. It is probably good practice not to spread GPIO access statements across the entire program. I will use dummy data or print statements to attempt to simulate GPIO input and output where possible. ![]() I will usually debug as much code as I can on the PC before transferring to the Raspberry Pi. However, unless I need access to GPIO connected devices, I write, run and debug the code on the PC first before any FTP transfer. Therefore, I use a text editor on my Windows PC and then transfer the code file via FTP to the Raspberry Pi. ![]() I generally don’t write new code directly on the Raspberry Pi in case of unrecoverable failure of the SD Card. Additionally, I recommend the Geany text editor which I recently discovered. Therefore I go through the install process of the Python programming language, and I also include installing OpenCV. ![]() Ideally, to save the Raspberry Pi SD Card, we can debug the bulk of the Python code on our much faster laptop or PC instead.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |