Professional Documents
Culture Documents
BARRILJhanRayG - MEC 4261 Experiment 3
BARRILJhanRayG - MEC 4261 Experiment 3
Submitted by:
BARRIL, JHAN RAY G.
Submitted to:
ENGR. HKV
18 FEBRUARY 2024
Document Code FM-SEA-018
Revision No. 00
Saint Louis University Effectivity Feb 01, 2021
School of Engineering and Architecture Page 1 of 12
Experiment No: 3
Title: Open CV Fundamentals
TLO 3: To be familiarize with python Open CV in Google collab and upload image
samples
I. INTRODUCTION:
OpenCV is a cross-platform library using which we can develop real-time computer vision
applications. It mainly focuses on image processing, video capture and analysis including features
like face detection and object detection. In this tutorial, we explain how you can use OpenCV in
your applications.
OpenCV was originally developed in C++. In addition to it, Python and Java bindings were
provided. OpenCV runs on various Operating Systems such as windows, Linux, OSx, FreeBSD,
Net BSD, Open BSD.
Computer/Laptop
Google Collab or Open CV
III. PROCEDURES:
Instruction: Follow the instruction provided in the google collab but use your own image for the
experiment. Also provide a 2-page Discussion of Theory Research to be attached at the back of
this experiment manual. Arial 11 1.5 spacing.
In 2012, the introduction of AlexNet propelled computer vision. The computers were not
just recognizing images but they were doing it incredibly well. Since then, computer vision has
exploded onto the scene, finding its way into various aspects of our lives, from assisting in medical
research to powering self-driving cars. While there are still hurdles to overcome, like making sure
it's fair for everyone, the future of computer vision looks bright, with ongoing advancements
promising even greater possibilities ahead.
Moreover, computer vision is a field within artificial intelligence and computer science, that
focuses on enabling computers to interpret and understand the visual world. It aims to replicate
the human visual system's ability to perceive, analyze, and interpret visual data from the
surrounding environment but then it started from animals. This includes tasks such as object
recognition, image classification, scene understanding, and image reconstruction. Computer
vision algorithms often utilize techniques from image processing, pattern recognition, machine
learning, and deep learning to extract meaningful information from visual data.
OpenCV originated from Intel in 1999. This open-source library grew powerful for
Computer Vision and Machine Learning, due to the efforts of developers like Gary Bradsky and
Vadim Pisarevsky. Its involvement in projects like Stanley, the 2005 DARPA Grand Challenge
winner, highlighted its importance, and it continues to evolve under Willow Garage's support. With
compatibility across various programming languages (like C++, Python, and Java) and platforms
(including Windows, Linux, OS X, Android, and iOS), OpenCV offers immense flexibility. It even
supports high-speed GPU operations through CUDA and OpenCL.
OpenCV-Python, the Python API for OpenCV, brings the library's capabilities to Python
developers, combining the performance of C/C++ with Python's ease of use. Its integration with
Numpy allows for efficient manipulation of arrays, enhancing interoperability with other Python
libraries like SciPy and Matplotlib. The OpenCV-Python tutorials offer comprehensive guidance
on using OpenCV with Python, focusing primarily on version 3.x.
Figure 15. Finding Pixel of 717 x 1215 Image (Using 716 x 1214)
V. Matrix Slice
a. Screen of a sliced image
In this experiment, I initially observed familiarity with the format of the activity in relation to
the past experiments that involved Arduino IDE. With the use of Google Colab, the notebook that
was provided, allowed me to explore the OpenCV fundamentals. As simple as opening files,
determining an image’s size and pixels, and in allowing me to practice simple image processing
techniques such as color manipulation, slicing and region setting. Here are further observations:
Upon getting OpenCV Python started, I noticed the importance of importing the OpenCV
library and some of its functions first in order to work on the next steps of the experiment. After
that, I only had to substitute the URL of my test image “Teemo” to the code prepared in the entire
notebook. After substituting to all “noimage.jpg”, I just had to run the codes to determine the image
size, shape and data type and execute some color manipulation or image processing techniques.
One key note when it comes to using OpenCV, is that it stores images in BGR format
instead of RGB. Next, the channels can be split into different channels; b, g, and r. Changing the
r from [plt.imshow(r,cmap=’gray’)] to b makes the image very dark while changing it to g makes a
little bit darker. Merging the three channels will output the original colors of the image as uploaded.
Furthermore, as I am exploring the color flags, I have observed that not all of them are displayable
and there were some color flags with different names output the same image.
The next segment, discusses how the images in python OpenCV are actually numpy
arrays. Instead of determining the area of the image pixel by pixel, it can be accessed through
matrix. The array manipulation is a relevant practice particularly in slicing.
As a conclusion, this experiment is integral in establishing how OpenCV can be relevant
in image processing. Being a huge open-source library, it becomes a stepping stone for computer
vision and machine learning enthusiasts and also those who aim to teach or learn how to process
images, identify objects, faces and more.
Demush, R. (2019, February 26). A brief history of computer vision (and convolutional neural
networks). HackerNoon. https://hackernoon.com/a-brief-history-of-computer-vision-and-
convolutional-neural-networks-8fe8aacc79f3
Pujara, A. (2020, November 5). Concept of AlexNet:- Convolutional Neural Network - Analytics
Vidhya - Medium. Medium. https://medium.com/analytics-vidhya/concept-of-alexnet-
convolutional-neural-network-6e73b4f9ee30
Shiksha Online. (2024, February 1). Amazing applications of OpenCV in Python - Shiksha online.
Shiksha.com. https://www.shiksha.com/online-courses/articles/amazing-applications-of-
opencv-in-
python/#:~:text=OpenCV%20finds%20applications%20in%20various,%2C%20surveillan
ce%2C%20and%20autonomous%20vehicles.