![]() |
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.
Data Structures | |
class | handle |
variable of this type is a handle to a APRON UI object More... | |
Functions | |
apron_config_begin () | |
this function start the configuration section of the script | |
apron_config_end () | |
this function finish the configuration section of the script | |
sim_pix_source_webcam () | |
use a webcam as the image source when running as simulation | |
sim_pix_source_image (string path) | |
use an image as the image source when running as simulation | |
sim_pix_source_video (string path) | |
use a video as the image source when running as simulation | |
sim_use_error_model (int v) | |
set the level of error model to use in simulation More... | |
host_set_frame_rate (int v) | |
set the desired frame rate More... | |
handle | host_add_display (string text) |
add a display window to the APRON UI More... | |
handle | host_add_display (string text, string palette) |
similar to host_add_display but with a specific palette name More... | |
host_record_display (handle h, string path, int n) | |
save frames received in a display More... | |
handle | host_add_datasheet (string text, int r, int c, enum d) |
add a datasheet to the APRON host More... | |
handle | host_add_slider (string text, int min, int max, int init) |
add a slider to the APRON UI More... | |
handle | host_add_slider (string text, int min, int max, int init, int spi_name, int is_latched) |
host_add_slider with two extra arguments to enable the slider to be created in SPI Host App More... | |
sim_use_error_model | ( | int | v | ) |
set the level of error model to use in simulation
v | level of error model |
Level | Error Included |
---|---|
0 | none |
1 | transfer error and IN error |
2 | soft saturation |
3 | mismatch error |
host_set_frame_rate | ( | int | v | ) |
set the desired frame rate
v | the frame rate |
Note, this only affect the frame trigger. In a loop with frame readout macros ( aout
and dout
), the actual visible frame rate is much lower than the setting because the frame readout take a lot of time.
The following structure can be used to keep the exposure time to be (1/framerate):
handle host_add_display | ( | string | text | ) |
add a display window to the APRON UI
text | name of the display |
Use this function to create a window in APRON UI that can show an image (register array) received from the program. For example,
create a window that can be referred as window_1
.
In the program, a particular register for each of the PEs can be read as a image. For example,
send analogue register C
to window_1
of the APRON hosting UI as an image of 256x256. See also usb_aout.
handle host_add_display | ( | string | text, |
string | palette | ||
) |
similar to host_add_display but with a specific palette name
text | name of the display |
palette | name of the palette |
host_record_display | ( | handle | h, |
string | path, | ||
int | n | ||
) |
save frames received in a display
h | handle of the display |
path | path and filename of the saved image file |
n | maximum number of image saved |
Save each of the frame received in a display as a BMP file. Any folders in the path need to be created manually.
Example Usage:
The following configuration enables the first 100 frames received in window_1
to be saved in the folder "snapshots". The name of the image files are "out_1.bmp" to "out_100.bmp".
handle host_add_datasheet | ( | string | text, |
int | r, | ||
int | c, | ||
enum | d | ||
) |
add a datasheet to the APRON host
text | name of the datasheet |
r | number of rows |
c | number of cols |
d | direction of data to be filled via streaming |
Create a datasheet in the host to store incoming data stream. See also usb_stream_begin .
handle host_add_slider | ( | string | text, |
int | min, | ||
int | max, | ||
int | init | ||
) |
add a slider to the APRON UI
text | text showing on the slider |
min | minimum value of the slider, ranged in [0,255] |
max | maximum value of the slider, ranged in [0,255] |
init | initial value of the slider, ranged in [0,255] |
Use this function to create a slider in APRON UI to send a parameter to the program in both simulation and real hardware. For example,
create a slider that can be referred as slider_1
.
In the program, the value presented on a slider can be obtained and stored in an IPU register. For example,
put the value on slider_1
into ipu register s0
. See also usb_slider.
handle host_add_slider | ( | string | text, |
int | min, | ||
int | max, | ||
int | init, | ||
int | spi_name, | ||
int | is_latched | ||
) |
host_add_slider with two extra arguments to enable the slider to be created in SPI Host App
text | text showing on the slider |
min | minimum value of the slider, ranged in [0,255] |
max | maximum value of the slider, ranged in [0,255] |
init | initial value of the slider, ranged in [0,255] |
spi_name | index of the name string to be displayed in SPI Host App |
is_latched | is the value latched (update only when the handle is released) |
The viable definition of the spi name index:
Macro Definition | Number |
---|---|
SPI_APP_TEXT_NOT_AVAILABLE | 0 |
SPI_APP_TEXT_UNDEFINED | 1 |
SPI_APP_TEXT_SWITCH | 2 |
SPI_APP_TEXT_MODE | 3 |
SPI_APP_TEXT_THRESHOLD_A | 4 |
SPI_APP_TEXT_THRESHOLD_B | 5 |
SPI_APP_TEXT_THRESHOLD_C | 6 |
SPI_APP_TEXT_THRESHOLD_D | 7 |
SPI_APP_TEXT_X | 8 |
SPI_APP_TEXT_Y | 9 |
SPI_APP_TEXT_X_SHIFT | 10 |
SPI_APP_TEXT_Y_SHIFT | 11 |
SPI_APP_TEXT_X_MASK | 12 |
SPI_APP_TEXT_Y_MASK | 13 |
SPI_APP_TEXT_X_MATCH | 14 |
SPI_APP_TEXT_Y_MATCH | 15 |
SPI_APP_TEXT_INPUT_0 | 16 |
SPI_APP_TEXT_INPUT_1 | 17 |
SPI_APP_TEXT_INPUT_2 | 18 |
SPI_APP_TEXT_INPUT_3 | 19 |
SPI_APP_TEXT_ITERATION_I | 20 |
SPI_APP_TEXT_ITERATION_J | 21 |
SPI_APP_TEXT_EXPOSURE | 22 |
SPI_APP_TEXT_DIFFUSION | 23 |
SPI_APP_TEXT_E | 24 |
SPI_APP_TEXT_F | 25 |
SPI_APP_TEXT_G | 26 |
SPI_APP_TEXT_H | 27 |
SPI_APP_TEXT_T | 28 |
SPI_APP_TEXT_U | 29 |
SPI_APP_TEXT_V | 30 |
SPI_APP_TEXT_W | 31 |