Image Processing With Python Libraries
Image Processing With Python Libraries
2, 2023
This is an open access article distributed under the Creative Commons Attribution License
Copyright ©2017. e-ISSN: 2520-789X
https://doi.org/10.25007/ajnu.v12n2a1754
ABSTRACT
Today, computer vision is considered one of the most important sub-fields of artificial intelligence, due to
the variety of its applications and capabilities to transfer the human ability to understand and describe a
scene or image to the computer, so that it becomes able to recognize objects, shapes, colors, behavior and
other capabilities of understanding the image. Image processing is one of the branches of computer science,
and it is a way to perform some operations on an image in order to obtain an improved model for this
image or extract some useful information from it. Often the data that is collected is primary data, meaning
that it is not suitable for direct use in applications, so its need to analyze or pre-process it and then use it.
For example: to build a data set that has been used in a model that classifies images as to whether they
contain a house or not, depending on an image as input for this program. Our first step will be to collect
hundreds of house images, but the problem is that these images will not be of the same dimensions, for
example, so it’s to Change its dimensions, i.e., processing it in advance before submitting it to the model.
The above is just one of the many reasons why image processing is important for any computer vision
application
Keywords: Python, OpenCV, Computer Vision, Image Processing.
410
Academic Journal of Nawroz University (AJNU), Vol.12, No.2, 2023
411
Academic Journal of Nawroz University (AJNU), Vol.12, No.2, 2023
Figure 4: SimpleITK
4.6 Mahotas
It is also one of the libraries used in image processing,
and in addition to its fast performance and the ability to
add effects with simple code, the Mahotas library can
dispense with the Nambay library as a helper library for
reading images as arrays, as it reads them directly as an
array, which simplifies the code and conversions even
more [8].
Figure 3: PIL
412
Academic Journal of Nawroz University (AJNU), Vol.12, No.2, 2023
1_Include Mahotas library. 6_ Multiple attributions to two converts for the same
2_ Include the matplot graphing library. image (Raed al-Qada’s image).
3_ Read the image and assign it to a variable (it must put 7_ Determine the size of the circle (it has defined the face
the path and name of the image, or its name suffices if it within the circle)
is in the project file). 8_ The size of the window lines (starting from any line
4_ Preparing to show the picture has specify).
5_ Show the image within the previous step. 9_ The size of the window columns (starting from any
6_ Finding the number of pixels that belong to each color column has specify).
gradient in the form of a graphic representation, and this 10_ Prepare a matrix with the dimensions of the rows
is what is known as a histogram, using the function () and columns of the specified window.
fullhistogram and assigning it to a variable (matrix). 11_ Using a function to determine the edges that takes
7_ Preparing window to show the histogram. the image, the size of the window within which the
8_ Histogram drawing within the window. processing will take place, the step length when defining
9_ Show an interface containing images. the edge, the smoothing rate when defining the edge,
The result, as shown in Figure (5): and the time of the learning step (mathematically, these
coefficients are the differential equation coefficients that
work to detect edges).
12_ Preparing an interface to show the images and
placing two windows for the original image and the
modified image.
13_ Putting the modified image in the second window.
14_ Show the circle (window) in red.
15_ Show the detected edges in blue.
Figure 5: Mahotas 16_ Show coordinate axes.
The diagram in Figure (5) shows that most of the colors 17_ Show numbering on the coordinate axes.
within the image are white or close to white, and this is 18_ Putting the original photo in the first window.
what its seeing in the image that “contains many white 19_ Display the interface with pictures.
areas.” The result is as shown in Figure (6):
4.7 Scikit_image
Also called skimage, it is an open source package
designed for image processing. If you have previously
dealt with the sklearn library, using skimage is a piece of
cake for its ease of handling. Even if you are new to
Python, sk Skimage is easy to learn and use [9].
The SK library is built on the libraries Numpy,
Matplotlib and scipy and must be present when using
the skimage image.[10] Figure 6: Scikit_image
It supports a large number of image processing 4.8 TensorFlow
algorithms that include segmentation, geometry, TensorFlow is a fast, flexible, and comprehensive system
filtering, features detection, and others [9]. for building machine learning systems. It is intended for
1_Include Nambay library. use with problems that have a clear conceptual structure,
2_ Include the matplot graphing library. in particular, problems that can be expressed as a linear
3_ Include the data package (which contains some transformation of inputs (e.g., matrix factorization,
images for testing) from the SK image library. structured prediction, reinforcement learning, image
4_ Embed the submersible filter from the filters package recognition, and many others). For image classification,
from the SK image library. you can use an already pre-trained model that is
5_Include an edge selection function from the slicing available in TensorFlow for ease of use [11].
package from the SK image library.
413
Academic Journal of Nawroz University (AJNU), Vol.12, No.2, 2023
Approach and Embedded in an Image. Academic Journal of Nawroz University, 6(3), 1–10.
Nawroz University, 6(3), 40–45. https://doi.org/10.25007/ajnu.v6n3a70
https://doi.org/10.25007/ajnu.v6n3a76 [23] Abdulfattah, G. M., Ahmad, M. N., & Asaad, R. R.
[13] Rajab Asaad, R., & Masoud Abdulhakim, R. (2021). (2018). A reliable binarization method for offline signature
The Concept of Data Mining and Knowledge Extraction system based on unique signer’s profile. INTERNATIONAL
Techniques. Qubahan Academic Journal, 1(2), 17–20. JOURNAL OF INNOVATIVE COMPUTING
https://doi.org/10.48161/qaj.v1n2a43 INFORMATION AND CONTROL, 14(2), 573-586.
[14] Asaad, R. R., Ahmad, H. B., & Ali, R. I. (2020). A [24] Almufti, S. M., Ahmad, H. B., Marqas, R. B., &
Review: Big Data Technologies with Hadoop Distributed Asaad, R. R. (2021). Grey wolf optimizer: Overview,
Filesystem and Implementing M/R. Academic Journal of modifications and applications. International Research
Nawroz University, 9(1), 25–33. Journal of Science, Technology, Education,and
https://doi.org/10.25007/ajnu.v9n1a530 Management, 1(1),1-1.
[15] Asaad, R. R. (2019). Güler and Linaro et al Model in [25] Asaad, R. R., Sulaiman, Z. A., & Abdulmajeed, S. S.
an Investigation of the Neuronal Dynamics using noise (2019). Proposed System for Education Augmented Reality
Comparative Study. Academic Journal of Nawroz Self English Learning. Academic Journal of Nawroz
University, 8(3), 10–16. University, 8(3), 27–32.
https://doi.org/10.25007/ajnu.v8n3a360 https://doi.org/10.25007/ajnu.v8n3a366
[16] Asaad, R. R. (2021). Penetration Testing: Wireless [26] Asaad, R. R. (2020). Implementation of a Virus with
Network Attacks Method on Kali Linux OS. Academic Treatment and Protection Methods. ICONTECH
Journal of Nawroz University, 10(1), 7–12. INTERNATIONAL JOURNAL, 4(2), 28-34.
https://doi.org/10.25007/ajnu.v10n1a998 https://doi.org/10.46291/ICONTECHvol4iss2pp28-34
[17] Almufti, S., Marqas, R., & Asaad, R. (2019). [27] Boya Marqas, R., M. Almufti, S., & Rajab Asaad, R.
Comparative study between elephant herding optimization (2022). FIREBASE EFFICIENCY IN CSV DATA
(EHO) and U-turning ant colony optimization (U-TACO) in EXCHANGE THROUGH PHP-BASED
solving symmetric traveling salesman problem WEBSITES. Academic Journal of Nawroz University, 11(3),
(STSP). Journal Of Advanced Computer Science & 410–414. https://doi.org/10.25007/ajnu.v11n3a1480
Technology, 8(2), 32. [28] Ihsan, R. R., Almufti, S. M., Ormani, B. M., Asaad,
[18] Asaad, R. R., & Abdulnabi, N. L. (2018). Using Local R. R., & Marqas, R. B. (2021). A survey on Cat Swarm
Searches Algorithms with Ant Colony Optimization for the Optimization algorithm. Asian J. Res. Comput. Sci, 10, 22-32.
Solution of TSP Problems. Academic Journal of Nawroz [29] Rajab Asaad, R., & Luqman Abdulnabi, N. (2022). A
University, 7(3), 1–6. Review on Big Data Analytics between Security and Privacy
https://doi.org/10.25007/ajnu.v7n3a193 Issue. Academic Journal of Nawroz University, 11(3), 178–
[19] Almufti, S., Asaad, R., & Salim, B. (2018). Review 184. https://doi.org/10.25007/ajnu.v11n3a1446
on elephant herding optimization algorithm performance in [30] Yahya Hussien , A., & Rajab Asaad, R. (2022).
solving optimization problems. International Journal of Review on Social Media and Digital Security. Qubahan
Engineering & Technology, 7, 6109-6114. Academic Journal, 2(2), 1–4.
[20] Asaad, R. R., & Ali, R. I. (2019). Back Propagation https://doi.org/10.48161/qaj.v2n2a119
Neural Network(BPNN) and Sigmoid Activation Function in [31] Asaad, R. R. (2022). Keras Deep Learning for Pupil
Multi-Layer Networks. Academic Journal of Nawroz Detection Method . Academic Journal of Nawroz
University, 8(4), 216–221. University, 10(4), 240–250.
https://doi.org/10.25007/ajnu.v8n4a464 https://doi.org/10.25007/ajnu.v10n4a1328
[21] Rajab Asaad, R. (2021). Review on Deep Learning [32] Asaad, R. R., & Segerey, R. I. (2018). School
and Neural Network Implementation for Emotions Management Application Using iOS. Academic Journal of
Recognition . Qubahan Academic Journal, 1(1), 1–4. Nawroz University, 7(4), 38–44.
https://doi.org/10.48161/qaj.v1n1a25 https://doi.org/10.25007/ajnu.v7n4a269
[22] Asaad, R. R., Abdulrahman, S. M., & Hani, A. A. [33] Asaad, R. R., Mustafa, R. F., & Hussien, S. I. (2020).
(2017). Advanced Encryption Standard Enhancement with Mortality Statistics and Cause of Death at Duhok City from
Output Feedback Block Mode Operation. Academic Journal of The Period (2014-2019) Using R Language Data
415
Academic Journal of Nawroz University (AJNU), Vol.12, No.2, 2023
Analytics. Academic Journal of Nawroz University, 9(3), 1–7. [39] Asaad, R. R., & Saeed, V. A. (2022). A Cyber
https://doi.org/10.25007/ajnu.v9n3a699 Security Threats, Vulnerability, Challenges and Proposed
[34] Asaad, R. R. (2021). A Study on Instruction Formats Solution. Applied Computing Journal, 2(4), 227-244.
on Computer Organization and Architecture. ICONTECH https://doi.org/10.52098/acj.202260
INTERNATIONAL JOURNAL, 5(2), 18-24. [40] Renas Rajab Asaad. (2022). Support vector machine
https://doi.org/10.46291/ICONTECHvol5iss2pp18-24 classification learning algorithm for diabetes prediction.
[35] Asaad, R. R. (2021). Virtual reality and augmented International Research Journal of Science, Technology,
reality technologies: A closer look. Virtual reality, 1(2). Education, and Management, 2(2), 26–34.
[36] Asaad, R. R. A Review: Emotion Detection and https://doi.org/10.5281/zenodo.6975670
Recognition with Implementation on Deep Learning/Neural [41] Ferinia, R., Kumar, D.L.S., Kumar, B.S. et
Network. al. Factors determining customers desire to analyse supply
[37] Asaad, R. R., Saeed, V. A., & Abdulhakim, R. M. chain management in intelligent IoT. J Comb Optim 45, 72
(2021). Smart Agent and it’s effect on Artificial Intelligence: (2023). https://doi.org/10.1007/s10878-023-01007-8
A Review Study. ICONTECH INTERNATIONAL [42] Poornima, E., Muthu, B., Agrawal, R. et al. Fog
JOURNAL, 5(4), 1-9. robotics-based intelligence transportation system using line-
[38] Asaad, R. R. A Asaad, R. R. A Review: Emotion of-sight intelligent transportation. Multimed Tools
Detection and Recognition with Implementation on Deep Appl (2023). https://doi.org/10.1007/s11042-023-15086-6
Learning/Neural Network.
416