Ask Your Question
0

Opencv on Raspberry Pi running c

asked 2014-05-08 01:47:23 -0600

updated 2014-05-08 01:58:31 -0600

berak gravatar image

How can I download and build opencv on a raspberry pi, but using C? i want to program in C and all the instructions I have seen about the Raspi and Opencv is by using Python. Does anyone know if this is possible? thanks

edit retag flag offensive close merge delete

Comments

1
  • the good news is, that you can use c++ for coding on a raspi, too.

  • the bad news (if you really meant C) is, that they moved away fom the arcane c-api long years ago, it's no more developed, and you can only reach half of opencv's functionality. - so you really should not start any new project using that.

berak gravatar imageberak ( 2014-05-08 02:54:49 -0600 )edit

All hail to @berak! Lets stop encouraging people using the C-API!

StevenPuttemans gravatar imageStevenPuttemans ( 2014-05-08 04:08:23 -0600 )edit

Give C++ a try and install OpenCV and QT Creator on your RPI I haven't documented how I installed them, but it works for me: http://www.realgentlemen.dk/MediaWiki/index.php?title=Raspberry_Pi_Cameras

RG Sneaker gravatar imageRG Sneaker ( 2014-09-05 04:49:29 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2014-10-11 22:24:15 -0600

Sync gravatar image

Well, I ran into the same issue. I'm perfectly happy to code in C++, but I had some existing code written in C that I wanted to tie into as well without having to re-code it in C++. Fortunately, it's possible to do both-- I ended up creating a simple C++ file that wrappered the necessary calls for C, and then was able to add my C source and call the C++ functions as needed. It works fine and wasn't very hard to do. In my case main() is in C but it can be done the other way as well with C++ calling C. Now I have a project with a makefile that includes the two source files (right now there's only two because it's a very simple project), where I can code stuff in either C or C++ as is convenient and just put it in the right file for it...

edit flag offensive delete link more

Question Tools

Stats

Asked: 2014-05-08 01:47:23 -0600

Seen: 1,875 times

Last updated: Oct 11 '14