I made a simple but nice photo editor with OpenCV. It can be used to edit photos, such as, adding simple effects, changing the brightness and the contrast, histogram equalization, face detection, etc. For the GUI, I use wxWidgets so it can be easily ported to the Linux operating system.
OpenCV is an open source computer vision library in C/C++. It provides us many APIs for image data manipulation. It is OS independent and optimized for real-time applications. Go to the OpenCV website and download the latest version. Install and check sample directory. Find some tutorials and enjoy.
wxWidgets is an OS independent open source GUI library. By using this library we can make an OS independent application. Check here at the wxWidgets website.
Here is the plan. We are going to make a photo editor software that is capable of:
The class for image manipulation is allocated in files mango.h and mango.cpp with name
When an image is loaded, it is kept in data member
I also did some experiments on color spaces. Adjusting the per-channel brightness and contrast of an image can give us an awesome effect depending on its color spaces. I used an algorithm that I found in this site. Since OpenCV will only put RGB on display, I have to do these: Convert image to target color space, do the adjustment that I want, and finally, convert it back to RGB to be displayed.
Unfortunately, I encountered a problem. The problem is that the algorithm is for RGB color space. I can't just use it for other color spaces. But, take a look at this:
Based on this table I think it is possible to apply the same algorithm for other color spaces besides RGB as long as they are in the same range.
Please notice that I only implemented the histogram curve for RGB color space only. If you change the color space, the histogram curve is no longer valid because of difference in range.
I implemented many basic functions of OpenCV here. I hope It might be useful for you to start learning about OpenCV.
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)