![]() |
SCAMP-5c Vision System
1.0.0
An image sensor with a parallel processor on focal plane
|
Go to the source code of this file.
Functions | |
dreg | pro_flood_from_boundary (dreg r1) |
flooding a DREG plane with '1's from the boundary More... | |
dreg | pro_flood_from_source (dreg r1, dreg r2) |
flooding a DREG plane with '1's from the '1's in another DREG plane More... | |
dreg | pro_digital_news (dreg r1, string str) |
acquire a certain DREG of from adjunct PEs More... | |
dreg | pro_diffuse (areg r1, int p1, int p2) |
diffuse a AREG plane More... | |
pro_locate_event (dreg r1, reg o1, reg o2) | |
locate a '1' in a DREG plane, starting from bottom right More... | |
flooding a DREG plane with '1's from the boundary
r1 | the control register |
Flagging: Z.
Used DREG: R0, R1, R2, R3, R4, R12
Starting from the boundary pixels, each pixel that have at least one '1' neighbour will be filled with 1 if the control register of that pixel is 1. This step is repeated hundreds of times asynchronously in less than 20 clock cycles. As a result, after one call of this macro, the result register is usually flooded by '1's except those areas that are closed by '0's in the control register.
Note: the DREG that are used inside this macro cannot be used as the control register. For example, "R1 = pro.flood_from_boundary(R2)" is invalid.
Example Usage:
flooding a DREG plane with '1's from the '1's in another DREG plane
r1 | the control register |
r2 | the source of the flood |
Used DREG: R0, R1, R2, R3, R4, R12
This process is similar to pro_flood_from_boundary. The only difference is that the source of the flood are from the '1's in another DREG plane rather than the boundary.
The traveling distance of the flood will not cover the whole plane. The following image shows the result of a flood sourced by one poxel at (128,128):
To increase the traveling distance, one can use this macro multiple times using the result of a previous flood as the source:
Note: the DREG that are used inside this macro cannot be used as the control register. For example, "R1 = pro.flood_from_source(R2,R3)" is invalid.
Example Usage:
Flooding R1 from coordinates (100,50):
acquire a certain DREG of from adjunct PEs
r1 | the DREG of the adjunct PE |
str | list of directions, can be 'north' 'east' 'west' 'south' |
Flagging: clr Z.
Used DREG: R0, R1, R2, R3, R4
This is the function to achieve the digital NEWS functionality. Unlike the analogue NEWS, this function allows the read of any DREG of a neighbour PE.
Example Usage:
Shift R5 DREG plane to the east:
Shift R5 DREG plane to the north east:
Let THIS.R5 = WEST.R5 OR SOUTH.R5:
locate a '1' in a DREG plane, starting from bottom right
r1 | the DREG plane to be searched |
o1 | ipu register to store the x coordinate |
o2 | ipu register to store the y coordinate |
Used DREG: R0, R1, R2, R3
This function locate a '1' in a DREG plane. The search starts from south east and proceed towards north first. This process is executed asynchronously, which means the distance between the '1' and the start location won't affect the time cost to search.
Example Usage:
Get the coordinates of the first '1' in R5 DREG plane.
A more systematic usage of events scanning can be found in Example 8: Events Scanning.