![]() |
SK91USB3-LX
1.2.0
|
Describes the use of thresholding (not correctly implemented) More...
Functions | |
int | SK_GRABTHRESHOLDMODE (int CamID, unsigned short *pData, size_t lines, int subpixel, int noisesuppress, size_t iTimeOutMs, bool noWait, int FrameSync, int LineSyncMode) |
Grabbing in Threshold operating mode. More... | |
int | SK_GRABTHRESHOLDCONTINUOUS (int CamID, int iLinesPerBlock, int nMaxTransitions, int subpixel, int noisesuppress, bool FrameSync, int LineSyncMode) |
Continuous grabbing in Threshold operating mode. More... | |
int | SK_GETTRANSITIONS (int CamID, unsigned short **pTransitions, size_t *nTransitions, size_t timeoutMS) |
Returns the pointer to currently filled buffer. More... | |
int | SK_SETTHRESHOLDMODE (int CamID, bool ON, bool subPixel) |
Activates and deactivates the threshold mode. More... | |
int | SK_GETTHRESHOLDSUBPIXELFACTOR (int CamID) |
Returns the subpixel factor in threshold operating mode. More... | |
int | SK_SETTHRESHOLDLEVEL (int CamID, int Threshold) |
Set the threshold level. More... | |
int | SK_GETTHRESHOLDLEVEL (int CamID) |
Returns the current threshold level of the camera. More... | |
int | SK_SETTHRESHOLDNOISEFILTER (int CamID, int nFilter) |
Set a filter for noise reduction in thresholding. More... | |
int | SK_GETTHRESHOLDNOISEFILTER (int CamID) |
Get the status for the filter for noise reduction. More... | |
int | SK_GETNROFTRANSITIONS (int CamID) |
Returns the number of transitions of the camera. More... | |
Describes the use of thresholding (not correctly implemented)
The Threshold operating mode is an pre-processing inside the line scan camera. It is an alternative operating mode to the acquistion of grayscaled images. The result of a grab is an array of pixel addresses of the transitions at a programmable intensity threshold. The calculation of distances between the transitions is possible by masking and subtraction the data very simple and efficient. The Threshold operating mode is predestined for edge tracking, position check, measuring of object width, diameters, gap width, or particle counting. Useful parameters for Thresholding are the noise suppression to ignore very small transition spikes, and sub-pixel mode for increasing the resolution of transition positions.
Data format without subpixel: Format: 16 bit word Bit 0...13: 14 bit pixel address of a transition or of the line end Bit 14: 0= transition from High to Low 1= transition from Low to High Bit 15: 1= end of line code (e.g. 0x8000 = eol)
Data format with subpixel (sensors up to 2048 pixel): Format: 16 bit word Bit 0...2: 3 bit subpixel resolution Bit 3...13: 11 bit pixel address of a transition (limited up to 2048 pixels) Bit 14: 0= transition from High to Low 1= transition from Low to High Bit 15: 1= end of line code
Data format with subpixel (sensors > 2048 pixel): Format: 32 bit unsigned integer Lower word: Bit 0...7: 8 bit subpixel resolution Upper word: Bit 15...29: 14 bit pixel address of a transition Bit 30: 0= transition from High to Low 1= transition from Low to High Bit 31: 1= end of line code
The alignment is lower word - upper word.
int SK_GETNROFTRANSITIONS | ( | int | CamID | ) |
Returns the number of transitions of the camera.
CamID | id of camera from 0 ... n - 1, 0 = 1st camera |
int SK_GETTHRESHOLDLEVEL | ( | int | CamID | ) |
Returns the current threshold level of the camera.
CamID | id of camera from 0 ... n - 1, 0 = 1st camera |
int SK_GETTHRESHOLDNOISEFILTER | ( | int | CamID | ) |
Get the status for the filter for noise reduction.
CamID | id of camera from 0 ... n - 1, 0 = 1st camera |
int SK_GETTHRESHOLDSUBPIXELFACTOR | ( | int | CamID | ) |
Returns the subpixel factor in threshold operating mode.
CamID | id of camera from 0 ... n - 1, 0 = 1st camera |
int SK_GETTRANSITIONS | ( | int | CamID, |
unsigned short ** | pTransitions, | ||
size_t * | nTransitions, | ||
size_t | timeoutMS | ||
) |
Returns the pointer to currently filled buffer.
This function gives access to current array of transitions, which were written in a buffer of the queue.
pTransitions
.CamID | id of camera from 0 ... n - 1, 0 = 1st camera |
pTransitions | pointer to pointer of the buffer with last filled buffer |
nTransitions | number of transisitons |
timeoutMS | timeout in milliseconds |
int SK_GRABTHRESHOLDCONTINUOUS | ( | int | CamID, |
int | iLinesPerBlock, | ||
int | nMaxTransitions, | ||
int | subpixel, | ||
int | noisesuppress, | ||
bool | FrameSync, | ||
int | LineSyncMode | ||
) |
Continuous grabbing in Threshold operating mode.
Activates Threshold operating mode and starts the continuous grabbing of transitions in into an internal buffer queue
CamID | id of camera from 0 ... n - 1, 0 = 1st camera |
iLinesPerBlock | it is the base for internal calculation of the buffer queue size |
nMaxTransitions | data transfer limit per block |
subpixel | provides a higher resolution of transition positions |
noisesuppress | ignores very smal transition spikes |
FrameSync | -1 = no change, 1 = wait for FrameSync trigger, 0 = FrameSync trigger off |
LineSyncMode | -1 = no change, 0 = Free Run, 1 = Line Start, 4 = Exporsure Start, 5 = Exposure Control |
int SK_GRABTHRESHOLDMODE | ( | int | CamID, |
unsigned short * | pData, | ||
size_t | lines, | ||
int | subpixel, | ||
int | noisesuppress, | ||
size_t | iTimeOutMs, | ||
bool | noWait, | ||
int | FrameSync, | ||
int | LineSyncMode | ||
) |
Grabbing in Threshold operating mode.
The camera outputs an array of pixel addresses of High-Low and Low-High transitions
CamID | id of camera from 0 ... n - 1, 0 = 1st camera |
pData | Destination buffer to write grabbed image into |
lines | number of lines, it is also used for internal calculation of memory size |
subpixel | provides a higher resolution of transition positions |
noisesuppress | ignores very smal transition spikes |
iTimeOutMs | time in milliseconds (ms) to wait before the function returns, only valid if NoWait= FALSE |
noWait | true = function returns immediately, useful for asynchonuous image acquistion false = function blocks until image is ready |
FrameSync | -1 = no change, 1 = wait for FrameSync trigger, 0 = FrameSync trigger off |
LineSyncMode | -1 = no change, 0 = Free Run, 1 = Line Start, 4 = Exporsure Start, 5 = Exposure Control |
int SK_SETTHRESHOLDLEVEL | ( | int | CamID, |
int | Threshold | ||
) |
Set the threshold level.
This function sets the intensity value, which determines a transition from Low to High, or from High to Low. Inside the camera works with an 8 bit resolution of this level. The level step size at 12 bit ADC resolution is 16.
CamID | id of camera from 0 ... n - 1, 0 = 1st camera |
Threshold | threshold level, range of 8 bit = 0 ... 255 10 bit = 0 ... 1023 12 bit = 0 ... 4095 |
int SK_SETTHRESHOLDMODE | ( | int | CamID, |
bool | ON, | ||
bool | subPixel | ||
) |
Activates and deactivates the threshold mode.
ON
= false. The grayscale operating mode is active with the bitdepth like before activation of Thresholding. The changing the operating modes is also possible by SK_SETBITDEPTH.CamID | id of camera from 0 ... n - 1, 0 = 1st camera |
ON | true = threshold mode is activated false = threshold mode is deactivated |
subPixel | true = transitions with subpixel resolution false = transitions with integer subpixel resolution |
int SK_SETTHRESHOLDNOISEFILTER | ( | int | CamID, |
int | nFilter | ||
) |
Set a filter for noise reduction in thresholding.
CamID | id of camera from 0 ... n - 1, 0 = 1st camera |
nFilter | 0 = off 1 = on |