
Regular API function
simGetVisionSensorImage / sim.getVisionSensorImage
Description
|
Deprecated. Use sim.getVisionSensorImg instead
|
C/C++ synopsis
|
double* simGetVisionSensorImage(int sensorHandle)
|
C/C++ parameters |
sensorHandle: handle of the vision sensor. Can be combined with sim.handleflag_greyscale (simply add sim.handleflag_greyscale to sensorHandle), if you wish to retrieve the grey scale equivalent.
|
C/C++ return value
|
image buffer (buffer size is resolutionX*resolutionY*3 or resolutionX*resolutionY in case of a grey scale image retrieval) or nullptr in case of an error. The user is in charge of releasing the returned buffer with simReleaseBuffer. Returned values are in the range of 0-1 (0=min. intensity, 1=max. intensity)
|
Lua synopsis
|
float[]/buffer imageBuffer=sim.getVisionSensorImage(int sensorHandle,int posX=0,int posY=0,int sizeX=0,int sizeY=0,int returnType=0)
|
Lua parameters |
sensorHandle: handle of the vision sensor. Can be combined with sim.handleflag_greyscale (simply add sim.handleflag_greyscale to sensorHandle), if you wish to retrieve the grey scale equivalent.
posX / posY: position of the image portion to retrieve. Zero by default.
sizeX / sizeY: size of the image portion to retrieve. Zero by default, which means that the full image should be retrieved
returnType: the type of the returned buffer. 0 returns a table filled with rgb values in the range 0-1, 1 returns a string filled with rgb values in the range 0-255
|
Lua return values
|
imageBuffer: a table containing rgb values (sizeX*sizeY*3, rgb values in the range 0-1) or a string containing rgb values (sizeX*sizeY*3, rgb values in the range 0-255). In case of a grey scale image retrieval, the image buffer will contain grey values or grey-alpha values. |
Python synopsis |
list/bytes imageBuffer=sim.getVisionSensorImage(int sensorHandle,int posX=0,int posY=0,int sizeX=0,int sizeY=0,int returnType=0) |
|