7.8. Image Analyzer

This chapter describes the Code Composer Studio (CCS) Image Analyzer.

7.8.1. Overview

An advanced image visualization tool is available in CCS. It can display arrays of bitmapped data in an image viewport. The arrays of bitmaps are stored in a device’s memory and, by reading them through a Debug Probe connection and performing post processing on the host PC, it can show images in various formats (RGB, Bayer, Bitonal, YUV), packed/unpacked, etc.

The following types of images can be configured:

  • YUV (Packed, Planar, Semi-Planar)
    • 4:2:2
    • 4:2:0
    • 4:4:4
    • 4:1:1
  • Bayer (Packed)
  • Bitonal
  • RGB (Packed, Planar, Semi-Planar)

The supported data formats:

  • Datapath size: 8, 16 and 32 bits.
  • Packed or Planar formats.
  • Masks and pixel grouping can be set to each color channel.

The data can be updated in several ways:

  • Refresh. Update the data when this button is pressed. Depending on the device and mode of operation, the data will be updated only when the device is halted.

  • Continuous Refresh. Update the data continuously at a rate defined by CCS Properties (no faster than 100ms).

  • Refresh on halt. Update the data when the device is halted.

  • Breakpoints can be set to automatically update the data when reached.

    • Update View
    • Refresh All Windows
    • Target Halt and Refresh

Note

Image analyzer can be used with either an image on the target device or on the local host.

From the main menu click on Tools → Image Analyzer. Both an Image and a Properties views will be opened side by side.

After setting the image source and properties, click on the Refresh button in the Image view toolbar. The Image Analyzer fetches the data from the file or the target memory and perfors the processing.

7.8.2. Image Analyzer properties

7.8.2.1. General

  • Title
  • Background Color
  • Image Format: RGB, Bayer, YUV, Bitonal

7.8.2.2. RGB

  • Number of pixels per line
  • Number of lines
  • Data format
  • Pixel stride (bytes)
  • Red mask
  • Green mask
  • Blue mask
  • Alpha mask (if any)
  • Line stride (bytes)

7.8.2.3. Bayer

  • Number of pixels per line
  • Number of lines
  • Line order
  • Pixel stride (bytes)
  • Component mask
  • Line stride (bytes)

7.8.2.4. YUV

  • Number of pixels per line

  • Number of lines

  • Data format: Planar or Packed

  • Resolution: 4:4:4, 4:2:2, 4:2:0, or 4:1:1

  • YUV order: for Packed formats

  • Y Pixel stride (bytes): The number of bytes to skip to get the valueof the Y component for the next pixel. Typical values:

    • Planar : 1 byte
    • Packed 4:4:4 : 3 bytes
    • Packed 4:2:2 or 4:2:0 : 2 bytes
  • Y mask: Image Analyzer reads packets of bytes of the size specified in Y Pixel stride. The byte order of the packets is Big Endian. Y mask specifies which of the bits in the packet represent the value of the Y component. Typical values:

    • Planar : 0xFF
    • Packed 4:4:4 : 0xFF0000
    • Packed 4:2:2 or 4:2:0 : 0xFF00
  • Y Line stride (bytes): Only used for Planar formats. The number of bytes to skip to get to the first pixel of the next line (counting from the first pixel of the current line, i.e. (Number of pixels per line) x (number of bytes per pixel). This is typically the same as the Number of pixels per line.

  • U Pixel stride (bytes): The number of bytes to skip to get the value of the U component for the next pixel. Typical values:

    • Planar : 1 byte
    • Packed 4:4:4 : 3 bytes
    • Packed 4:2:2 or 4:2:0 : 4 bytes
  • U mask: Image Analyzer reads packets of bytes of the size specified in U Pixel stride. The byte order of the packets is Big Endian. U mask specifies which of the bits in the packet represent the value of the U component. Typical values:

    • Planar : 0xFF
    • Packed 4:4:4 : 0xFF0000
    • Packed 4:2:2 or 4:2:0 : 0xFF000000
  • U Line stride (bytes): Only used for Planar formats. The number of bytes to skip to get to the first pixel of the next line (counting from the first pixel of the current line, i.e. (Number of pixels per line) x (number of bytes per pixel). Typical values:

    • 4:4:4 : Number of pixels per line
    • 4:2:2 or 4:2:0 : (Number of pixels per line) / 2
    • 4:1:1 : (Number of pixels per line) / 4
  • V Pixel stride (bytes): The number of bytes to skip to get the value of the V component for the next pixel. Typical values:

    • Planar : 1 byte
    • Packed 4:4:4 : 3 bytes
    • Packed 4:2:2 or 4:2:0 : 4 bytes
  • V mask: Image Analyzer reads packets of bytes of the size specified in V Pixel stride. The byte order of the packets is Big Endian. V mask specifies which of the bits in the packet represent the value of the V component. Typical values:

    • Planar : 0xFF
    • Packed 4:4:4 : 0xFF0000
    • Packed 4:2:2 or 4:2:0 : 0xFF000000
  • V Line stride (bytes): Only used for Planar formats. The number of bytes to skip to get to the first pixel of the next line (counting from the first pixel of the current line, i.e. (Number of pixels per line) x (number of bytes per pixel). Typical values:

    • 4:4:4 : Number of pixels per line
    • 4:2:2 or 4:2:0 : (Number of pixels per line) / 2
    • 4:1:1 : (Number of pixels per line) / 4
  • Alpha Pixel stride (bytes): The number of bytes to skip to get the value of the Alpha component for the next pixel. This is optional. If your image doesn’t have any Alpha component set this to 0.

  • Alpha mask: Image Analyzer reads packets of bytes of the size specified in Alpha Pixel stride. The byte order of the packets is BigEndian. Alpha mask specifies which of the bits in the packet represent the value of the Alpha component. This is optional. If your image doesn’t have any Alpha component set this to 0.

  • Alpha Line stride (bytes): Only used for Planar formats. The number of bytes to skip to get to the first pixel of the next line (counting from the first pixel of the current line), i.e. (Number of pixels perline) x (number of bytes per pixel). This is typically the same as the Number of pixels per line. This is optional. If your image doesn’t have any Alpha component set this to 0.

  • Line stride: Only used for Packed formats. The number of bytes to skip to get to the first pixel of the next line (counting from the first pixel of the current line), i.e. (Number of pixels per line) x (number of bytes per pixel). Typical values are Number of pixels per line) x (YPixel stride).

7.8.2.5. Bitonal

  • Foreground color
  • Number of pixels per line
  • Number of lines
  • Pixel order

7.8.2.6. Source

  • Image Source: Connected Device, File
  • Start address
  • Filename
  • Read data as
  • File Format (YUV only): Single File, Single File with CustomOffsets, Multiple Files
  • Y Offset (bytes)
  • U Offset (bytes)
  • V Offset (bytes)
  • Alpha Offset (bytes)
  • Y Filename
  • U Filename
  • V Filename
  • Alpha Filename

7.8.3. Troubleshooting

7.8.3.1. Data considerations

Given the Image Analyzer tool is able to work with data in several different types of data arrangments, it is mandatory to keep close track of how the pixels are actually formatted in the device memory for a proper data plot.

A very common scenario is to have all color masks set to 0, which shows a completely blank image on the canvas. Also, wrong color masks show the image correctly but with distorted colors.

Another very common mistake is to use a different encoding, which shows a completely corrupted image.

Note

The Image Analyzer only displays bitmapped images. It does not perform decoding of compressed images in popular file formats such as .GIF, .JPG, .PNG, .TIFF, etc.