INTRODUCTION
Computer vision deals with how computers can be made to gain a high-level understanding of digital images or videos. From the perspective of engineering, it seeks to automate tasks that the human vision can do.
Computer vision tasks include methods for acquiring, processing, analyzing, and understanding digital images.
Object Detection: Locate the presence of objects with a bounding box and identifies types or classes of the located objects in an image.
- Input: An image with one or more objects, such as a photograph.
- Output: One or more bounding boxes (e.g., defined by a point, width, and height), and a class label for each bounding box.
WASTE
Nobody likes to live surrounded by waste. Not only does it make the surroundings look dirty but, if not managed properly, it can also spread diseases and even cause pollution.
Waste: Waste is any unwanted substance or object that is no longer useful to us. People also call it trash, junk, garbage, or rubbish.
We can commonly classify waste into two types:
- Biodegradable:This type of waste includes substances that decompose naturally over time. Biodegradable waste can be used to make manure and is therefore helpful for the environment. E.g., fruits, vegetables, paper, and dead plants.
- Non-Biodegradable:This type of waste includes substances that don’t decompose naturally. Non-biodegradable waste causes pollution and harm the environment. E.g. plastic, metals, and rubber.
ACTIVITY: MAKING A WASTE MANAGEMENT SYSTEM
Our system will differentiate the waste based on its type. If it detects biodegradable waste, the LEDs of Quarky’s matrix will turn green. If it’s non-biodegradable waste, the LEDs will turn blue.
CODING STEPS
Follow the steps below:
- Create a New file in PictoBlox App.
- Connect Quarky to PictoBlox.
- Go to the Events palette and add a when flag clicked block into the scripting area. To detect the objects, we need the Object Detection
- Add the Object Detection from the Extension palette.
- Add a turn () video on stage with () % transparency block below the when flag clicked
- Add a () bounding box block from the Object Detection This block will create a bounding box around the object that our system will detect. Select show.
- Add a set detection threshold to () Here the number is the confidence level. We’re going to set it as 0.5.
- Go to the Control palette and add a forever block below the set detection threshold to ()
- Inside the forever block, add an analyse image from () Camera is set as the default source.
- Camera Setting: We would want to use the back camera of the Mobile / Tab. Change it from settings.
- Classifying the Waste: There is no direct way of detecting if an object is biodegradable or non-biodegradable. PictoBlox can detect a range of different objects of which some are biodegradable and some are non-biodegradable. We must tell the code beforehand which waste is of which type. In the script, we can use blocks from the Object Detection palette to detect a particular object, e.g. a banana. We’ll use a banana and a bottle as examples. You can add any number of different objects to your script.
- In the same script, add an if () then block below the analyse image from ()
- Inside the diamond-shaped space, drop an is () detected ? Select banana from the drop-down.
- Now, add display matrix as () blocks from Display palette inside the if arm. Make all the LEDs as GREEN
- Now, we’ll make our system say out loud the type of waste it has detected. For that, we’ll use the Text to Speech
- After adding the Text to Speech extension from the extension palette, add a speak () block under the if arm of the if block and write Biodegradable Waste.
- Repeat steps 11.1 to 11.5 for a bottle and this time, write Non-Biodegradable Waste in the speak () block and make all LEDs BLUE
- Click the green flag to test the script. Show the waste items to the camera and Quarky should display the type of waste.
- Save the file as Waste Classifier.