Regular API function

simSetVisionSensorImage / sim.setVisionSensorImage

Description Deprecated. Use sim.setVisionSensorImg instead
C/C++
synopsis
int simSetVisionSensorImage(int sensorHandle,const double* image)
C/C++
parameters
sensorHandle: handle of the vision sensor object. Can be combined with sim.handleflag_greyscale (simply add sim.handleflag_greyscale to sensorHandle if you provide grey scale values instead of rgb value) or/and sim.handleflag_rawvalue (simply add sim.handleflag_rawvalue to sensorHandle if you do not wish to trigger image processing). If you instead want to set the vision sensor depth buffer, you can combine the handle of the vision sensor object with sim.handleflag_depthbuffer.
image: rgb buffer containing the image (buffer size must be resolutionX*resolutionY*3). Values in the buffer should vary between 0 and 1. In case a grey scale image is provided, the buffer size must be resolutionX*resolutionY. In case sim.handleflag_depthbuffer is specified, then the buffer size must be resolutionX*resolutionY.
C/C++
return value
-1 if operation was not successful. 0 if the image processing didn't trigger anything, 1 if the image processing triggered a detection
Lua
synopsis
(1) int result=sim.setVisionSensorImage(int sensorHandle,float[] image)
(2) int result=sim.setVisionSensorImage(int sensorHandle,buffer image)
Lua
parameters
sensorHandle: handle of the vision sensor object. Can be combined with sim.handleflag_greyscale (simply add sim.handleflag_greyscale to sensorHandle if you provide grey scale values instead of rgb value) or/and sim.handleflag_rawvalue (simply add sim.handleflag_rawvalue to sensorHandle if you do not wish to trigger image processing). If you instead want to set the vision sensor depth buffer, you can combine the handle of the vision sensor object with sim.handleflag_depthbuffer.
(1) a table containing individual values [0-1] for the red, green and blue components, or for the grey component. In case sim.handleflag_depthbuffer is specified, the table contains depth values.
(2) a string containing individual chars [0-255] for the red, green and blue components, or for the grey component. In case sim.handleflag_depthbuffer is specified, the string is a coded string (i.e. a packed depth value table).
Lua
return values
Similar to the C-function counterpart
Python
synopsis
(1) int result=sim.setVisionSensorImage(int sensorHandle,list image)
(2) int result=sim.setVisionSensorImage(int sensorHandle,bytes image)