Recognition Cards

Extension Description
AI to identify pretrained recognition cards like signs, numbers, and other objects.

Introduction

Recognition Cards is a special pre-trained machine learning model created to identify the following recognition cards (Download – Recognition Card – A4 Signs Pictoblox):

Signals

Go

Stop

GoStraight

TurnLeft

TurnRight

UTurn

PedestrianCrossing

CrossRoad

Numbers

Objects

Spades

Diamonds

Clubs

Hearts

Pizza

Hospital

Bomb

Home

Hazel

PizzaSlice

Tree

Tree

John

Accessing Recognition Card in Block Coding

Following is the process to add Recognition Card capability to the PictoBlox Project.

  1. Open PictoBlox and create a new file.
  2. Select the coding environment as Block Coding.
  3. Next, click on the Add Extension button and add the Recognition Card extension.
  4. The Recognition Card models will be downloaded, which may take a few seconds to load.
    Downloading Models
  5. Once downloaded you will get a message saying “Model loaded successfully”.
  6. You can find the Recognition Card blocks available in the project.

Accessing Recognition Card in Python Coding

Following is the process to add Recognition Card capability to the PictoBlox Project.

  1. Open PictoBlox and create a new file.
  2. Select the coding environment as Python Coding.
  3. Next, click on the Add Modules/Libraries button and add the Recognition Card extension.
  4. To access the library functions, you have to add the object declaration.
    cards = RecognitionCards()

Python Functions

The function is used to control the state of the camera.
Syntax: video(video_state = “on”, transparency = 1)
The function enables the automatic display of the box on object detection on the stage.
Syntax: enablebox()
The function disables the automatic display of the box on object detection on the stage.
Syntax: disablebox()
This function is used to set the threshold for the confidence (accuracy) of object detection, 0 being low confidence and 1 being high confidence.
Syntax: setthreshold(threshold = 0.5)
This function is used to analyze the image received as input from the camera, for objects.
Syntax: analysecamera()
This function is used to analyze the image received as input from the stage, for objects.
Syntax: analysestage()
This function returns the total number of objects detected in the camera feed or the stage.
Syntax: count()
This function is used to get the class name of the analyzed object.
Syntax: classname(object = 1)
This function returns the x position of the object detected. You can specify the object for which the value is needed. The position is mapped with the stage coordinates.
Syntax: x(object = 1)
This function returns the y position of the object detected. You can specify the object for which the value is needed. The position is mapped with the stage coordinates.
Syntax: y(object = 1)
This function returns the width of the object detected. You can specify the object for which the value is needed. The position is mapped with the stage coordinates.
Syntax: width(object = 1)
This function returns the height of the object detected. You can specify the object for which the value is needed. The position is mapped with the stage coordinates.
Syntax: height(object = 1)
This function is used to get the confidence (accuracy) of object detection, 0 being low confidence and 1 being high confidence.
Syntax: confidence(object = 1)
The function returns whether the specified signal is detected in the analysis or not.
Syntax: issignaldetected(signal_name = “Go”)
The function returns the specified parameter for the specified signal detected.
Syntax: getsignaldetail(signal_name = “Go”, parameter_value = 1)
The function returns whether the specified number card (0-9) is detected in the analysis or not.
Syntax: isnumberdetected(card_number = 1)
The function returns the specified parameter for the specified number card detected.
Syntax: getnumberdetail(card_number = 1, parameter_value = 1)
The function returns whether the specified object card is detected in the analysis or not.
Syntax: isobjectdetected(object_name = “Pizza”)
The function returns the specified parameter for the specified object detected.
Syntax: getobjectdetail(object_name = “Pizza”, parameter_value = 1)
All articles loaded
No more articles to load

Python Coding Examples

PictoBlox Blocks

The turn () video on stage with () % transparency block controls the control the camera feed on the stage.
The block enables or disables the automatic display of the box on object detection on the stage. This is useful when you want to see if the object detection happens during the analysis or not.
This block is used to set the threshold for the confidence (accuracy) of object detection, 0 being low confidence and 1 being high confidence. With the threshold value, you can set the level of confidence required for object detection.
The block analyses the image and saves the face information locally, which can be accessed using other blocks.
Once you have analyzed the images, you can use the get # of objects detected block to get the number of objects recognized in the image.
The () of object () block reports the following attributes of the object: class, x position, y position, width, height, and confidence.
The block returns the class label name.
The block returns whether the specified signal is detected in the analysis or not.
The block returns the specified parameter for the specified signal detected: class, x position, y position, width, height, and confidence.
The block returns whether the specified number card (0-9) is detected in the analysis or not.
The block returns the specified parameter for the specified number card detected.
The block returns whether the specified object card is detected in the analysis or not.
The block returns the specified parameter for the specified object detected.
All articles loaded
No more articles to load

Block Coding Examples

Table of Contents