Skip to content

citysciencelab/cut-paperscope-manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PaperScope Logo

PaperScope Manager

This guide will help you set up the PaperScope Manager on both Windows and Mac.

Prerequisites

Setup

1. OpenCV

Windows

Download the OpenCV (min v4.10) source code from the OpenCV GitHub repository and the OpenCV extra modules.

Open your console and navigate into the OpenCV repository folder:

cd opencv-4.10

Create a build directory and navigate to it:

mkdir build && cd build

Configure the build with CMake and if necessary replace path to OpenCV extra modules ('opencv_contrib'):

cmake -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DOPENCV_EXTRA_MODULES_PATH=../../opencv_contrib/modules ..

Build OpenCV:

cmake --build . --config Release

or alternatively

cmake --build . --config Debug

If compiling OpenCV doesn't work, you can use the precompiled files available in the thirdparty/opencv directory. For a detailed setup guide visit https://jinscott.medium.com/build-opecv-on-windows-with-cuda-f880270eadb0

Mac

Install OpenCV and pkg-config using Homebrew:

brew install opencv pkg-config

Ensure that pkg-config can find OpenCV:

export PKG_CONFIG_PATH=/usr/local/opt/opencv/lib/pkgconfig

You can verify the installation by running:

pkg-config --modversion opencv4

If the installation is successful, you should see the version number of OpenCV.

2. QT Creator

Open the Qt Creator application and the PaperScope project via the PaperScopeManager.pro file located in the root directory of the repository.

Configure the project to use the appropriate Qt kit for your platform.

Initial Config - Windows

The PaperScope Manager application relies on several external dependencies, including OpenCV and TensorFlow Lite. These dependencies need to be properly configured in the PaperScopeManager.pro file to ensure the application builds and runs correctly.

Ensure that the paths to the OpenCV and TensorFlow Lite libraries and include directories are correctly set according to your system's configuration. This setup will allow the PaperScope Manager to utilize these external dependencies effectively.

# use precompiled OpenCV or use your own dependency
OPENCV_LIBS = $$PWD/thirdparty/opencv/lib/win/release
OPENCV_BINS = $$PWD/thirdparty/opencv/bin/release
OPENCV_VERSION = 4100

Additionally, the necessary DLL files will be automatically copied to the build folder during the build process, ensuring that all required binaries are available for the application to run.

Initial Config - Mac

Depending on your system's hardware, you need to configure TensorFlow Lite for either Intel chips or Apple Silicon.

BundleFiles.files += \
    $$PWD/thirdparty/tensorflow-lite/lib/mac/libtensorflowlite.dylib \
    #$$PWD/thirdparty/tensorflow-lite/lib/mac/libtensorflowlite_intel.dylib \

Execute app from editor

Build the project by clicking on the "Build" button or selecting Build > Build Project from the menu.

Run the application by clicking on the "Run" button or selecting Build > Run from the menu.

Create standalone app

Qt offers a CLI deployment tool that simplifies the creation of standalone applications. For more details, please refer to the Qt documentation.

Windows: Mac: https://doc.qt.io/qt-6/macos-deployment.html#the-mac-deployment-tool

How To Use

Setup

  1. If you want to sync tracked data with a visualizer instance, you need to enter a valid project ID.
  2. Select your preferred webcam and resolution/framerate settings. You can switch between different cameras by clicking the "Open camera" button..
  3. Select a tracking mode.

PaperScope Manager 01

Calibration

There are two calibration modes available:

Calibration Matrix: This mode uses an OpenCV checkerboard pattern to remove your webcam lens distortion.

Manual Calibration: This mode allows you to manually set the desired tracking area in the webcam view.

  1. Use the selectbox "Active Calibration Mode" to switch between modes.
  2. To set your calibration click the button "Calibrate".

PaperScope Manager 02

PaperScope Config

The PaperScope Tracking Pipeline is separated into 5 stages.

2D Plane

First, the webcam view is transformed into a 2d plane.

PaperScope Config 01

Processing

Use the four slider in the "Processing" view to optimize the webcam image input.

Threshold Dark: darken background pixels

Threshold Light: Increase contrast of drawn shapes for better shape detection.

Smoothing: When using the "Calibration Matrix" mode you can smooth out perspective tracking errors and reduce jitter.

PaperScope Config 02

Threshold

The "Tresholding" view should display all desired shapes.

PaperScope Config 03

Bounding Boxes

The "Bounding Boxes" view shows all classified shapes from our ai model.

PaperScope Config 05

Contours

The "Contours" view shows the final shapes that will be sent to the visualizer.

PaperScope Config 06

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors