Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
(API) Cam2D_Snapshot returns wrong size image
#5
Hello,

WINDOWFIXED and SNAPSHOT=640x480 parameters did not resolve the issue.

I noticed the issue was not present when adding a breakpoint on Cam2D_Add. Adding a pause after the clear_station call fixes it. The issue is not present when adding a camera to a station without deleting it first. The code below works for me.

Code:
#!/usr/bin/python3

from robolink import * # API to communicate with RoboDK
from robodk import * # robodk robotics toolbox

RDK = Robolink()

def clear_station(rdk):
station_name = "Camera bug"

# If there was already a station for this script, delete it
station = rdk.Item(station_name)
try:
station.Delete()
except robolink.InputError as e:
pass

station = rdk.AddStation(station_name)
return station

station = clear_station(RDK)
pause(0.3)
virtual_camera = RDK.Cam2D_Add(item_object=station, cam_params="FOCAL_LENGTH=1.93 FOV=65.5 SIZE=640x480")

filename = "/tmp/bug.png"
RDK.Cam2D_Snapshot(file_save_img=filename)
Please read the论坛Guidelinesbefore posting!
Find useful information about RoboDK by visiting ourOnline Documentation.


Messages In This Thread
RE: (API) Cam2D_Snapshot returns wrong size image - bySam- 06-16-2022, 11:50 AM



Users browsing this thread:
1 Guest(s)