LogoLogo
TRIK StudioTRIKLego EV3Lego NXT
English
English
  • TRIK help
  • TRIK Studio
    • About TRIK Studio
      • How to find out the version of TRIK Studio
    • Getting started and creating a project
    • TRIK Studio interface
      • TRIK Studio main menu
      • Working with graphs
      • How to open robot settings
      • How to change TRIK Studio interface language
    • TRIK Studio settings
    • 2D model
      • 2D model tuning
      • Adding restrictions to the 2D Model
        • Restrictions setting examples
    • Visual programming
      • Adding and removing blocks
      • Common blocks
      • Links between blocks
      • Syntax of expressions in the blocks
        • TRIK Studio language types
          • Array
        • TRIK Studio language tokens
        • TRIK Studio language operators
        • Constants
        • Sensor variables
        • Built-in functions
      • Property editing
      • Subprograms
    • Textual programming
    • Exercises
    • External tools
      • PuTTY
      • WinSCP
    • TRIK Studio shortcuts
    • Antivirus conflicts
      • Avast antivirus blocks TRIK Studio. What to do?
  • TRIK Studio Junior
    • About TRIK Studio Junior
      • How to find out the version of TRIK Studio Junior
    • Getting started and creating a project in TRIK Studio Junior
    • TRIK Studio Junior interface
      • How do I replace the "Character movement" image?
    • TRIK Studio Junior settings
    • Visual programming in TRIK Studio Junior
      • Adding and removing blocks in TRIK Studio Junior
      • Blocks in TRIK Studio Junior
      • Links between blocks in TRIK Studio Junior
      • Syntax of expressions in the blocks in TRIK Studio Junior
      • Property editing in TRIK Studio Junior
      • Subprograms in TRIK Studio Junior
    • Exercises in TRIK Studio Junior
  • INTEGRATIONS
    • PyCharm
      • Running a 2D model in TRIK Studio from PyCharm
    • Sublime Text
      • Running a 2D model in TRIK Studio from Sublime Text
      • Uploading programs to several TRIK robots from Sublime Text
    • VSCode
      • Running a 2D model in TRIK Studio from VSCode
      • Uploading programs to several TRIK robots from VSCode
  • TRIK controller
    • About the TRIK controller
      • Screenshot of the TRIK controller screen
    • TRIK controller firmware
      • How to find out the firmware version of the TRIK controller?
    • TRIK controller menu
    • Connecting to the TRIK controller via Wi-Fi
      • Connecting the TRIK controller to a computer and smartphone
      • Connecting the TRIK controller to TRIK Studio
      • Interaction of TRIK controllers
        • An example of solving a problem on the interaction of two robots
    • Connecting to the TRIK controller using UART
    • Launching and uploading programs to the TRIK controller
    • Programming TRIK with the visual programming language
      • TRIK specific blocks
      • Sensory variables for the TRIK controller
    • TRIK controller programming in Python and JavaScript
      • Object «brick»
        • Class «accelerometer»
        • Class «battery»
        • Class «colorSensor»
        • Class «display»
        • Class «encoder»
        • Class «gyroscope»
        • Class «keys»
        • Class «led»
        • Class «lineSensor»
        • Class «motor»
        • Class «objectSensor»
        • Class «sensor»
      • Object «script»
      • Object «mailbox»
      • Object «gamepad»
      • Object «Threading»
      • Function getPhoto
      • Function include
    • TRIK controller web interface
    • Connecting devices to TRIK and working with them
      • Connecting and working with the video module
      • Testing devices connected to the TRIK controller
      • Configuring the operation of a USB camera with a TRIK controller
      • Capturing images with TRIK camera and using them in TRIK Studio
      • Working with battery and charger
  • LEGO EV3 Controller
    • About LEGO EV3
    • Connecting a LEGO EV3 Controller to TRIK Studio
    • LEGO EV3 specific blocks
    • Sensory Variables for the LEGO EV3 Controller
    • Launching and uploading programs to the LEGO EV3
  • LEGO NXT Controller
    • About LEGO NXT
    • LEGO NXT Controller Firmware
    • Connecting a LEGO NXT Controller to TRIK Studio
    • LEGO NXT specific blocks
    • Sensory Variables for the LEGO NXT Controller
    • LEGO NXT C Programming
    • Launching and uploading programs to the LEGO NXT
  • Quadcopter Geoscan Pioneer
    • About quadcopter Geoscan Pioneer
    • Geoscan Pioneer specific blocks
  • TRIK Gamepad
    • About TRIK Gamepad
      • TRIK Gamepad App
      • TRIK Gamepad Utility
    • Robot control from the remote control
  • Feedback
    • Actions in case of TRIK Studio or TRIK controller malfunction
    • Ask a Question
    • trikset.com
Powered by GitBook
On this page
  • Shooting images on the TRIK controller
  • Uploading images via the TRIK web interface
  • Using images in TRIK Studio
  • Example program

Was this helpful?

Export as PDF
  1. TRIK controller
  2. Connecting devices to TRIK and working with them

Capturing images with TRIK camera and using them in TRIK Studio

PreviousConfiguring the operation of a USB camera with a TRIK controllerNextWorking with battery and charger

Last updated 4 years ago

Was this helpful?

This article is automatically translated from Russian by Google Translator.

Warning! This functionality is in test mode. To use it you need to install a of the firmware. We will be glad to get your feedback and suggestions about this functionality. Write to with a note "Test of working with images in TRIK Studio".

Developing the algorithm under unchanged conditions allows to debug and test it faster, as well as to evaluate and compare the quality of the algorithm and its modifications. This is especially important for computer vision algorithms, when any, even small, camera movement significantly changes the shooting conditions and, as a result, the captured image.

This article will describe how to capture images on the TRIK controller camera, upload this data to a computer and use it in TRIK Studio to develop and debug computer vision algorithms.

ARTag 5x5 datasets

ARTag marker recognition programs can be improved and tested in TRIK Studio on the (see step 3). It includes photos of ARTag 5x5 markers from different angles on a standard TRIK controller camera. The name of each folder in the dataset is the number that is encoded on the ARTag markers that lie in that folder.

Shooting images on the TRIK controller

Warning! Connect the camera to the "video2" port before turning on the controller.

1. From the controller menu, selectTesting → Camera.

2. The image taken by the camera will be displayed on the screen. It will be saved to the internal memory of the controller.

To take more photos, press the "Exit" (cross) button on the controller and select the Camera menu item again.

Uploading images via the TRIK web interface

1. Connect the TRIK controller to the computer.

2. Enter the IP address of the controller in the address bar of your browser. The TRIK web interface opens.

3. Go to the "Images" tab and click "Download all" to download the image archive.

4. Go to the folder with the downloaded archive and unzip it. Now you can select the images that are best suited for developing and testing the current algorithm.

Using images in TRIK Studio

1. Open the Robot settings in TRIK Studio.

2. In the window that opens, select Robot Model → 2D Model and type in the path to the previously loaded images.

3. Now when you call getPhoto, the images from the specified folder will be loaded sequentially.

Example program

An example of a program that sequentially displays images loaded from a specified folder with a 2-second delay.

var main = function()
{   
    var msCount = 2000;
    for (var i = 0; i< 5; i++) { // Display 5 images sequentially on the controller screen   	 
   	 brick.display().show(getPhoto(), 160, 120, "rgb32");
   	 brick.display().redraw();
   	 script.wait(msCount);   	 
    } 
	return;
}

2. Run the code in debug mode, using the 2D model as the program execution mode. The controller will display images sequentially on the display.

Don't forget to use the functions for drawing graphical primitives (, , , etc.) and the function to speed up the process of developing and debugging image processing algorithms.

1. the file to your computer or create a new project and copy the code:

Connecting the TRIK controller to a computer and smartphone
TRIK controller web interface
How to open robot settings
Function getPhoto
Download
test version
support
dataset
drawRect
drawLine
drawPoint
show
An example of the resulting image with the ARTag marker