0

I am planning to use my raspberry pi 2 in an image processing project. Is there an OS which would be particularly helpful in this purpose? I was thinking about RISC OS, because I have read that it focuses more on the processor although it has less features.

I am a newbie with raspberry but I have time to get used to any OS you would suggest.

And my other concern is that, is raspberry pi is too slow for real time image processing purposes? Is it possible for me to interpret a 30fps image?

ozgeneral
  • 223
  • 4
  • 13

2 Answers2

3

On pretty much any modern system, and the different Raspberry models are no exception, the OS doesn't really get in the way of programs that just do their own thing. The OS does matter a whole lot if you're shuffling files in the file system - that's a shared resource - but your process memory is yours and the OS doesn't get involved as long as you stay in that area.

Technically this is made possible by the MMU (Memory Management Unit) in the CPU. The OS configures it for your program, and then this hardware component just watches over your program to ensure you stay withing your memory space. The OS is only woken up by the MMU if you stray outside (the famous SegFault).

By far the fastest solution is to use all 4 cores of a model 2, including its VFP (Vector Floating point) unit. You'll need a modern compiler for that. The most modern compiler I can find for Risc OS is an older GCC 4.7, not the more up to date GCC 4.9/5.0 versions.

You'd also want to use an existing image processing library so you don't have to reinvent the wheel. OpenCV is the usual choice for the Pi, and it runs on Linux. You'd be hard-pressed to write your own code as efficiently.

MSalters
  • 171
  • 4
  • I see, then what do people mean when they say risc os runs faster with processors? Do they mean risc os handles MMU tasks faster etc? Is it that significant in performance? – ozgeneral Oct 20 '15 at 16:47
  • And how can I learn how to use 4 cores and VFP together? Does GCC >4.7 automatically handles it? Is there a programming language that would work faster? (Im sorry that I am asking too many questions but this is a whole new level for me, I used to just code in computers. Any answer you will provide will in fact be quite helpful, please bear with me for a short while :) ) – ozgeneral Oct 20 '15 at 16:50
  • 1
    IIRC, each core has its own VFP unit. GCC can automatically handle it, if you tell GCC to do so. Using 4 cores requires threads which is handled more by libstdc++ (library) than gcc (compiler). Not really different from ordinary computers really. – MSalters Oct 20 '15 at 21:43
  • Thank you, I definitely make use of that. Does my choice of programming language make a difference? Would speed differ if I use C++ instead of BASIC? And again, why people think RISC OS will run faster if OS's do not get involved with the processing memory when a code is executed? – ozgeneral Oct 21 '15 at 08:24
  • @OE1: " people" don't think Risc OS is faster, "user 35952" does. Nobody voted for his answer. BASIC uses only one of the 4 cores, probably ignores the VFP, and in general is interpreted. Combine those and you're looking at a language that's about 25x slower than C++. – MSalters Oct 21 '15 at 08:29
  • That actually is a huge speed difference. Should I be worrying about the power consumption when it uses 4 cores? I have read that it consumes about ~700mA and I can supply up to 1A for now. Should I be prepared for a significant increase in current draw? – ozgeneral Oct 21 '15 at 13:25
  • 1
    @OE1: The whole Rpi with 4 cores active would draw 700-800 mA so you are safe with 1000 mA. You're not relying on the USB bus to power external devices? Because that should be added to the 800 mA. – MSalters Oct 21 '15 at 14:21
  • No I will only feed raspberry pi, so then it should be okay. I had just installed raspbian following your suggestion and I observed that it already has built in programs about python. Can I just work with python as efficiently as C (does it have similar equivalent libraries that you mentioned for C?) or should I just download gcc? – ozgeneral Oct 21 '15 at 17:01
  • (Last comment - this is not a discussion forum. Do post a new question if necessary). I'm not a Pyton expert but it's generally recognized as "reasonably fast for an interpreted language" but compiled languages such as C and C++ are a lot faster. But if you use OpenCV with Python it doesn't matter as much. OpenCV itself doesn't become slower when you call it from Python. – MSalters Oct 21 '15 at 18:06
0

RiscOs was the original OS for the arm processor. This means, 27yrs on with faster processors that by far its the fastest, leanest OS for the pi.. If you buy the nutpi add on, this gets you (among other things) Photodesk, which is a highly capable photo editor, and much more responsive than gimp under raspbian.
Be prepared for a steepish learning curve with riscos, as the way it works can be very different to other os's but it has many things going for it.. a logical interface, screen use is cleverly maximised since menus only appear when you want them, the basic programming language is built in requiring no compiling, etc.. Good luck!

  • Great, I will go for RiscOs. Would it be faster if I program with basic or is it independent of the language I use? Do you think Raspberry pi 2 on RiscOs can achieve real time image processing? – ozgeneral Oct 20 '15 at 05:32