Giter VIP home page Giter VIP logo

example-signal-from-rgb565-frame-buffer's Introduction

Edge Impulse Example: classifying RGB565 frame buffer data

The Edge Impulse inferencing SDK expects a signal_t structure that contains sensor data - this is done so you don't need to load the full data into memory, but rather can page data in when needed. This signal_t structure expects data to be laid out in RGB888 format, but many cameras output data in RGB565 format instead. Additionally the classifier expects data in set dimensions (defined in EI_CLASSIFIER_INPUT_WIDTH / EI_CLASSIFIER_INPUT_HEIGHT) which might not be a native resolution of the camera. This example shows how to directly interact with an RGB565 frame buffer, by converting the data on the fly, and by creating a cutout when the resolutions don't match.

How to use this example

This is a full demonstration application that runs on macOS and Linux, but you'll only need the r565_to_rgb and cutout_get_data functions, plus the defines from main.cpp, on your embedded device. These functions have no external dependencies and build on any system where the Edge Impulse classifier runs.

To run this application:

  1. Install the dependencies listed in Running your impulse locally on your desktop computer.

  2. Build the application:

    $ sh build.sh
    
  3. Run the application:

    $ ./build/edge-impulse-standalone
    

This has now created two files:

  • framebuffer.bmp - a 'fake' framebuffer that was created in RGB565 format.
  • from_signal.bmp - the image as received by the classifier. This went through RGB565->RGB888 conversion, and through the cutout.

How to test squashing/resizing

Instead of just cutting out part of the image, you can also just crop down to the same aspect ratio, then squash/resize (bilinear interpolation) the rest of the image. This preserves more of your frame. To try this, run the following

make squash

Then run the application, same as above.

Questions?

Let us know on the forums.

example-signal-from-rgb565-frame-buffer's People

Contributors

alex-eee avatar janjongboom avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

szf2020

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.