• Home
  • Tutorials
  • Brand Detection using the Artificial Intelligence Extension of PictoBlox

Brand Detection using the Artificial Intelligence Extension of PictoBlox

Brand Recognition Using PictoBlox
About This Tutorial
In this tutorial learn how to detect various brands in images using the Artificial Intelligence of PictoBlox.
Tutorial Info

Introduction

Currently, there are millions of brands established by humans and it is very difficult for us to stay updated with so many new brands launched daily, that is why we rely on tools like google lens to find us information on the brands in front of us. The main give out of a brand is it’s unique and we can recognize and differentiate between them using it, in the near future. We will be having robots and AI working for us, bringing us food, doing shopping for us, etc. During those times brand recognition is going to be an essential part of it. Keeping it in mind, with the help of new Artificial Intelligence extension in PictoBlox we can easily recognize brands, celebrities, and objects with a blink of an eye.

Let us dive into the world of AI.
Brand Recognition Using PictoBlox

Working with PictoBlox

As the title of the tutorial itself suggests, we will be making this project in PictoBlox- a scratch based graphical programming software. Follow these steps and make your own expression recognition machine.

Setting up the Software

As you like to be up-to-date, so does the software. To use the face detection extension of PictoBlox, you need to update PictoBlox to its latest version. You can download it from here.

Adding Up the Extension

Now that we have the latest version, let’s add the Face Recognition.

  1. First, select the board as evive.
  2. Next, click on the add extension button
  3. Once clicked you will be able to see all the extension available,
  4. Select Artificial IntelligenceArtificial Intelligence Extension

You will notice new blocks are being added under the same extension

Please remember that this extension requires an Internet connection in order to process images. Also, wait till models get loaded it might take a few moments to load.

What will you need

  1. A pc/laptop.
  2. PictoBlox.
  3. Internet connection.
  4. A sample image(You can download the sample image from here).

Writing the Script in PictoBlox

Now, that everything is ready. let’s start writing the script.

Adding sprite

Before we begin, let’s add our sprite into the project first.

  1. Click on add sprite button
  2. Add the square box spritesquare box sprite
  3. You can delete The Tobi sprit, simply right click on it and select delete from the drop-down.

Setting the Stage

Now select the Square box sprite to write the script.

Let’s set up the Stage. Click on the upload backdrop option and select the baseball image which you have downloaded and place it on the stage.

Recognizing the Image on the Stage

  1. Next, select the Square box sprite, and let’s start making the script.
  2. First, drag and drop the when flag clicked hat block to execute the program every time the green flag is clicked.
  3. Next, let’s process the imagery stage. Add the recognize () in image from () the block below the when the flag is clicked block. Select Image features and Backdrop from the first and the second dropdown respectively. Brand Detection Script
    This block helps to recognize image features, face details, recognize handwritten text, and printed text from either a backdrop or stage or costume of the sprite.
  4. Now, let’s create a variable to store the brand count. Click on the Make a variable button inside the Variables palette. Make a variable with the name “Brand” and click on ok.
  5. Add the set variable () as () block and set Brand as 0.Brand Detection Script
  6. Now, as we need to detect all the brands, add a repeat until () block. Drag and drop an equal to block from the Operator Palette inside the hexagonal space of the repeat until block.
  7. Now to acquire the no of brands from the image use recognize () count block and select brand from the drop-down and place it inside the first space of the equal to block and place the variable Brand into the second empty space. Brand Detection ScriptThe block recognize () count contains information on the number of brands that are detected from the image that has been processed.Brand Detection Script

Displaying the Brands Recognized

  1. Next, let’s display the recognized brands. To display the properties of all detected brands one by one, we need to increment our variable by 1 each time we execute our control logic. Thus place change () to () block into the repeat until block.Brand Detection Script
  2. Next, set the size of the square box to accommodate the brand image detected, drag and drop the set size to () % block from Looks palette. To detect the width, add the recognize () () () block inside it and choose brand from the first drop-down. Place value of Brand variable in the white space and select width from the drop-down.Brand Detection Script This block contains all the information like x,y position, width, height class of the given brand.Brand Detection Script
  3. Then we need to move our Square box to the location of the brand, thus add go to x() y() block from Motion palette. Next, insert recognized () () () block and choose x position and y position from the respective blocks to obtain the X value and Y value of the brand respectively.Brand Detection Script
  4. Finally, to display the name of recognized brand, get the say () for () seconds block from the Looks palette.Brand Detection ScriptPlace recognize () () name block into the say block.Brand Detection Script

With this the script is ready.Brand Detection Script

You can download the script from here.

Click on the flag button and let the script work its magic on image,

You will get recognize two brands that are detected from this particular image one from the logo of Mcdonalds and the other from the name Mcdonalds.Brand Recognition Using PictoBlox

Now if you want to learn more about how to recognize brands, celebrities, and objects take a look inside our artificial intelligence and machine learning for kids course, you will also learn to recognize multiple brands simultaneously and also from the camera/stage in real-time and much more. To know more about the course click here.

[tutorialRelatedProjects]
Share this Tutorial
Share on facebook
Facebook
Share on twitter
Twitter
Share on google
Google+
Share on pinterest
Pinterest
Share on reddit
Reddit
Share on print
Print
Featured Projects
All articles loaded
No more articles to load

Leave a Reply

Close Menu
×

Cart

Become AI-ready for the FUTURE
Learn Artificial Intelligence and Machine Learning online with us on the FREE webinar!
x