OpenGL initial view

Hi,

The openGL view starts at the floor, how can I set it back as the sample code bird eye view for object detection?

Thx

Here is the original bird eye view

Hi,
the initial position of the Camera is defined here:

1 Like

Hi,

I prefer not to change the cpp… btw, how to rebuild it?
Can I change the OpenGL viewer.py code instead?

I found out once I used this line, the 3D view change.

positional_tracking_parameters.set_floor_as_origin = True

How can I solve it?
Thx

Hi,

I tried to replace this line

positional_tracking_parameters.set_floor_as_origin = True

with

    plane = sl.Plane()
    resetTrackingFloorFrame = sl.Transform()
    find_plane_status = zed.find_floor_plane(plane, resetTrackingFloorFrame)
    if find_plane_status == sl.ERROR_CODE.SUCCESS :
	  # Reset positional tracking to align it with the floor plane frame
        zed.reset_positional_tracking(resetTrackingFloorFrame)

The 3D view is ok, but the nose position is not at 1.85 any more…
I guess it can not find the floor…

Thx

Ref link,
https://www.stereolabs.com/docs/spatial-mapping/plane-detection/

Hi,

I put this code in the while loop and it can run, but the 3D view is still shifted.
Thx

            if not(find_plane_ok == 1):
                find_plane_status = zed.find_floor_plane(plane, resetTrackingFloorFrame)
                if find_plane_status == sl.ERROR_CODE.SUCCESS :
                    print("Found the floor!!!!!!!!!!!!!!!!")
		  # Reset positional tracking to align it with the floor plane frame
                    zed.reset_positional_tracking(resetTrackingFloorFrame)
                    find_plane_ok = 1
                else:
                    print(" CANNOT Find the floor!!!!!!!!!!!!!!!!")

Hi,

I can loop the video forever from this link, How to loop the svo file? - #3 by AK51

If it is difficult to change the initial view, I can still use my mouse to move the 3D view afterward.

Thx

This should leading to the same result, the fact that you use set_floor_as_origin = true will produce the same result as find_floor_plane and then reset_positional_tracking(resetTrackingFloorFrame).

The function find_floor_plane will not return SUCCESS if it can not find the foor plane.

If it succeed, you can retrieve the Objects or point cloud in the WORLD reference frame by changing the Camera::runtimeParameters to REFERENCE_FRAME::WORLD
https://www.stereolabs.com/docs/api/python/classpyzed_1_1sl_1_1RuntimeParameters.html#aeaa63e20fb8dddbf1d0e422cbfe93169