Friday, 26 June 2015

Invert Masking/Filtering


Hi, In this tutorial, we will see how to use Aforge Invert Filter.

1

This is the Windows Form design of our demo application, in which two picture boxes were populated by original image and filtered/processed image. The filtration/masking will be executed within the specified rectangle coordinates.

2

This is the code of event handler specified under the Browse button. Through which desired image can be selected.

3

This is the code for apply Afroge filter of Invert operation. Filter will be applied within the rectangle specified coordinates.

4

The functionality of the application is improved by automatic selection of rectangle coordinates. When you move your mouse over the original image and click (left) starting coordinates (X,Y) will be selected pragmatically. By release the click (left) will populate the Height and Width of the Rectangle.

5

6

7

That's all from coding ....
The demo of our application is as follow:
By starting the application, click the Browse button will open the File Selection Dialog Box as shown below.

9

After selecting the Bitmap image, image will populate.

10

The selection of the desired region will be done by hovering the mouse over the original image and click to start and end the process of selection. Desired rects will automatically populated in specific boxes. After pressing the Apply Filter Button the invert filter will be applied as shown below.

11

The filtered image will be saved with suffix of "_filtered" i.e. "OrginalImageName_filtered".
The completed code of this tutorial can be downloaded from this link.

No comments:

Post a Comment