background preloader


AForge.NET is an open source C# framework designed for developers and researchers in the fields of Computer Vision and Artificial Intelligence - image processing, neural networks, genetic algorithms, fuzzy logic, machine learning, robotics, etc. The framework is comprised by the set of libraries and sample applications, which demonstrate their features: AForge.Imaging - library with image processing routines and filters;AForge.Vision - computer vision library;AForge.Video - set of libraries for video processing;AForge.Neuro - neural networks computation library;AForge.Genetic - evolution programming library;AForge.Fuzzy - fuzzy computations library;AForge.Robotics - library providing support of some robotics kits;AForge.MachineLearning - machine learning library;etc. The work on the framework's improvement is in constants progress, what means that new feature and namespaces are coming constantly.

Fuzzy Framework Introduction In the following article, we briefly introduce Fuzzy Framework library which supports calculations based on fuzzy logic in .NET. In past, there have been a couple of similar projects like the one described in [3], but no one matched exactly my requirements: Simplicity - everyone can understand the code, extend it, and make use of it throughout his systems. Support both of continuous and discrete sets. Support of arbitrary fuzzy sets as long as we can describe them by a group of polynomial functions. In the following text, we outline the basics of fuzzy logic and fuzzy set theory, focusing on how it differs from the standard, Boolean logic and from crisp sets. Fuzzy Sets 2.1 What’s the difference? Fuzzy systems become handy when someone intends to work with vague, ambiguous, imprecise, noisy, or missing information [7]. Figure 1 - Elements Apple and Pear belong to the set Fruits, whereas Carrot and Broccoli do not. Element x either is or is not a member of set Fruits. Examples

Double buffering Windows Forms Now contains code in Visual Basic. As much as we would like it not to be the case, graphics can be slow enough to watch as the screen is refreshed. Our eyes, sensitive to movement and particularly to edge detection so that we don't walk off of cliffs or run into trees, often pick up the redraw cycle of computer graphics which, at best is mildly annoying or at worst can cause headaches, eyestrain and in susceptible people, even fits. Much of this effect is caused by the sequential re-drawing of many graphical elements such as a chart with many lines or a game with many moving items. Windows Forms provides an automatic method of double buffering that can be used by simply setting a few styles in your form or control. First, take a look at the standard and built in method of double buffering. ControlStyles.AllPaintingInWmPaint ControlStyles.UserPaint ControlStyles.DoubleBuffer this .SetStyle( ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.DoubleBuffer, true ); else

jFuzzyLogic Fuzzy Computing: Basic Concepts Sample application (sources) - 46KSample application (binaries) - 27K (Note: The application's sources may be obtained also as part of AForge.NET Framework) Introduction: Fuzzy Computing Fuzzy Logic, the core of the Fuzzy Computing, was introduced by professor Lofti A. Zadeh in 1965, as an alternative approach to solve problems when the classical set theory and discrete mathematics, therefore the classical algorithms, are unappropriate or too complex to use. The Fuzzy Computing can handle qualitative values instead of quantitative values. "This man is tall";"That object is heavy";"Warm this food a little";"Increase the speed a lot". In all those cases, the meaning of tall, heavy, a little and a lot are relevant to solve the problem, and not the precise numerical value. Fuzzy Sets The classical logic defines the classical sets. Fuzzy approach extends the classical sets by letting the F(x) function returns a value in the [0,1] range. Fuzzy sets are represented by their membership function.

C# MIDI Toolkit Download demo project - 202.5 KB Contents Introduction This is the fifth version of my .NET MIDI toolkit. I had thought that the previous version was the final one, but I have made many changes that have warranted a new version. The toolkit has seen many revisions over the past two to three years. top Flow-based programming Before I get into the specifics of the toolkit, I would like to talk about its architecture. Investigating this problem led me to J. The idea is simple and will probably seem familiar to most: Data flows through a network of components. (Just to be clear: when I say "component," I'm not necessarily talking about classes that implement the IComponent interface. Below is a very basic network of components designed to handle the flow of MIDI channel messages: The flow of messages begins with the input device. Implementing flow-based programming in C# Well, this is something I really struggled with. How about sinks, those objects that can receive MIDI messages? MIDI messages

Using the LockBits method to access image data Many image processing tasks and even file type conversions, say from 32 bit-per-pixel to 8 bit-per-pixel can be speeded up by accessing the pixel data array directly, rather than relying on GetPixel and SetPixel or other methods. You will be aware that .NET is a managed code system which most often uses managed data so it's not often that we need to gain access to bytes stored in memory anymore however, image manipulation is one of the few times when managed data access is just too slow and so we need to delve once again into the knotty problems of finding the data and manipulating it. Before I start on the subject in hand, I'll just remind you that the methods used to access any unmanaged data will be different depending on the language in which your program is written. C# developers have the opportunity, via the unsafe keyword and use of pointers, to access data in memory directly. Lock up your bits The BitmapData class contains the following important properties; Finding the right byte.

UTILISATION DU COMPOSANT PROPERTYGRID, Tutoriel N°490, Introduction Le PropertyGrid est ce fameux composant que l'on peut voir dans Visual Studio pour lister les propriétés des contrôles par exemple ... Dans mon exemple, j'ai créé: 1 Form nommée Form1 1 PropertyGrid nommé PropertyGrid1 sur Form1 1 classe Personne Tutoriel Pour utiliser le Property Grid, il faut 1 - glisser un composant PropertyGrid depuis la boite à outils (Tous les Windows Forms) sur la Form désirée 2 - définir une classe qui contiendra toutes les propriétés que le PropertyGrid devra afficherPour cela, on peut soit utiliser un diagramme de classes, soit écrire sa classe directement. Important : faire un import de System.ComponentModel puis définir pour chaque accesseur CategoryAttribute ; en effet c'est la valeur affectée à CategoryAttribute qui créera ou non des catégories. Voici le code de la classe Personne: Les champs de type bool disposent d'une ComboBox pour changer la valeur dynamiquement depuis le PropertyGrid propertyGrid1.SelectedObject = opersonne; Conclusion

Using Unsafe Code for Faster Image Manipulation Over the past couple months, I've had a lot of traffic (well a lot for me anyway) going toward my various image editing posts. While the general concepts are there, I get a decent number of people complaining that they're a bit slow. They are slow when the image gets to be rather large. The reason for this is because I intentionally use two functions that are incredibly slow, GetPixel and SetPixel... These functions have to figure out the format that the image is actually displayed in, and give us/set the individual pixel in the image. That alternative is by using unsafe code. OK, well maybe a little bit more is needed. Getting back to the unsafe keyword, the advantages of using pointers and unsafe code is it gets rid of a lot of bounds checks, etc. that slow down your code. The two functions that were slowing us down were GetPixel and SetPixel. 1: internal static BitmapData LockImage(Bitmap Image) 3: return Image.LockBits(new Rectangle(0, 0, Image.Width, Image.Height), 7: return 3;