Vizzion
Vizzion is one of the most important project I started. For the moment it don't do much, but will do more in a few month.Vizzion is an image processing library that is made for embedded system and real time processing. For the moment, it do binarize, blob and few more little thing. I want it to be reliable and easy to enhance so easy to understand. One more thing is that it's made using template to support multiple format of images or even any kind of array management.
I added few examples for you to see.
Here is the basics:
- point - Coordinate in pixel on the image
- line - Represent the equation Ax+By+C=0
- segment - Represent an line using 2 points as extremity
- rectangle - A rectangle in the image with top-left corner with width and height
- plane - Plane in the image, RGB image as 3 planes while grayscale as one
- image - Regroup one or more planes of the same size
- action - Processing on the image (if you want to see some of possible processing, you can get on Gimp website, in the documentation you can have many operation on one or multiple image)
- scanner - The one that apply the action on the image on a scanning area
Sample Code :: Binarization
// Binarization sample
// Create an input plane, default is 8bits plane
plane image(640, 480);
// Create an output image the same size as the input
plane bin(image.Width(), image.Height());
// Create a scanning area over all the image
rectangle rc(point(0, 0), image.Width(), image.Height());
// Create the action to do on the input image
binarize_lower<> binarizer(40);
/////////////////////////////////////
// Add information you want to the //
// input plane in this section //
/////////////////////////////////////
// Scan the plane using the specified information, input,
// output, scanning area, and action
Scan<unsigned char, unsigned char,
rectangle_scanner_2<unsigned char, unsigned char> >(
image, bin, rc, binarizer);
Sample Code :: Binarizer
template <typename T1 = unsigned char, typename T2 = unsigned char>
class binarize_upper : public action_2<T1,T2>
{
public:
typedef rectangle_scanner_2<T1, T2> default_scanner;
binarize_upper(T1 _threshold):
threshold(_threshold),
foreground(std::numeric_limits<T2>::max()) {}
inline virtual bool pre(
scanner_2<T1, T2>& scan
)
{
/*Nothing to be done*/
return true;
}
inline virtual bool execute(
scanner_2<T1, T2>& scan
)
{
if(scan.source() > threshold)
{
scan.destination() = foreground;
return true;
}
else
{
scan.destination() = 0;
return true;
}
return false;
}
inline virtual bool post(
scanner_2<T1, T2>& scan
)
{
/*Nothing to be done*/
return true;
}
private:
T1 threshold;
T2 foreground;
};

