Regular API function

simSetVisionSensorCharImage / sim.setVisionSensorCharImage

Description Sets the rgb-image of a vision sensor (and applies any image processing via the vision callback functions). Make sure the vision sensor is flagged as external input. Use sim.getVisionSensorResolution to know the size of the image buffer that you need to provide (buffer size=resolutionX *resolutionY*3). See also sim.setVisionSensorImage.
simInt simSetVisionSensorCharImage(simInt sensorHandle,const simUChar* image)
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).
image: rgb buffer containing the image (buffer size must be resolutionX*resolutionY*3). Values in the buffer should vary between 0 and 255. In case a grey scale image is provided, the buffer size must be resolutionX*resolutionY.
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 int result=sim.setVisionSensorCharImage(int sensorHandle,string image)
Lua parameters
Similar to the C-function counterpart
Lua return values
Similar to the C-function counterpart
Python synopsis int result=sim.setVisionSensorCharImage(int sensorHandle,bytes image)