Camera parameters of retrieved camera item- Printable Version +- RoboDK Forum (//www.sinclairbody.com/forum) +-- Forum: RoboDK (EN) (//www.sinclairbody.com/forum/Forum-RoboDK-EN) +--- Forum: RoboDK API (//www.sinclairbody.com/forum/Forum-RoboDK-API) +--- Thread: Camera parameters of retrieved camera item (/Thread-Camera-parameters-of-retrieved-camera-item) |
Camera parameters of retrieved camera item-Maarten-12-15-2022 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:
Code:
cam_id = RDK.Item('Camera 1',robolink.ITEM_TYPE_CAMERA)
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 RE: Camera parameters of retrieved camera item-Maarten-12-15-2022 I think I solved it, by repeating theCam2D_Addcommand even when the camera already exists, and adding the camera item as a third variable:
Code:
cam_id = RDK.Item('Camera 1',robolink.ITEM_TYPE_CAMERA)
RE: Camera parameters of retrieved camera item-Sam-12-15-2022 Hi Maarten, To reuse a camera that was closed, you need to open the preview window manually. You do not need to call Cam2D_Add again.
Code:
#----------------------------------
RE: Camera parameters of retrieved camera item-Maarten-12-15-2022 Thank you Sam,cam_item.setParam('Open', 1)did the trick! |