Skip to content

Commit

Permalink
Update for ZED SDK 3.8 (#515)
Browse files Browse the repository at this point in the history
  • Loading branch information
P-yver authored Nov 4, 2022
1 parent d272913 commit 87f2997
Show file tree
Hide file tree
Showing 101 changed files with 109,701 additions and 157 deletions.
7 changes: 5 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,20 @@ add_subdirectory("camera control/${TYPE}")
add_subdirectory("depth sensing/${TYPE}")
add_subdirectory("object detection/image viewer/${TYPE}")
add_subdirectory("object detection/birds eye viewer/${TYPE}")
add_subdirectory("camera roi/auto exposure/${TYPE}")
add_subdirectory("body tracking/${TYPE}")
add_subdirectory("plane detection/${TYPE}")
add_subdirectory("plane detection/overview/${TYPE}")
add_subdirectory("positional tracking/${TYPE}")
add_subdirectory("spatial mapping/basic/${TYPE}")
add_subdirectory("spatial mapping/overview/${TYPE}")
add_subdirectory("svo recording/export/${TYPE}")
add_subdirectory("svo recording/playback/${TYPE}")
add_subdirectory("svo recording/recording/${TYPE}")
if(${BUILD_CPP})
add_subdirectory("camera streaming/receiver/cpp")
add_subdirectory("camera streaming/sender/cpp")
add_subdirectory("spatial mapping/advanced point cloud mapping/cpp")
add_subdirectory("plane detection/floor plane/${TYPE}")
add_subdirectory("camera roi/sensing roi/${TYPE}")
add_subdirectory("other/cuda refocus")
add_subdirectory("other/opengl gpu interop")
add_subdirectory("other/multi camera/cpp")
Expand Down
55 changes: 0 additions & 55 deletions body tracking/cpp/include/GLViewer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,61 +26,6 @@

using namespace sl;

const std::vector<std::pair< BODY_PARTS, BODY_PARTS>> SKELETON_BONES
{
{
BODY_PARTS::NOSE, BODY_PARTS::NECK
},
{
BODY_PARTS::NECK, BODY_PARTS::RIGHT_SHOULDER
},
{
BODY_PARTS::RIGHT_SHOULDER, BODY_PARTS::RIGHT_ELBOW
},
{
BODY_PARTS::RIGHT_ELBOW, BODY_PARTS::RIGHT_WRIST
},
{
BODY_PARTS::NECK, BODY_PARTS::LEFT_SHOULDER
},
{
BODY_PARTS::LEFT_SHOULDER, BODY_PARTS::LEFT_ELBOW
},
{
BODY_PARTS::LEFT_ELBOW, BODY_PARTS::LEFT_WRIST
},
{
BODY_PARTS::RIGHT_HIP, BODY_PARTS::RIGHT_KNEE
},
{
BODY_PARTS::RIGHT_KNEE, BODY_PARTS::RIGHT_ANKLE
},
{
BODY_PARTS::LEFT_HIP, BODY_PARTS::LEFT_KNEE
},
{
BODY_PARTS::LEFT_KNEE, BODY_PARTS::LEFT_ANKLE
},
{
BODY_PARTS::RIGHT_SHOULDER, BODY_PARTS::LEFT_SHOULDER
},
{
BODY_PARTS::RIGHT_HIP, BODY_PARTS::LEFT_HIP
},
{
BODY_PARTS::NOSE, BODY_PARTS::RIGHT_EYE
},
{
BODY_PARTS::RIGHT_EYE, BODY_PARTS::RIGHT_EAR
},
{
BODY_PARTS::NOSE, BODY_PARTS::LEFT_EYE
},
{
BODY_PARTS::LEFT_EYE, BODY_PARTS::LEFT_EAR
}
};

///////////////////////////////////////////////////////////////////////////////////////////////

class Shader {
Expand Down
2 changes: 1 addition & 1 deletion body tracking/cpp/src/GLViewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ void GLViewer::updateData(sl::Mat &matXYZRGBA, std::vector<sl::ObjectData> &objs
auto clr_id = generateColorID(objs[i].id);
if (objs[i].keypoint.size()) {
if (body_format_ == sl::BODY_FORMAT::POSE_18) {
for (auto& limb : SKELETON_BONES) {
for (auto& limb : sl::BODY_BONES) {
sl::float3 kp_1 = objs[i].keypoint[getIdx(limb.first)];
sl::float3 kp_2 = objs[i].keypoint[getIdx(limb.second)];
float norm_1 = kp_1.norm();
Expand Down
2 changes: 1 addition & 1 deletion body tracking/cpp/src/TrackingViewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ void render_2D(cv::Mat &left_display, sl::float2 img_scale, std::vector<sl::Obje
cv::Scalar color = generateColorID_u(obj.id);
if (body_format == sl::BODY_FORMAT::POSE_18) {
// skeleton bones
for (const auto& parts : SKELETON_BONES) {
for (const auto& parts : sl::BODY_BONES) {
auto kp_a = cvt(obj.keypoint_2d[getIdx(parts.first)], img_scale);
auto kp_b = cvt(obj.keypoint_2d[getIdx(parts.second)], img_scale);
if (roi_render.contains(kp_a) && roi_render.contains(kp_b))
Expand Down
7 changes: 7 additions & 0 deletions camera roi/auto exposure/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# ZED SDK - Exposure ROI

## This sample shows how to capture images with the ZED SDK and adjust camera settings.

### Features
- Camera images are displayed on an OpenCV windows
- The auto exposure using an ROI can be changed
39 changes: 39 additions & 0 deletions camera roi/auto exposure/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
CMAKE_MINIMUM_REQUIRED(VERSION 3.5)
PROJECT(ZED_ROI_Exposure)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
SET(CMAKE_BUILD_TYPE "Release")

option(LINK_SHARED_ZED "Link with the ZED SDK shared executable" ON)

if (NOT LINK_SHARED_ZED AND MSVC)
message(FATAL_ERROR "LINK_SHARED_ZED OFF : ZED SDK static libraries not available on Windows")
endif()

find_package(ZED 3 REQUIRED)
find_package(OpenCV REQUIRED)
find_package(CUDA ${ZED_CUDA_VERSION} REQUIRED)

include_directories(${CUDA_INCLUDE_DIRS})
include_directories(${ZED_INCLUDE_DIRS})
include_directories(${OpenCV_INCLUDE_DIRS})

link_directories(${ZED_LIBRARY_DIR})
link_directories(${OpenCV_LIBRARY_DIRS})
link_directories(${CUDA_LIBRARY_DIRS})

ADD_EXECUTABLE(${PROJECT_NAME} src/main.cpp)

if (LINK_SHARED_ZED)
SET(ZED_LIBS ${ZED_LIBRARIES} ${CUDA_CUDA_LIBRARY} ${CUDA_CUDART_LIBRARY})
else()
SET(ZED_LIBS ${ZED_STATIC_LIBRARIES} ${CUDA_CUDA_LIBRARY} ${CUDA_LIBRARY})
endif()

TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${ZED_LIBS} ${OpenCV_LIBRARIES})

if(INSTALL_SAMPLES)
LIST(APPEND SAMPLE_LIST ${PROJECT_NAME})
SET(SAMPLE_LIST "${SAMPLE_LIST}" PARENT_SCOPE)
endif()
26 changes: 26 additions & 0 deletions camera roi/auto exposure/cpp/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# ZED SDK - Camera Control

This sample shows how to capture images with the ZED SDK and adjust camera settings.

## Getting Started
- Get the latest [ZED SDK](https://www.stereolabs.com/developers/release/)
- Check the [Documentation](https://www.stereolabs.com/docs/)

## Build the program
- Build for [Windows](https://www.stereolabs.com/docs/app-development/cpp/windows/)
- Build for [Linux/Jetson](https://www.stereolabs.com/docs/app-development/cpp/linux/)

## Run the program
- Navigate to the build directory and launch the executable
- Or open a terminal in the build directory and run the sample :

./ZED_ROI_Exposure

### Features

- Camera images are displayed on an OpenCV windows
- The auto exposure using an ROI can be changed


## Support
If you need assistance go to our Community site at https://community.stereolabs.com/
Loading

0 comments on commit 87f2997

Please sign in to comment.