![](../images/homeImg.png)
Regular API function
simGetVisionSensorCharImage / sim.getVisionSensorCharImage
Description
|
Deprecated. Use sim.getVisionSensorImg instead |
C/C++ synopsis
|
unsigned char* simGetVisionSensorCharImage(int sensorHandle,int* resolutionX,int* resolutionY) |
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.
resolutionX/resolutionY: the returned vision sensor resolution
|
C/C++ return value
|
image buffer (buffer size is resolutionX*resolution*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-255 (0=min. intensity, 255=max. intensity)
|
Lua synopsis
|
buffer imageBuffer,int resolutionX,int resolutionY=sim.getVisionSensorCharImage(int sensorHandle,int posX=0,int posY=0,int sizeX=0,int sizeY=0,float rgbaCutOff=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
rgbaCutOff: when different from zero, then an RGBA image is returned, where the alpha component will be 255 for all depth values below rgbaCutOff, and 0 for all depth values above rgbaCutOff. 0 corresponds to the near clipping plane, 1 to the far clipping plane. Zero by default.
|
Lua return values
|
imageBuffer: a string containing rgb (or rgba) values (sizeX*sizeY*3 (or sizeX*sizeY*4 in case of rgba), rgb(a) 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 in the range 0-255. |
Python synopsis |
bytes imageBuffer,int resolutionX,int resolutionY=sim.getVisionSensorCharImage(int sensorHandle,int posX=0,int posY=0,int sizeX=0,int sizeY=0,float rgbaCutOff=0) |
|