Skip to content

Commit

Permalink
add README
Browse files Browse the repository at this point in the history
twMr7 committed Jan 30, 2018

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 97c38a7 commit 393ceea
Showing 5 changed files with 30 additions and 2 deletions.
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# rscvdnn
A Visual C++ project to test run the *OpenCV DNN object detection* with *RealSense* camera. The GUI utilize a modified version of gorgeous *nanogui* and use *OpenGL shader* to render video streams.

The *Deep Neural Network* part of codes are derived from [MobileNet Single-Shot Detector](https://github.com/opencv/opencv/blob/master/samples/dnn/ssd_mobilenet_object_detection.cpp) example of *OpenCV*. The trained [Caffe model](https://github.com/chuanqi305/MobileNet-SSD) (included in project [resources](https://github.com/twMr7/rscvdnn/tree/master/resources)) is loaded at the beginning and used to classify 20 object classes from RGB image. Note that only the center square ROI is the hot detecting spot, the unused side bands shall turn gray by design. For each detected object, the distance is estimated from its detected location within corresponding depth frame.

## Screenshot
![screenshot_eng](./resources/screenshot_eng.png)
![screenshot_zh_TW](./resources/screenshot_cht.png)

## Build Instruction

This VC++ project rely on the integration environment of [*vcpkg*](https://github.com/Microsoft/vcpkg) ports. Follow the [instruction](https://github.com/Microsoft/vcpkg/blob/master/README.md) to install vcpkg and run `.\vcpkg integrate install`, then install following dependency ports with `.\vcpkg install <port_name>:x64-windows`,

- **opencv**
- **realsense2**
- **poco**
- **eigen3**
- **stb**
- **glfw3**

where *eigen3*, *glfw3*, and *stb* ports need to setup additional static liked packages for *nanogui* to build. Please create a file `"x64-windows-static-md.cmake"` in `vcpkg/triplets` folder with the following contents,
```
set(VCPKG_TARGET_ARCHITECTURE x64)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE static)
```
then install these three ports with `.\vcpkg install <port_name>:x64-windows-static-md`.
Binary file added resources/screenshot_cht.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/screenshot_eng.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions rscvdnn.sln
Original file line number Diff line number Diff line change
@@ -8,6 +8,7 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{247CF735-1098-44AC-AF58-A1B4C8FB2E83}"
ProjectSection(SolutionItems) = preProject
CommonSetup.props = CommonSetup.props
README.md = README.md
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nanogui", "nanogui\nanogui.vcxproj", "{6089ABC6-6E53-4D69-8F96-E4BA91EAA18C}"
4 changes: 2 additions & 2 deletions rscvdnn/MainWindow.cpp
Original file line number Diff line number Diff line change
@@ -172,12 +172,12 @@ bool MainWindow::keyboardEvent(int key, int scancode, int action, int modifiers)
bool MainWindow::resizeEvent(const Eigen::Vector2i & size)
{
// rescale setting window, the minimum width 150 is expected to be good enough, only height is resized
Vector2i new_setting_size = Vector2i(std::max(150, _settingWindow->size()(0)), size(1) - 2);
Vector2i new_setting_size = Vector2i(std::max(150, _settingWindow->size()(0)), size(1) - 3);
_settingWindow->setSize(new_setting_size);

// color window take full available space
if (_colorWindow != nullptr)
_colorWindow->setSize(Vector2i(size(0) - new_setting_size(0) - 2, size(1) - 2));
_colorWindow->setSize(Vector2i(size(0) - new_setting_size(0) - 3, size(1) - 15));

if (_depthWindow != nullptr)
{

0 comments on commit 393ceea

Please sign in to comment.