Image process & recognition implementation on Linux. How to? - linux

Usually I develop image processing or recognition programs on windows. But I got a customer who requires me to implement one on Linux platform.
Because his platform is embedded system, I don't know for sure that OpenCV would be available. Could anyone give me some clue to get started?

You can package OpenCV with your application.
The word 'embedded' makes me nervous - image recognition can be very computationally expensive. You may need to roll your own code to fit the target constraints.
The starting point of your own code is likely to implement a Haar-like recogniser.
This is of course what you'd likely be using OpenCV to do. A more ambitious recogniser is HOG. Here's a nice comparison of them.

OpenCV is in standard repositories for Ubuntu and/or Debian Linux. As such it should run on many processors including ARM. If it runs a full Debian, it is a matter of apt-cache search opencv, then install the modules you want via apt-get install.
The big gotcha is the embedded part. If it doesn't run a full Linux, then you may end up compiling for a very long time. Cross your fingers it runs a full Linux (like Debian.)

Adaboost should be a good fit for use as a learning algorithm. Paul Viola and Michael Jones have an interesting paper on efficient face detection using Adaboost and Haar classifiers. There's a lot of math there, but it's worth reading.

Related

Running stable-diffusion on graphcore IPU's

I have been looking for a version of Stable-Diffusion which would be able to run on the IPU's. Currently (due to the high availability) so far I can find CUDA based ones only.
Now I wonder if there is a way to run scripts/trainers/learning etc that are Cuda based on IPU? For example a translation program in between.
I doubt there is, and I bet as I cannot find a IPU version I'll have to modify the scripts :(.
There is the HuggingFace optimum library which acts as the interoperability layer for transformers to run on IPUs. You can find Stable Diffusion there.
For other models that are not supported in the library, there's a guide on how you could modify your script to make it IPU-compatible here

Agent Based Coalition Bargaining Model on Python

I am trying to run some simulation on Python for a social network in which agents play a coalition bargaining game. Which package is the most suitable for my needs? Are there examples that I could use when constructing my own code?
The documentation for mesa is a good place to start. Also their GitHub has a solid number of examples that you can pull from. I have found that the developers of Mesa are super responsive to their GitHub issues as well (almost always responding within a matter of hours) so that has been helpful to me as I've found things that needed fixing in the tutorials.
I have also found it helpful to go off of some of the example models included in NetLogo when you install it (see https://ccl.northwestern.edu/netlogo/models/). It is not in Python of course, but it is helpful to see how they set it up and is relatively easy to implement their ideas in python with mesa.
In regards to which package would be most suitable, I think it would depend on how large of a simulation you are hoping to run. Mesa has been good for smaller/medium scale simulations, but if you are hoping to run something huge you may need to look elsewhere.

Linux implementation of VISA API

Do you know any Linux implementations of Virtual Instrument Software Architecture? Even simple and restricted? Free and open-source implementations are preferred.
Only implementation I know is NI VISA which is non-free and closed-source. Moreover, it runs on very limited number of Linux distributions. I don't know whether it is possible to run it on Debian, for instance.
Thanks.
Well, what do you need it to do? I have been working on a pure Python instrument library that can communicate over several different protocols (serial, VXI-11 (LXI), GPIB (linux-gpib), and PyVISA) called python-ivi, located here: http://www.github.com/alexforencich/python-ivi . It is an interpretation of the Interchangeable Virtual Instruments specification. It's not VISA, though, so if you specifically need VISA, it's not going to help you.
It's written in python 3 and tested in linux, but it should be cross-platform as it is pure python. The implementation of VXI-11 in python-vxi11 is also pure python and therefore should also be cross-platform.
The project is still in relatively early development in terms of the higher-level drivers and abstractions, but it does basically everything PyVISA does for low-level interfacing.
I have the same issue. Googling this for a bit only yields the 7 year old (2005) Open Visa which I haven't tried.
NI VISA is tricky to get to work with Debian and Ubuntu, but I have seen post with people claiming success at least for kernels before 3.x see eg:
http://ubuntuforums.org/showthread.php?t=1665036
and
https://decibel.ni.com/content/thread/7232
Good luck to you. I will probably try Open Visa and perhaps give NI VISA a shot and report back if it works.
Have you heard of PyVisa? It's an open source, cross-platform VISA implementation written in/for Python.
http://pyvisa.sourceforge.net/
It seems to rely on a VISA dynamically-linked library coming with your equipment
(see here: http://pyvisa.sourceforge.net/vpp43.html#about-the-vpp43-module)
so it may not solve your problem, but it's worth a look.

High-level level language for image processing

My final year project group is planning to build a real time application with neural network support and need to handle image processing efficiently, Any language suggestions would be very much helpful. Thanks.
Mathematica may offer some useful features. The last couple of releases have added quite a lot of image processing functionality. You can get a taste by looking at these blog entries:
How to Make a Webcam Intruder Alarm with Mathematica
The Battle of the Marlborough Maze at Blenheim Palace Continues
The Incredible Convenience of Mathematica Image Processing
Mathematica is an interpreted language, which would appear to present an obstacle to your real-time constraints. However, Mathematica has always integrated well will foreign code (notably C, Java and .NET) and the latest release adds considerable new capabilities with respect to C-code generation, dynamic-library loading and CUDA / OpenCL GPU programming.
Alas, Mathematica is not FOSS and is pretty expensive for commercial use. However, they give great student discounts (90%+, last time I checked) and some college/university departments have site licenses.
On the down side, the Mathematica language is quite unconventional and it takes time to get into the swing of things. IMO, the effort is worth it, but the learning curve might be too long if your project timelines are short.
Note: I am not affiliated with WRI in any way.
My suggestion is OpenCV and C++. OpenCV is also usable with Python, but I don't recommend it if you need to write fast code, Python can be really slow.
How about Python? There is PIL, which
adds image processing capabilities to your Python interpreter. This library supports many file formats, and provides powerful image processing and graphics capabilities.
An introductory article about NN with python and a feed forward NN library:
http://www.ibm.com/developerworks/library/l-neurnet/
http://pypi.python.org/pypi/ffnet/0.6
Matlab provides a lot of features for image processing. May be slightly slow, but I assume performance is not an issue.
ImageMagick is suppose to be real good, but I have no first-hand experience. Mathematica?

Contributing to a Linux distribution

I'm interested in contributing to a Linux distro, but regarding the various distro's developer communities, I'm having a bit of trouble figuring out which one I'd most like to join.
What languages I know: C, C++, Lua, Python, and fairly familiar with Perl (though I wouldn't say I "know" it). In particular, I have very little experience with x86 assembly besides hacking stuff together for performance tweaks, though that will be partially rectified soon.
What I'm looking for: A community that provides plenty of opportunities for developers to work on various aspects of the distribution. To be honest I'm most interested in reading and working on the kernel source (in which case the distro doesn't matter), but it's pretty daunting and I figure getting into the Linux community and working with experienced Linux developers might give me a better idea of how to jump into the guts(let me know if this is bogus, or if you have any advice regarding that).
So...
Which distro has the "best" developer community in terms of organization, people who are fun to work with, and opportunities to contribute?
I've read various "Contributing to XXX" pages and mailing lists for distros like Ubuntu, OpenSuse, Fedora, etc. but I'd rather get a more personal testament from an actual developer.
Unless you have a specific desire to learn the ins and outs of various packaging formats you would probably be better off contributing directly upstream to applications/libraries that you find interesting. While individual distributions often have a few management applications that are unique(ish) to them most core applications and libraries are shared between them.
As you have expressed an interest in guts it would make sense to stick to one of the main community distros (Fedora and Ubuntu/Debian) as the rest tend to be variations on a base distro. The other option is to choose a source based distribution which have a number of advantages to developers although you may find yourself spending a bit of time keeping your machine trim.
As I'm a developer I personally use Gentoo which gives me a number of things:
Rolling release: New versions of applications are generally available soon after release
Stable/Unstable mix: I can run stable core with bleeding edge on upstream packages I care about
Development ready: Any installed package is by default a "dev" package, the distinction between buildtime/runtime dependencies is blurred
Packaging is easy: If it's a simple as "configure/make/make install" writing and ebuild is very easy.
Contribution is easy: Contributing new ebuilds is fairly painless, from there you can get as involved as you like
Of course there are downsides, not least of all your machine spends a considerable amount of time building things and if your run a large selection of "unstable" packages you may find you occasionally need to fix-up your machine. However I find these disadvantages minor compared to giving me an up to date platform with which to contribute to upstream from.
If you want to work with the kernel then you shouldn't be picking a distribution, but rather working upstream.
Somebody correct me if I'm wrong, but I think that contributing to Ubuntu can be very easy and fun if you use Launchpad. I haven't tried contributing code, but I contribute translations and file bugs on some projects.

Resources