Ask Your Question
0

Is it possible to build a small opencv library for embedded device, if i need only a few functions from opencv?

asked 2019-02-27 05:54:07 -0600

ravid gravatar image

updated 2019-02-28 00:40:58 -0600

This is needed for an embedded device which has very less memory.

It is a Arm Cortex M4 32 bit. board without any platform. So my application needs to be a bare metal application with a 4MB Flash memory and around 128KB of RAM.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2019-02-27 07:40:55 -0600

HYPEREGO gravatar image

updated 2019-02-27 07:41:45 -0600

You need to provide further information since this question is too general (which architecture are you going to use? What you're looking for? You have any memory/power constraints?)

The answer, in general, is yes, it is possible to do it, there exist also other project for embedded devices (OpenVx is an example of that). In my honest opinion if you need just few things and you need to optimize everything, a good idea can be rewrite the function from the scratch, eventually using a library that help you to manage the memory. It depend mostly on the architecture. For example, if you have a Xilinx platform, you can use their library which have most of the OpenCV functions.

edit flag offensive delete link more

Comments

It is a Arm Cortex M4 32 bit. board without any platform. So my application needs to be a bare metal application with a 4MB Flash memory and around 128KB of RAM.

I tried rewriting some API's by referring to OpenCV definitions from github, but the the definition itself calls so many different API's within OpenCV and thode different API's again refer to so many different that it becomes a web of API, wich makes me feel that I am trying to rewrite the entire openCV module.

So, probably if there is a way to compile specific modules from openCV lib or if there is a simpler way to rewrite the openCV API's, it will be a big help.

Any suggestions are welcomes. Thanks!

ravid gravatar imageravid ( 2019-02-28 00:13:01 -0600 )edit
1

ARM M4 support SIMD and have an hardware dedicated FPU as far as I remember, but 128kb or RAM can be a big problem since it is not a good amount of memory to work with, it can be ok if you have a frame buffer (most cameras have that) but is will be a big deal handle it.

Here a guy have talked about it, and as you can see, for an M4 is necessary to re-implement most of the code, and also the power of processor can't be enough for everything.

Maybe HERE you can find some resources.

I suggest you to eventually switch to another MCU or better platform if your project is cost insensitive and you don't want to waste a lot of time re-implementing a lot of things.

HYPEREGO gravatar imageHYPEREGO ( 2019-02-28 05:23:33 -0600 )edit

Thanks alot for your response, I will try to re implement some things and yes of course also try to get my Hardware changed. I will post a response here, if I get somewhere with it. Thanks once again.

ravid gravatar imageravid ( 2019-02-28 06:02:04 -0600 )edit
1

Best buy cheapest in world is RASPBERRY PI 3B/+ or PiZero

supra56 gravatar imagesupra56 ( 2019-02-28 07:25:32 -0600 )edit
1

@ravid You're welcome, if you think that my reply is ok for your question, mark it as correct answer, I really appreciate that since I'm a new user here :) In my honest opinion, it would be better to switch to another platform as @supra56 have suggested, because unless you have to work with a specific chip, others can provide to you more support and sufficient power to manage OpenCV without... become mad!! Otherwise, if you need low power and high efficiency, think about a FPGA, you can find a lot of papers regarding it, and Xilinx, as far as I know, provide a library to work with Stereo pipeline out-of-the-box (I've seen in in Xilinx HLS and Xilinx Vivado software)

HYPEREGO gravatar imageHYPEREGO ( 2019-02-28 07:41:45 -0600 )edit

@HYPEREGO. I agreed with you. But the neduino and beaglebone. arduino, etc, are ok because of cpu. Both are cheaper less than US$80.00. But I will not go for too expensives. There more like ornagepi, bananapi, asusTkinter, etc compared to raspberry pi are Ok.

supra56 gravatar imagesupra56 ( 2019-02-28 08:10:05 -0600 )edit
1

A Raspberry Pi 3 is the best idea indeed, it is cheap and it have sufficient power to manage most of the application..

HYPEREGO gravatar imageHYPEREGO ( 2019-02-28 08:32:52 -0600 )edit
2

If you can throw hardware at the problem (by using a faster/larger platform), then you can use standard complete libraries (like OpenCV) to solve your application's initial requirements. This simplifies the development of your software (e.g. python/opencv/ubuntu). Then, to run this on minimal hardware cost/power/etc. project, recall that a lot of the development cost in embedded software is in customizing the general purpose software to fit constraints of the target hardware (C++/libcv/small os). You might look into licensing your application in a way it may be statically linked with OpenCV, and having the linker not pull in modules that aren't needed - this avoids most of what's in opencv.

opalmirror gravatar imageopalmirror ( 2019-02-28 14:10:07 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2019-02-27 05:54:07 -0600

Seen: 1,610 times

Last updated: Feb 28 '19