Vision sensor

Typically: "How do I... ", "How can I... " questions
Post Reply
anaruizm12
Posts: 2
Joined: 19 Oct 2017, 17:49

Vision sensor

Post by anaruizm12 » 13 Nov 2017, 13:46

I'm trying to make an easy recognition with a vision sensor, but I can not save the image to know if I'm on the right track, the first thing I do is create the object, read the sensor, capture an image and save it, but not I get it saved and I do not know why it is, I attach the code in case anyone knows what I can be wrong about

sensor=simGetObjectHandle('Vision_sensor')

result,pack1,pack2=simReadVisionSensor(sensor)
local image,resX,resY=simGetVisionSensorCharImage(sensor,0,0,0,0,0)
local filenameAndPath='c/:myImage.png'
result=simSaveImage(image,{resX,resY},0,filenameAndPath,-1)

coppelia
Site Admin
Posts: 6218
Joined: 14 Dec 2012, 00:25

Re: Vision sensor

Post by coppelia » 13 Nov 2017, 22:43

Hello,

correct should be like:

Code: Select all

local filenameAndPath='c:/myImage.png'
But this does not work here either. Any other path works fine. e.g.

Code: Select all

local filenameAndPath='d:/myImage.png'
works fine.

Cheers

Post Reply