i am currently working on a semester project to track cars and bicycles and measure the distance between the two by using the xyz coordinates of the detected objects.
Now i want to create a list with all the the detected objects with their respective data like xyz values, velocity, id etc. to store them permenantly outside of the svo file. Is there a way to create a list with all the objects? I know that the date of the object list is stored in a vector but i cant figure out to make a proper list.
The plan is to store all the data and potentially teach an AI to seperate cars and bicycles better and to write an algorithm which automatically detects a “take over maneuver” of said objects.
Thank you for your help!
Welcome to the Stereolabs community.
You can simply create a CSV file frame-by-frame with all the information you need to save.
Thanks for the reply!
I tried the GStreamer but i cant get the CMake program to compile the gstreamer sample code from GitHub because it cant detect the gstreamer even tho it is installed.
I am mainly working with the “birds eye viewer” example und just need to get the data of the detectep objects into the csv file but i sadly couldn’t figure it out.
Why GStreamer? It does not allow you to save the detected object information in a CSV file unless you write your own plugin.
What code language are you using?
Ditched the GStreamer. When i googled it together with the ZED 2 it led me to a doc page vom stereolabs explaining CSV files with gstreamer.
I am coding in c++ and trying to implement a csv solution into the bird eye viewer program.
OK, you can use the code here as an example:
This file has been truncated.
// Copyright (c) 2020, STEREOLABS.
// All rights reserved.
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
We used an output file stream to save CSV line by line (
This is the code to save the header:
*sink->out_file_ptr << "TIMESTAMP,STREAM_TYPE,CAM_MODEL,GRAB_W,GRAB_H," <<
and here you save all the information (IMU data in this case) line by line:
This file has been truncated.
// ----> Timestamp
GstClockTime timestamp = GST_BUFFER_TIMESTAMP (buf);
*csvsink->out_file_ptr << timestamp << CSV_SEP;
// <--- Timestamp
GST_TRACE_OBJECT( csvsink, "Input buffer size %lu B", map_in.size );
GST_TRACE_OBJECT( csvsink, "GstZedSrcMeta size %lu B", sizeof(GstZedSrcMeta) );
GstZedSrcMeta* meta = (GstZedSrcMeta*)map_in.data;
// ----> Info
*csvsink->out_file_ptr << meta->info.stream_type << CSV_SEP;
*csvsink->out_file_ptr << meta->info.cam_model << CSV_SEP;
*csvsink->out_file_ptr << meta->info.grab_single_frame_width << CSV_SEP;
*csvsink->out_file_ptr << meta->info.grab_single_frame_height << CSV_SEP;
GST_LOG (" * [META] Stream type: %d", meta->info.stream_type );
GST_LOG (" * [META] Camera model: %d", meta->info.cam_model );
GST_LOG (" * [META] Grab frame size: %d x %d", meta->info.grab_single_frame_width, meta->info.grab_single_frame_height );
// <---- Info