Skip to content

Commit

Permalink
Merge csharp samples (stereolabs#6)
Browse files Browse the repository at this point in the history
* add csharp samples and tuto

* update Csharp cmake style

Co-authored-by: Bvallon-sl <[email protected]>
  • Loading branch information
P-yver and Bvallon-sl authored Nov 23, 2020
1 parent b08cbf8 commit ee3ef19
Show file tree
Hide file tree
Showing 217 changed files with 18,194 additions and 768 deletions.
45 changes: 27 additions & 18 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,36 @@ cmake_minimum_required(VERSION 3.1)
PROJECT(SamplesAndTutos)

OPTION(INSTALL_SAMPLES "Once build, deploy samples into bin" ON)
OPTION(BUILD_CPP "Build c++ samples else c#" ON)

if(${BUILD_CPP})
SET(TYPE "cpp")
else()
SET(TYPE "csharp")
endif()

SET(SAMPLE_LIST "")
add_subdirectory("camera control/cpp")
add_subdirectory("camera streaming/receiver/cpp")
add_subdirectory("camera streaming/sender/cpp")
add_subdirectory("depth sensing/cpp")
add_subdirectory("object detection/image viewer/cpp")
add_subdirectory("object detection/birds eye viewer/cpp")
add_subdirectory("body tracking/cpp")
add_subdirectory("plane detection/cpp")
add_subdirectory("positional tracking/cpp")
add_subdirectory("spatial mapping/advanced point cloud mapping/cpp")
add_subdirectory("spatial mapping/basic/cpp")
add_subdirectory("svo recording/export/cpp")
add_subdirectory("svo recording/playback/cpp")
add_subdirectory("svo recording/recording/cpp")
add_subdirectory("other/cuda refocus")
add_subdirectory("other/opengl gpu interop")
add_subdirectory("other/multi camera/cpp")
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("body tracking/${TYPE}")
add_subdirectory("plane detection/${TYPE}")
add_subdirectory("positional tracking/${TYPE}")
add_subdirectory("spatial mapping/basic/${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("other/cuda refocus")
add_subdirectory("other/opengl gpu interop")
add_subdirectory("other/multi camera/cpp")
endif()
add_subdirectory("tutorials")

if(${INSTALL_SAMPLES})
if(${INSTALL_SAMPLES} AND ${BUILD_CPP})
INSTALL(TARGETS ${SAMPLE_LIST} RUNTIME DESTINATION ${CMAKE_SOURCE_DIR}/bin)
endif()
27 changes: 11 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# Stereolabs ZED - Examples
# ZED SDK

Links
--------
ZED SDK - https://www.stereolabs.com/developers/
The Stereolabs ZED SDK is a cross-platform library designed to get the best out of the [ZED](https://www.stereolabs.com/store/) cameras.

General Documentation - https://docs.stereolabs.com/
For the latest release check our [Developer Center](https://www.stereolabs.com/developers/).

API Documentation - https://www.stereolabs.com/developers/documentation/API/latest
General [Documentation](https://www.stereolabs.com/docs/) gives in-depth information about the products and their functionalities.

Compilation Instructions - https://www.stereolabs.com/docs/getting-started/application-development/
Compilation Instructions for [Windows](https://www.stereolabs.com/docs/app-development/cpp/windows/) and [Linux/Jetson](https://www.stereolabs.com/docs/app-development/cpp/linux/) are avaible for C++ and [Python](https://www.stereolabs.com/docs/app-development/python/install/).

Contents
--------
The ZED SDK includes tutorials and samples that demonstrate the API features and code.

If you need help or more informations check our [Support](https://support.stereolabs.com/) page or join our [Community](https://community.stereolabs.com/).


# Examples Overview

* **Tutorials** - A series of basic tutorials that demonstrate the use of each API module.

Expand All @@ -32,9 +32,4 @@ The ZED SDK includes tutorials and samples that demonstrate the API features and

* **SVO Recording** - This sample shows how to record and playback video files in SVO format. SVO files lets you use all the ZED SDK features without having a ZED connected.

* **Other** - Other general samples that demonstrate the use of the ZED SDK.


Support
-------
If you need assistance with the ZED, visit our Help Center at https://support.stereolabs.com or contact us at [email protected].
* **Other** - Other general samples that demonstrate the use of the ZED SDK.
17 changes: 8 additions & 9 deletions body tracking/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
# Stereolabs ZED - Body Tracking Viewer
# ZED SDK - Body Tracking

This sample shows how to detect and track bodies in space and display it. It demonstrates how to:
## This sample shows how to detect and track human bodies in space.

- Detect and track bodies/objects in the scene using the ZED SDK API
- Show the image with 3D bounding box with OpenGL
### Features
- Camera images are displayed with human bodies as skeletons
- Bodies are tracked across time and space
- Display bodies bounding boxes by pressing the `b` key

## Getting started
![](body_tracking.jpg)

- First, download the latest version of the ZED SDK on [stereolabs.com](https://www.stereolabs.com).
- For more information, read the ZED [API documentation](https://www.stereolabs.com/developers/documentation/API/).

*NOTE:* A ZED 2 is required to run use this module.
*NOTE2:* This sample is only available in C++
>*NOTE: A [ZED 2](https://store.stereolabs.com/products/zed-2) is required to use this module.*
Binary file added body tracking/body_tracking.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions body tracking/cpp/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# ZED SDK - Body Tracking

This sample shows how to detect and track human bodies in space.

## 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
*NOTE: A [ZED 2](https://store.stereolabs.com/products/zed-2) is required to use this module.*
- Navigate to the build directory and launch the executable
- Or open a terminal in the build directory and run the sample :

./ZED_Body_Tracking

## Features
- Display bodies bounding boxes by pressing the `b` key.

## Support
If you need assistance go to our Community site at https://community.stereolabs.com/
6 changes: 6 additions & 0 deletions body tracking/csharp/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/>
</startup>
</configuration>
43 changes: 43 additions & 0 deletions body tracking/csharp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
cmake_minimum_required( VERSION 3.8.0 )

project(ZED_Body_Tracking CSharp)

add_executable(${PROJECT_NAME}
Program.cs
MainWindow.cs
GLViewer.cs
App.config
packages.config
Properties/AssemblyInfo.cs
)

# Set the target platform to x64, since ZED SDK does not support 32-bits arch
target_compile_options(${PROJECT_NAME} PRIVATE "/platform:x64" )

# Set the .NET Framework version for the target.
set_property(TARGET ${PROJECT_NAME} PROPERTY VS_DOTNET_TARGET_FRAMEWORK_VERSION "v4.6.1")

# Set the C# language version, otherwise default 3.0 is taken
set(CMAKE_CSharp_FLAGS "/langversion:7")

set_property(TARGET ${PROJECT_NAME} PROPERTY VS_DOTNET_REFERENCES
"Microsoft.CSharp"
"PresentationCore"
"PresentationFramework"
"System"
"System.Xaml"
"System.Data"
"System.Linq"
"System.Windows"
"System.Windows.Forms"
"System.Numerics"
"System.Drawing"
"WindowsBase"
)

set_property(TARGET ${PROJECT_NAME} PROPERTY VS_PACKAGE_REFERENCES
"OpenGL.Net_0.8.4"
"OpenGL.Net.CoreUI_0.8.4"
"Stereolabs.zed_3.3.1-rc"
"sl_zed_interface_3.3.1-rc"
)
Loading

0 comments on commit ee3ef19

Please sign in to comment.