Hi there,
I need to make an app that uses the “ZED SDK/samples/object detection/birds eye viewer” as a video player, then I have a GUI with two sliders to set a minimum frame and a maximum frame, a play/pause button and an export button. The app must export metadata values of the keypoints of a person detected for each frame between the min frame and max frame.
This is what I do:
while (
#if ENABLE_GUI
gl_viewer_available &&
#endif
!quit && zed.grab(runtime_parameters) == ERROR_CODE::SUCCESS) {
// if min trackbar changes
if (trackbar1_changed)
{
zed.setSVOPosition(actual_frame);
zed.grab(runtime_parameters);
trackbar1_changed = false;
}
// if pause button is pressed
if (!gui_is_play)
{
detection_parameters.enable_tracking = false;
returned_state = zed.enableObjectDetection(detection_parameters);
zed.setSVOPosition(actual_frame);
zed.grab(runtime_parameters);
detection_parameters.enable_tracking = true;
returned_state = zed.enableObjectDetection(detection_parameters);
}
...
The thing is that as soon as I set the SVO frame the keypoints (zed.setSVOPosition(actual_frame);
) the keypoint values start being nan ([0] = {x=-nan(ind) y=-nan(ind) z=-nan(ind) ...}
).
As you can see, I’ve tried both ways:
Without the tracking already enabled:
zed.setSVOPosition(actual_frame);
zed.grab(runtime_parameters);
And with the tracking disabled:
detection_parameters.enable_tracking = false;
returned_state = zed.enableObjectDetection(detection_parameters);
zed.setSVOPosition(actual_frame);
zed.grab(runtime_parameters);
detection_parameters.enable_tracking = true;
returned_state = zed.enableObjectDetection(detection_parameters);
And both returned the keypoints nan.
Any ideas on how to do it right?
Thanks!