SCAMP-5c Vision System  1.0.0
An image sensor with a parallel processor on focal plane
Example Guideline


Example Files

There are 12 examples in total. Each of the example is placed in a separate folder. However, they share the same host template and bit file that is located outside their own folders. Therefore, if a copy of any example is wanted, one need to make sure the associated host template and bit file are sorted out correctly in the configuration section of the source code.


Example Guideline

Example 1: Simple Camera

This program simply capture the image from the photo transistor and send it back to the PC host. It uses the macro pe_rpix to capture both the image in both full-range format and half-range format.

Example 2: Thresholding

This program applies a thresholding process to the image, which yield a boolean image. This demonstates the use of where and some basic AREG arithmetics using the macros in PE Analogue Operation Macros. This particular example, the boolean image is stored using AREG but DREG can also be used. The threshold applied is read from the PC host. The user can dynamically modify this threshold by moving a slider in the APRON GUI.

In this program, the exposure time is stablized by a double frame trigger mechanism (see ipu_wait_frame_trigger), which is often used when the frame loop contains one or more usb image readout (e.g. usb_aout) and the frame time is thus overwhelmed by these communciations.

Example 3: Motion Detection

This program subtract a just-captured image with the previous image, which yields the difference between the two images of different times. In observation, the result image only shows the pixels that are moving in the scene.

Example 4: AREG Neighbour Access

This program used the neighbour accessing macros such as pe_west to copy an analogue register of a neighbouring PE. When such process is iterated many times using a loop, it can produce a image shifted along one or two directions accross the plane. Analogue operation errors can also be observed in this example when the number of iterations is high.

Example 5: IPU Conditional Branching

In this example, both type of conditional branching is used: a) jump when last IPU instruction produced a result of 0, and b) jump when last IPU instruction produced an overflow or underflow. More details can be found in _jump

Example 6: DREG Flooding

This example demonstrate the aysnchronous flooding capability of the SCAMP-5 vision chip. A detailed description of the flooding macro can be found in pro_flood_from_boundary. To obtain a apparent result in this example, a white paper with a few closed shape (e.g. black circles) should be placed in front of the camera. And the threshold needs to be properly adjusted.

Example 7: Aysnchronous Diffusion

This example demonstrate the aysnchronous diffusion capability using the macro pro_diffuse.

Example 8: Events Scanning

This example uses a few functionalities in combination to demonstrate the events scanning capbility:

  1. A few '1' pixels are manually drawn on a DREG plane (using ipu_pixel_set) which is originally all '0's.
  2. The macro pro_locate_event is used to find the coordinates of one of these pixels.
  3. The coordinates is sent to PC using a usb data stream.
  4. The found pixel is then erased using digital masking operations.
  5. Step 2 – 4 are iterated, so pro_locate_event will find these pixels one by one.

Example 9: DREG Neighbour Access

Similar to Example 4: AREG Neighbour Access, this example achieves shifting of a DREG plane using the digital version of the neighbour accessing capability.

Example 10: DREG Selecting

This example use ipu_pixel_select to generate patterns in a DREG plane where the x-y coordinates of selected pixel meet a specific rule. Because the DREG plane can be used to flag a PE, making such patterns can be used to manually select a portion of PEs to operate.

Example 11: Analogue Regional Summation

This example sum the analogue register values in a region of an AREG plane. Note, the ipu_global_sum can only sum an entire AREG plane. To sum only a specific region, one first need to mask the PEs using the DREG selecting and shifting macros.

Example 12: Simulation Using A Video or Image

When this example is executed as simulation, it uses a video as the image source so no webcam nor SCAMP-5c is required. This maybe also useful when the image processing algorithm need to be applied on a scenario that is only replayable through a video.

Example 13: SPI Communication