I'm trying to get a snapshot from a camera in a station, by running a Python script in the station tree. It looks like this:
If no camera item named 'Camera 1' is present, it works as intended: a camera item named 'Camera 1' is added to the tree, and the 1080x810 snapshot is created.
Now, if I run the Python script a second time, 'Camera 1' is already present in the station, the camera item is found, and a snapshot is created, but it is tiny: 160x120 pixels. It seems like the set camera parameters are lost.
How should I solve this?
Kind regards,
Maarten
Code:
cam_id = RDK.Item('Camera 1',robolink.ITEM_TYPE_CAMERA)
if not cam_id.Valid():
cam_id = RDK.Cam2D_Add(camFrame, 'FOCAL_LENGTH=6 FOV=32 FAR_LENGTH=5000 SIZE=1080x810')
RDK.Cam2D_Snapshot(RDK.getParam('PATH_OPENSTATION') + '/snapshot.png', cam_id)
Now, if I run the Python script a second time, 'Camera 1' is already present in the station, the camera item is found, and a snapshot is created, but it is tiny: 160x120 pixels. It seems like the set camera parameters are lost.
How should I solve this?
Kind regards,
Maarten