Detecting Signs & Landmarks – Overview
Before we jump in to make our self-driving car using Quarky, we must first understand how it will detect the signs and landmarks. Let’s have a look.
Understanding the Logic
We’ll be using our Smartphone’s camera to detect the numbers. The logic here is pretty simple. We’ll bring a random sign in front of the camera. PictoBlox will detect it and tell us which sign it is.
Now, let’s make the script.
We’re going to use the PictoBlox app to make this script.
- Open a new project in PictoBlox App.
- Add a when flag clicked block from the Events palette into the scripting area.
- Next, tap the purple-coloured Add Extension button in the bottom-left corner of the screen. Then, select the Autonomous Driving extension to add it to your palette.
- Then, add a turn () video on stage with () % transparency block from the Autonomous Driving extension and select on flipped from the drop-down. This will turn on the rear camera of your Smartphone.
- Add a () bounding box block.
- Next, add a set detection threshold to () block. We’re going to set it as 0.6.
- Now, from the Control palette, add a forever block.
- Inside the forever block, add an analyse image from () block. This block will detect and analyse the objects the camera sees.
- Add a say () block from the Looks palette.
- Place a join () () block from the Operators palette, in the space given.
- Place () of object () block in the first space and write Detected in the second space.
- Now, run the script by clicking the green flag and bring one by one signs and landmarks cards in front of the camera to check whether the script is running perfectly fine.
In the next activity, we’re going to modify this script to add blocks to transform Quarky into a self-driving car.