Stream usage in ZED360 setup the room phase

Hi,
I can manually calibrate ZEDX cameras using ZED360 via Orinbox, but I cannot calibrate these cameras with the stream I opened on Orinbox on a different computer. I get this error when I enter serial numbers and ip:port information


I am using zed sdk version 4.0.8 for my pc and orinbox

IP:PORT and serial numbers correct. When I click on the set up button, the receivers are added instantly, but when an error occurs, the receiver connections are lost.

Hi @emrekocdemir,

You seem to have a similar issue as this user, which was responded to here.

I am guessing you are using the ZED SDK Streaming with your application or maybe through ZED_Explorer to stream data to ZED360. However, as this is inefficient for fusing body tracking data, we’ve added the Camera.startPublishing method which only streams processed data to the Fusion module.

You can run the sample python application from the previous post here, one of these per camera (and change the IP:PORT configuration for each one), and ZED360 will be able to retrieve these streams.

Hi,
Thank you for respond. https://github.com/stereolabs/zed-sdk/blob/master/camera%20streaming/sender/python/streaming_sender.py I was using this streaming module with little modifications for two cameras and recording. I will try your solution and let you know thanks again.

Camera.startPublishing worked for setting up the room but when I start calibration I am getting this error
cal3


Positions are correct but ZED360 can not create json file. And I cant see the bodies in front of the cameras.

During the calibration stage, could you see the bodies of the detected person?

In the scene during the calibration stage, there must be only one person visible in the scene, as the calibration makes this assumption. You have to let the progress bar iterate a few times for the cameras to relocate themselves, and then press “Finish calibration”.

Are you able to reproduce these steps?

I did exactly this steps but progress bar did not iterate and no bodies detected.

Hi @emrekocdemir,

Are you using the sample from the post as is? I should have mentioned that in the publisher script, you have to enable the body tracking module (with Camera.enable_body_tracking) in order for the publishers to stream body tracking data.

I modify and use the sample in the post for 2 cameras. This way, zed360 sees the cameras but not the bodies. When I enable bodytracking, I get this error.

This is the code without enable bodytracking
`

import pyzed.sl as sl

import argparse

def parse_args():
    parser = argparse.ArgumentParser()
    parser.add_argument("--serial_numbers", nargs=2, type=int, help="Serial numbers of the cameras")
    return parser.parse_args()

def main():
    args = parse_args()
    if len(args.serial_numbers) != 2:
        print("Please provide serial numbers for both cameras.")
        return
    
    init_params = [sl.InitParameters() for _ in range(2)]
    cams = [sl.Camera() for _ in range(2)]

    ports = [30000, 30002]  # Port numbers for each camera

    for i in range(2):
        init_params[i].camera_resolution = sl.RESOLUTION.HD1080  # Example resolution, change as needed
        init_params[i].camera_fps = 30  # Example FPS, change as needed
        init_params[i].sdk_verbose = 1

        status = cams[i].open(init_params[i])
        if status != sl.ERROR_CODE.SUCCESS:
            print(f"Camera {i + 1} open failed with error code: {repr(status)}")
            return

        serial_number = args.serial_numbers[i]
        print(f"Camera {i + 1} opened with serial number: {serial_number}")

        port = ports[i]
       

    
        communication_parameters = sl.CommunicationParameters()
        communication_parameters.set_for_local_network(port)  # Set port for streaming
       

        cams[i].start_publishing(communication_parameters)
        runtime_params = sl.RuntimeParameters()
        image = sl.Mat()
        

    try:
        while True:
            # Capture frames from both cameras
            for i, cam in enumerate(cams):
                
                if cam.grab(runtime_params) == sl.ERROR_CODE.SUCCESS:
                    
                    cam.retrieve_image(image, sl.VIEW.LEFT)
                    
                    timestamp = cam.get_timestamp(sl.TIME_REFERENCE.CURRENT)
                    print(f"Camera {i + 1} - Image resolution: {image.get_width()} x {image.get_height()} || "
                          f"Image timestamp: {timestamp.get_milliseconds()}")

    except KeyboardInterrupt:
        pass

    # Stop publishing and close the cameras
    for cam in cams:
        cam.stop_publishing()
        cam.close()

if __name__ == "__main__":
    main()

`
And this is the code with enabling bodytracking

import pyzed.sl as sl
import argparse

def parse_args():
    parser = argparse.ArgumentParser()
    parser.add_argument("--serial_numbers", nargs=2, type=int, help="Serial numbers of the cameras")
    return parser.parse_args()

def main():
    args = parse_args()
    if len(args.serial_numbers) != 2:
        print("Please provide serial numbers for both cameras.")
        return
    
    init_params = [sl.InitParameters() for _ in range(2)]
    cams = [sl.Camera() for _ in range(2)]

    ports = [30000, 30002]  # Port numbers for each camera

    for i in range(2):
        init_params[i].camera_resolution = sl.RESOLUTION.HD1080  # Example resolution, change as needed
        init_params[i].camera_fps = 30  # Example FPS, change as needed
        init_params[i].sdk_verbose = 1

        status = cams[i].open(init_params[i])
        if status != sl.ERROR_CODE.SUCCESS:
            print(f"Camera {i + 1} open failed with error code: {repr(status)}")
            return

        serial_number = args.serial_numbers[i]
        print(f"Camera {i + 1} opened with serial number: {serial_number}")

        port = ports[i]
       

    
        communication_parameters = sl.CommunicationParameters()
        communication_parameters.set_for_local_network(port)  # Set port for streaming
        positional_tracking_parameters = sl.PositionalTrackingParameters()
    # If the camera is static, uncomment the following line to have better performances
    # positional_tracking_parameters.set_as_static = True
        cams[i].enable_positional_tracking(positional_tracking_parameters)

        body_param = sl.BodyTrackingParameters()
        cams[i].enable_body_tracking(body_param)

        cams[i].start_publishing(communication_parameters)
        runtime_params = sl.RuntimeParameters()
        image = sl.Mat()
        

    try:
        while True:
            # Capture frames from both cameras
            for i, cam in enumerate(cams):
                
                if cam.grab(runtime_params) == sl.ERROR_CODE.SUCCESS:
                    
                    cam.retrieve_image(image, sl.VIEW.LEFT)
                    
                    timestamp = cam.get_timestamp(sl.TIME_REFERENCE.CURRENT)
                    print(f"Camera {i + 1} - Image resolution: {image.get_width()} x {image.get_height()} || "
                          f"Image timestamp: {timestamp.get_milliseconds()}")

    except KeyboardInterrupt:
        pass

    # Stop publishing and close the cameras
    for cam in cams:
        cam.stop_publishing()
        cam.close()

if __name__ == "__main__":
    main()

Hi @emrekocdemir,

I apologize for the delay. It appears that I was mistaken and that in order to stream the bodies into the fusion, the sender must also call the Camera.retrieve_bodies(bodies) inside the grab loop.

Applied to your sample this would look like this:

    bodies = sl.Bodies()
    try:
        while True:
            # Capture frames from both cameras
            for i, cam in enumerate(cams):
                
                if cam.grab(runtime_params) == sl.ERROR_CODE.SUCCESS:
                    
                    cam.retrieve_image(image, sl.VIEW.LEFT)
                    cam.retrieve_bodies(bodies)
                    
                    timestamp = cam.get_timestamp(sl.TIME_REFERENCE.CURRENT)



    except KeyboardInterrupt:
        pass

Please let me know if you are able to perform the calibration with this.

1 Like

Thank you for your help, this method worked. I can see bodies in Zed 360 without any problems.

Hi @mattrouss

Sorry to bother you again, but I had the opportunity to test it fully today. There is no problem with calibration zed360 detects the person and calibrates itself but when I tried to open this calibration file. All I saw was empty json file.


I think there is a problem in saving the file. As you can see, it adjusts the locations and angles of the cameras correctly.

Hi @emrekocdemir,

Can you open ZED360 in a terminal window and share the logs that appear during the full calibration process? This can help us see why it is having trouble writing to a file.