Situation
We live on a road with very little parking. When I'm driving home from work, I want to know if there's a space, otherwise, I park on the main road. It's a pain back tracking to the main road when there is no space!
Objective
Use my phone to ask a piZero (£10 computer with wifi) + webcam (£15 ZeroCam) whether there are free spaces available.
Considerations
Road to solution
I explored several popular computer vision solutions but:
I decided to take things back a notch and use some old school computer vision. If you notice, the road is fairly consistent in texture/colour, whilst cars are not. I decided to make a simple calibration tool where the user inputs the typical locations of cars (see red squares in below picture). Via a canny edge detector (built into CV2), I ascertained whether the number of edges within those typical car locations exceeded some threshold, to determine if those spaces were free.
This worked rather well! See image below.
I have an Android, so I used Google Assistant to ask, out-loud, whether there is a space free. Getting this to work was utterly brutal! I used the Flask-Assistant library. Sadly, google-assistant bumped up a version which meant I could not use the Flask-Assistant's script that linked up my device to the cloud. I had to link this all up manually, which is the topic of another blog.
I was rather disappointed with Google-Assistant, as there was no way to remove 'this is a demo app' (or words to that affect) from the responses from Google Assistant.
I also served the image of the parking situation as a simple url I added to the homepage of my Android phone.