Table of Contents

analysecamera()

Function Definition: analysecamera()

Parameters

Description

This function is used to analyze the image received as input from the camera, for the feature.

By analyzing the images for image features, you can recognize the following things:

  1. Brands: Brand detection uses a database of thousands of global logos to identify commercial brands in images. The Computer Vision service detects if there are brand logos in a given image; if so, it returns the brand name; else, it returns NULL.
    Brands
  2. Celebrity: Celebrity detection uses a database to identify celebrities in images. The Computer Vision service detects if there is a celebrity in a given image; if so, it returns their name; else, it returns NULL.
    Celebrity
  3. Objects: Computer vision detects if there are objects in a given image; if so, it returns their name; else, it returns NULL.
    Object Detection
  4. Landmarks: Landmark detection uses a database of thousands of global landmarks to identify them in images, e.g., the Taj Mahal.
    Taj Mahal 2
  5. Image Tags: Computer vision returns the taxonomy-based categories detected in an image. Computer Vision can categorize an image broadly or specifically according to the 86 categories given in the following diagram:
    Category Tags
  6. Image Description: Human-readable sentence that describes the contents of the image.

Alert: This block processes the image input and updates the values in the other functions hence it needs to be put inside loops while making projects.

Example

Learn how to control the Mecanum using PictoBlox with keyboard inputs. Make the Mecanum move forward, backward, turn left, and turn right along with unique lateral motions!

In this activity, we will make the computer program that controls the Mecanum Robot. It’s like a remote-control car. You can press different keys on the keyboard to make the Mecanum move forward, backward, left and right.

The Quarky Mecanum Wheel Robot is a type of robot that uses a special type of wheel to move. The wheel is made of four rollers mounted at 45-degree angles to the wheel‘s hub. Each roller has its own motor and can spin in either direction. This allows the wheel to move in any direction, making it an ideal choice for navigating around obstacles and tight spaces. The mecanum wheel robot can also turn on the spot, allowing it to make sharp turns without having to reverse direction.

 

Coding Steps

Follow the steps:

  1. Open a new project in PictoBlox.
  2. Connect Quarky to PictoBlox.
  3. Click on the Add Extension button and add the Quarky Mecanum extension.
  4. Now we will first initialize the Mecanum robots and the servos before starting the main code.
  5. The main code will consist nested if-else conditions that will check specific conditions on which key is pressed, and will react accordingly. We will use the arrow keys for basic movements (Forward, Backward, Left Right) and the keys “a” for lateral left movement and “d” for lateral right movement.

Code

Output

Forward-Backward Motion:

Lateral Right-Left Motion:

Circular Right-Left Motion:

Read More
All articles loaded
No more articles to load