RoboDK Forum
Depth camera window is cropped on some monitors- Printable Version

+- RoboDK Forum (//www.sinclairbody.com/forum)
+-- Forum: RoboDK (EN) (//www.sinclairbody.com/forum/Forum-RoboDK-EN)
+ - - -论坛:RoboDK错误(//www.sinclairbody.com/forum/Forum-RoboDK-bugs)
+--- Thread: Depth camera window is cropped on some monitors (/Thread-Depth-camera-window-is-cropped-on-some-monitors)



Depth camera window is cropped on some monitors-hn-cso-05-18-2022

I'm using RoboDK on a Macbook Air with an external monitor. When I open a depth camera window, the image it shows changes depending on whether the window is on my laptop screen vs my external monitor.

The laptop-screen picture appears to be the lower left corner of the external-monitor picture, resized and cropped. I've included a screenshot of my camera settings and the stl file for the object I'm looking at.

The zoomed-and-cropped image is what shows up if I use the RoboDK Python API to take a snapshot, so this is an API bug, not just a display bug.


RE: Depth camera window is cropped on some monitors-Sam-05-19-2022

Hi,

Do you have the same issue if you uncheck the "Allow Window Resize" option?


RE: Depth camera window is cropped on some monitors-hn-cso-05-20-2022

Hi Sam,
Yes, the effect is exactly the same regardless of that option.


RE: Depth camera window is cropped on some monitors-Sam-05-20-2022

I'm unable to reproduce this on Windows using 3 monitors of different resolutions and DPI scaling.

Does the issue persist if you set the DPI scaling on both monitors to 100%?


RE: Depth camera window is cropped on some monitors-hn-cso-05-21-2022

It doesn't change with different monitor scaling.


RE: Depth camera window is cropped on some monitors-Sam-05-24-2022

Can you attach a station with a Python script that reproduce the issue directly?
How are you triggering the issue? Starting/moving RoboDK to the secondary monitor, then starting the script? Moving the preview window while open to the other monitor?


RE: Depth camera window is cropped on some monitors-hn-cso-05-31-2022

(05-24-2022, 12:12 PM)Sam Wrote:Can you attach a station with a Python script that reproduce the issue directly?
How are you triggering the issue? Starting/moving RoboDK to the secondary monitor, then starting the script? Moving the preview window while open to the other monitor?

See my attached station. No Python script necessary; just activate the camera ("Show camera" from dropdown menu), starting RoboDK on the external monitor. Then move the preview window from the external monitor to the laptop monitor while it's open.


RE: Depth camera window is cropped on some monitors-Sam-06-20-2022

As a workaround, we added the ability to retrieve the depth map through socket withRoboDK v5.4.3 (2022-06-20) and above. It should be available on all platforms soon.

Code:
bytes_img = RDK.Cam2D_Snapshot("", cam_item, 'DEPTH')
if isinstance(bytes_img, bytes) and bytes_img != b'':
# By socket
depth32_socket = np.frombuffer(bytes_img, dtype='>u4')
w, h = depth32_socket[:2]
depth32_socket = np.flipud(np.reshape(depth32_socket[2:], (h, w))).astype(np.uint32)