Recognition Cards
Extension Description
AI to identify pretrained recognition cards like signs, numbers, and other objects.
- Available in: Block Coding, Python Coding
- Mode: Stage Mode
- WiFi Required: No
- Compatible Hardware in Block Coding: evive, Quarky, Arduino Uno, Arduino Mega, Arduino Nano, ESP32, T-Watch, Boffin, micro:bit, TECbits, LEGO EV3, LEGO Boost, LEGO WeDo 2.0, Go DFA, None
- Compatible Hardware in Python: Quarky, None
- Object Declaration in Python: cards = RecognitionCards()
- Extension Catergory: Artificial Intelligence
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
TurnRight
UTurn
PedestrianCrossing
CrossRoad
Numbers
Objects
Spades
Diamonds
Clubs
Hearts
Pizza
Hospital
Bomb
Home
Hazel
PizzaSlice
Tree
John
Accessing Recognition Card in Block Coding
Following is the process to add Recognition Card capability to the PictoBlox Project.
- Open PictoBlox and create a new file.
- Select the coding environment as Block Coding.
- Next, click on the Add Extension button and add the Recognition Card extension.
- The Recognition Card models will be downloaded, which may take a few seconds to load.
- Once downloaded you will get a message saying “Model loaded successfully”.
- 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.
- Open PictoBlox and create a new file.
- Select the coding environment as Python Coding.
- Next, click on the Add Modules/Libraries button and add the Recognition Card extension.
- To access the library functions, you have to add the object declaration.
cards = RecognitionCards()
Read More
PictoBlox Blocks
All articles loaded
No more articles to load
Block Coding Examples
All articles loaded
No more articles to load
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
All articles loaded
No more articles to load
Table of Contents