Python GUI for Image Processing Applications_removed
Python GUI for Image Processing Applications_removed
The pillars of digital image processing are mainly built from 2 principal areas of interest:
1. High picture quality for predicting the humans correctly.
2. Processing is done on train dataset for our model to perform well.
In the latter, interest follows on performing the list of steps for extraction the desired
information from the image in a suitable processing format.
Image:
An image is nothing but a 2D light intensity function f(x, y), which signifies the brighter or
darker levels in an image at that point, for different spatial coordinates x and y. A digital image
is encoded in discrete values for both spatial coordinates and intensity level. We thereby form
an array of digital image, which comprises of image elements or pixel values.
A simple image model:
For computing processor suitability, the image is digitally encoded in both spatial coordinates
and function height. Such a digitalization done for coordinates is called image sampling.
Digitalization done for the intensity function is called gray-level quantization.
With the increase of picture quality resolution or pixel value, and gray levels, the storage also
increases which demands high processor for it.
Example: A gray-scale image of pixel value size 256x256 requires a space of 64k bytes of
memory.
3 Types of image processing
• Low level
• Medium level
• High level
A lower level processing is responsible for carrying out primary tasks like image reading,
resizing, rotating an image, converting color form (RGB to gray), drawing histograms etc. We
obtain the raw image after this processing. Medium level processing is used for extraction of
important features from the output of the previously formed image. It correctly identifies the
boundaries (edges) in an image, which is called segmentation. High level processing then adds
artificial intelligence concepts for making our system intelligent and smart to learn new things
by it.
13 | P a g e
3.2. FUNDAMENTAL STEPS IN IMAGE PROCESSING
2. Image pre-processing: enhancing the features of image such that the probability of success of
further steps performed increases.
4. Representing image: For applying the processing techniques, raw image is converted into
suitable format.
5. Image description: extracting such feature that differentiates the classes for objects.
SEGMENTING REPRESENTATION
. AND DESCRIPTION
PREPROCESSING
INTELLIGENT BLOCK
IMAGE
ACQUISTION
14 | P a g e
3.3. ELEMENTS OF DIGITAL IMAGE PROCESSING SYSTEMS
15 | P a g e
TABLE 3.3. DIFFERENT IMAGE FORMATS
Image Enhancement is the methodology of improving the quality and data content of the actual
information or data prior to processing. It is a way towards changing or adjusting of digital
images so that the outcomes which we obtain are more reasonable to show or to do further
image analysis.
16 | P a g e
For example-
Histogram Equalization is a method for changing image intensities to improve contrast of the
image. This strategy typically builds or increases the global contrast of numerous images,
particularly when the usable information of the image is addressed by close contrast values.
Fig 3.3- Enhancing grayscale images with the help of Histogram Equalization.
Median Filtering is a technique which is usually used to eliminate noise and disturbance from
images. This type of decrease in noise and disturbances is a typical pre processing step to
enhance the consequences of later processing.
17 | P a g e
3.4.1.3. UNSHARP MASK FILTERING
The unsharp Mask Filtering Technique is a basic technique which hones or sharpens the
operator which further gets it name from that it improves, sharpens and enhances edges
through a methodology which deducts smoothed, unsharped redintion of an image from its
original picture.
Edge detection is the way toward finding edges in a picture which is a vital advances towards
understanding picture highlights. It is accepted that edges comprise of significant highlights and
contains huge data. It altogether diminishes the size of the picture that will be prepared and sift
through data that might be viewed as less applicable, safeguarding and zeroing in exclusively on
the significant underlying properties of a picture for a business issue.
18 | P a g e
Edge-based segmentation calculations work to identify edges in a picture, in view of different
discontinuities in grey level, shading, surface, brilliance, immersion, contrast and so on To
additional upgrade the outcomes, advantageous preparing steps should follow to link every one
of the edges into edge chains that relate better with borders in the picture.
19 | P a g e
CHAPTER – 4
BUILDING A GUI USING PYTHON
4.1. STEPS FOR CREATING GUI
There are several steps involved in creating GUI for an application such as importing a desired
module which is best fit for the application, then adding various widgets like button, list box,
etc and implementing the geometry managers for improving the GUI layout. And finally, we can
ensemble our model by adding key elements from other GUIs.
20 | P a g e
TOP, BOTTOM, LEFT, RIGHT. By default, the program considers the function TOP, until
mentioned by the user.
>> b.pack()
The window adjusts itself according to the button size. The pack manager places the widgets in
horizontal or vertical direction only. For placing the widget in any other way, we use GRID
manager that uses x and y coordinates for placing the widget.
21 | P a g e
4.1.5. ADDING SOME WIDGETS
4.1.5.1. BUTTONS
4.1.5.2. CANVAS
It is used in drawing pictures and some complex layouts like texts, graphics and widgets.
22 | P a g e
4.1.5.3. CHECKBUTTONS
The user can select any option from variety of options available as a toggle buttons.
4.1.5.4. ENTRY
This widget allows the user to input the single line test.
4.1.5.5. FRAME
It acts a main window that comprises of all the widgets. It is also used for organizing and
arranging the widgets.
23 | P a g e
4.1.5.6. LISTBOX
It provides user list of options to choose from.
4.1.5.7. MENU
It is used to create all kinds of menu options used in an application.
4.1.5.8. MESSAGE
It is a multi line text. It cannot be edited once declared by the user.
24 | P a g e
4.1.5.9. RADIOBUTTON
The user can choose one option from the several options available.
4.1.5.10. TEXT
It is used to format or edit the multi line text.
4.1.6.1 TKINTER
Tkinter is one of the most commonly used python library for developing GUI. It doesn’t require
any license for the users to use, hence it is a free software. Tkinter is compatible with many
major platforms like Unix, Linux, Microsoft windows, Mac OS, etc. It has many built in features
to create various widgets like buttons, check buttons, menu button, allows user to write a text
on or around an image and many other options. Although Python has several options available
for GUI designing for applications like PySimple GUI, Wax, PySide, Libavg, tKinter, PyQt, Kivy,
etc; out of these tKinter is the fastest and easiest way to create GUI applications. Creating a GUI
using tKinter is an easy task. Tkinter is pre installed in Python 3, so the user don’t have to install
it separately.
25 | P a g e
4.1.6.5 IMAGEOPS MODULE IN PILLOW LIBRARY
ImageOps Module in Pillow Library contains various instant image processing operations. This
module to some degree is trial or experimental, and mainly operators work on L amd RGB
images.
4.1.6.8 NUMPY
NumPy is one of the most important or in other words one of the main libraries in Python as it
provides support for arrays. An image is essentially a standard NumPy array containing pixels of
data points. Therefore, pixel values of an image can be modified by using
basic NumPy operations, such as slicing, masking, and fancy indexing.
26 | P a g e
CHAPTER – 5
APPLICATION PROTOTYPE
Fig 5.1
27 | P a g e
5.2 DROPDOWN MENU
This Image Editor can edit photos by selecting the images present in the secondary storage of
the device.
Fig 5.2
28 | P a g e
5.3 SELECTED AN IMAGE
After clicking on “Select Image” from the dropdown menu the image will be selected.
Fig 5.3
29 | P a g e
5.4 CROPPED IMAGE AND OTHER EDITING FEATURES
We can crop the selected image by clicking on “Editing” button and a dropdown menu will
appear from which we can further select “Crop” button and it will automatically crop the image
So that the image fits perfectly in the canvas of the Image Editor.
Fig 5.4
30 | P a g e
5.5 APPLIED FILTERS IN THE IMAGE
Now moving on, if we want to change the enhancements of the image then we can select the
Automatic Mode and it will directly change filters and brightness of picture and enhance the
image. If we want to enhance the image by using more filters then custom filters options is also
available and we can select other filter and effects.
Fig 5.5
31 | P a g e
5.6 NEW ADDITIONS IN THE GUI
I have added to new buttons in the Image Editor GUI which are-:
Image Segmentation
Image Enhancement
Fig 5.6
32 | P a g e
5.7 ENHANCEMENT FILTERS
On clicking the Enhancement button three image enhancement techniques will appear which
are-
Histogram Equalization
Median Filtering
Unsharp Mask Filtering
Fig 5.7
33 | P a g e
5.8 HISTOGRAM EQUALIZATION
On clicking Histogram Equalization a slider will appear which will be numbered 1 to 10, and
using which we can apply this technique.
Fig 5.8
34 | P a g e
5.9 MEDIAN FILTERING
On clicking Median Filtering a slider will appear which will be numbered 1 to 10, and using
which we can apply this technique.
Fig 5.9
35 | P a g e
5.10 UNSHARP MASK FILTERING
Fig 5.10
36 | P a g e
5.11 SEGMENTATION FILTER
Fig 5.11
37 | P a g e
5.12 EDGE BASED SEGMENTATION
Fig 5.12
38 | P a g e