Giter Site home page Giter Site logo

store-aisle-monitor's Introduction

Store Aisle Monitor

Details
Target OS: Ubuntu* 16.04 LTS
Programming Language C++
Time to complete: 30 min

What it Does

This reference implementation takes a video input (webcam/loaded video), generates a visual heatmap / motion map, counts the number of people present and integrates the results. The application has the functionality of creating an output video and saving a snapshot at a particular instance by the user to the cloud.

How it Works

The opencv functions calculate the total number of frames, frame width, frame height and frames per second (fps) of the video input (camera or file). Video object files are saved. Threshold and add weights outputs are fed to these video object files to generate a heatmap. The solution detects and draws people, adjusts boundary boxes, and returns the count using the Inference Engine included in OpenVINO™ toolkit.

Requirements

Hardware

Software

  • Ubuntu* 16.04
  • Intel® System Studio
  • OpenVINO™ toolkit
  • Node.js* environment with “yargs, path, azure-storage” installed

Setup

Note: Please go through the code and specify the required paths in the comments before executing.

Creating a Project

  1. Open Intel® System Studio.
  2. Click File→ New→ Project→ Application Development→ C/C++ project to build and run on this Linux operating system.
  3. Click the Intel® Compiler under Examples and click the ICC example.
  4. Clear the entire code present in .cpp file and write your code to be executed.
  5. Make the required changes to ensure you are error free.

Link the libraries

To link the libraries to the Project perform the following.

  1. Click on Project→ Properties→ C/C++ Build→ Settings.
  2. Select the libraries under Intel C++ linker.
  3. Add the required libraries and path for the libraries as shown below.

Figure 1

  1. Click Apply.
  2. Then click OK.

Including the header files

To include the required header files for the project, perform the following:

  1. Click Project→ Properities→ C/C++ General→ Paths and Symbols.
  2. Click Add. This adds the required paths as shown below.

Figure 2

Build the project

To build the project, perform the following:

  1. Click Project→ Build Project.
  2. Binaries will be created as shown below, if there are no errors.

Figure 3

This project uses an Azure account with storage containers present in it. For guidance, follow the official documentation by Microsoft* on setting it up.

Run the Application

Note: Make sure you've plugged in a UVC webcam before attempting to run the application

To verify whether this is working properly or not, perform the following.

  1. Click Run→ Run As→ Local Application.
  2. As per the specified duration in the code, the images are uploaded to the cloud.

Figure 4

Using the code

  1. Input to the code

    The input to the code can be a video file or the camera.

  2. Calculation of frame requirements

    Calculation of the total number of frames, frame width, frame height and frames per second (fps) using opencv functions.

  3. Saving video APIs

    Videos are saved on the same path unless otherwise specified.

    Three object files-generate three video files.

  4. Heatmap Generation

    background segmentor : intel cvsdk supports Mog2

    Threshold and add weights outputs are fed to video object files (APIs ‘addWeighted’ , **** ‘threshold’)

  5. People Count The copy of the original frame is sent into the setup function which uses HOGDescriptor.

    Detect and draw function predicts the people, adjusts the boundary boxes and returns the count.

  6. Uploading Depending on the user requirement, change the number accordingly for the time difference delay the snaps have to be uploaded to the cloud.

    frame count=total number of frames frame= count generated for the requested snap to occur

  7. The upload.sh system call is initiated where the particular output frame goes through node.js script and the output frame gets uploaded to the cloud.

  8. A complete heatmap is set as an overlay on the first frame of the video for understanding the footfall in that entire video.

store-aisle-monitor's People

Contributors

intelcpdp avatar fromgilbert avatar w4ilun avatar

Watchers

James Cloos avatar Abraham Arce avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.