This document provides an overview and outline of a workshop on OpenCV, an open source computer vision and machine learning software library. The workshop will cover topics such as loading, displaying and saving images, histograms and histogram equalization, gamma correction, smoothing and noise removal, morphological operations, edge detection, image transformations, and adaptive thresholding. It will conclude by demonstrating how to build a basic document scanner using OpenCV functions. Code examples are provided for each topic to demonstrate the concepts.
This is the first part of the presentation series on one of the powerful open sources libraries, the opencv. this presentation is about the introduction, installation, some basic functions on images and some basic image processing on the images
Introduction to Computer Vision using OpenCVDylan Seychell
This is an introductory deck to computer vision using OpenCV and Python, through examples. This presentation is a step by step codelab through the basic functions of OpenCV.
This is the first part of the presentation series on one of the powerful open sources libraries, the opencv. this presentation is about the introduction, installation, some basic functions on images and some basic image processing on the images
Introduction to Computer Vision using OpenCVDylan Seychell
This is an introductory deck to computer vision using OpenCV and Python, through examples. This presentation is a step by step codelab through the basic functions of OpenCV.
Object Detection using Deep Neural NetworksUsman Qayyum
Recent Talk at PI school covering following contents
Object Detection
Recent Architecture of Deep NN for Object Detection
Object Detection on Embedded Computers (or for edge computing)
SqueezeNet for embedded computing
TinySSD (object detection for edge computing)
Computer vision has started to achieve some very impressive results over the last 5-10 years. It is now possible to quickly and reliably detect faces, recognize and localize target images, and even classify pictures of objects into generic categories. Unfortunately, knowledge of these techniques remains largely confined to academia. In this session we’ll go over some of the tools available, placing an emphasis on exploring the ideas and algorithms behind their design.
To show how these components can be put together, a sample system will be developed over the course of the presentation. Starting with standard image descriptors, we’ll first see how to do direct image recognition. We’ll then extend that into a simple object classifier, which will be able to distinguish (for example) between images which contain a bicycle and those that don’t.
In this presentation we described important things about Image processing and computer vision. If you have any query about this presentation then feels free to visit us at:
http://www.siliconmentor.com/
Object detection is a computer technology related to computer vision and image processing that deals with detecting instances of semantic objects of a certain class (such as humans, buildings, or cars) in digital images and videos. Well-researched domains of object detection include face detection and pedestrian detection. Object detection has applications in many areas of computer vision, including image retrieval and video surveillance.
Efficient and accurate object detection has been an important topic in the advancement of computer vision systems.
Our project aims to detect the object with the goal of achieving high accuracy with a real-time performance.
In this project, we use a completely deep learning based approach to solve the problem of object detection.
The input to the system will be a real time image, and the output will be a bounding box corresponding to all the objects in the image, along with the class of object in each box.
Objective -
Develop a application that detects an object and it can be used for vehicles counting, when the object is a vehicle such as a bicycle or car, it can count how many vehicles have passed from a particular area or road and it can recognize human activity too.
Object detection is a computer technology related to computer vision and image processing that deals with detecting instances of semantic objects of a certain class (such as humans, buildings, or cars) in digital images and videos.
A Small Helping Hand from me to my Engineering collegues and my other friends in need of Object Detection
Object Detection using Deep Neural NetworksUsman Qayyum
Recent Talk at PI school covering following contents
Object Detection
Recent Architecture of Deep NN for Object Detection
Object Detection on Embedded Computers (or for edge computing)
SqueezeNet for embedded computing
TinySSD (object detection for edge computing)
Computer vision has started to achieve some very impressive results over the last 5-10 years. It is now possible to quickly and reliably detect faces, recognize and localize target images, and even classify pictures of objects into generic categories. Unfortunately, knowledge of these techniques remains largely confined to academia. In this session we’ll go over some of the tools available, placing an emphasis on exploring the ideas and algorithms behind their design.
To show how these components can be put together, a sample system will be developed over the course of the presentation. Starting with standard image descriptors, we’ll first see how to do direct image recognition. We’ll then extend that into a simple object classifier, which will be able to distinguish (for example) between images which contain a bicycle and those that don’t.
In this presentation we described important things about Image processing and computer vision. If you have any query about this presentation then feels free to visit us at:
http://www.siliconmentor.com/
Object detection is a computer technology related to computer vision and image processing that deals with detecting instances of semantic objects of a certain class (such as humans, buildings, or cars) in digital images and videos. Well-researched domains of object detection include face detection and pedestrian detection. Object detection has applications in many areas of computer vision, including image retrieval and video surveillance.
Efficient and accurate object detection has been an important topic in the advancement of computer vision systems.
Our project aims to detect the object with the goal of achieving high accuracy with a real-time performance.
In this project, we use a completely deep learning based approach to solve the problem of object detection.
The input to the system will be a real time image, and the output will be a bounding box corresponding to all the objects in the image, along with the class of object in each box.
Objective -
Develop a application that detects an object and it can be used for vehicles counting, when the object is a vehicle such as a bicycle or car, it can count how many vehicles have passed from a particular area or road and it can recognize human activity too.
Object detection is a computer technology related to computer vision and image processing that deals with detecting instances of semantic objects of a certain class (such as humans, buildings, or cars) in digital images and videos.
A Small Helping Hand from me to my Engineering collegues and my other friends in need of Object Detection
this is the computer science project that i created for my friends to submit in the finals for 12th standard. the pages are jumbled up but other than that everything is good.
Face Recognition with OpenCV and scikit-learnShiqiao Du
A lightweight implementation of Face Recognition system with Python. OpenCV and scikit-learn.
Python, OpenCv, scikit-learnによる簡易な顔認識システムの実装. Tokyo.Scipy5にて発表。
FAST AND EFFICIENT IMAGE COMPRESSION BASED ON PARALLEL COMPUTING USING MATLABJournal For Research
Image compression technique is used in many applications for example, satellite imaging, medical imaging, video where the size of the iamge requires more space to store, in such application image compression effectively can be used. There are two types in image compression techniques Lossy and Lossless comression. Both these techniques are used for compression of images, but these techniques are not fast. The image compression techniques both lossy and lossless image compression techniques are not fast, they take more time for compression and decompression. For fast and efficient image compression a parallel computing technique is used in matlab. Matlab is used in this project for parallel computing of images. In this paper we will discuss Regular image compression technique, three alternatives of parallel computing using matlab, comparison of image compression with and without parallel computing.
CPSC 4040/6040
Computer Graphics Images
Assigned: Sept 21, 2022
Due: 11:59pm, Sept 30, 2022
Programming Assignment 3 — Green Screening (Grading: 0–10 points)
Problem Description
In this assignment you will develop two programs for doing green screening. Green or blue screening
is a process where a range of colors in an image (typically highly saturated greens) is used to
determine an alpha channel for the image, for purposes of compositing. The most familiar example
of blue screening is seen every night on the local news during the weather report. What you see on
the screen is the weather person standing in front of an animated weather map. Actually, he or she
is standing in front of a blue curtain or screen, and the map is simply on a TV monitor. The image
of the weather person is superimposed on the image of the weather map by an analog compositing
operation, that (in essence) treats the weather map as a background image, and assigns every pixel
of the foreground weather person image an alpha value of 0 wherever the image is blue and 1
wherever the image is not blue. Green screening works the same way, only with a green screen as
background.
Basic Requirements
First, you are to write code to generate an alpha channel mask for an image based upon image color
information. Second, you will complete an image compositing program that uses the alpha channel
information of a foreground image and computes the over operator. All final tests of your program
and your homework submission should use the green screened images available on the website. For
compositing, you can composite these pictures onto any background image that you choose. You
are also welcomed to test your code on your own green screened images.
Masking. Your first program should be called alphamask and it should take as input an image
and use its color information to produce a four channel version of the image. The RGB channels of
the image should remain unaltered, the only new data this program creates is the fourth α channel.
I expect that you will call the program by using:
alphamask input.img output.png
Where input.img is any image file that can be read by OIIO and output.png is the output image
stored in a png format that supports four channels.
As we discussed in class, there are many techniques for green screening. For this assignment,
you should focus on chroma-keying:
1. You should first allow for setting the alpha channel based on a range of hue values. To do so,
convert the color data to HSV and next select the pixels to mask based on those which have
a hue near the value 120 (pure green on a 360 degree scale). I have included in the appendix
some sample code to convert RGB to HSV values. Any pixel that falls within your hue range
should be converted to have a transparent mask (α = 0), while any pixel that falls outside of
the range should be opaque (α = 255).
2. Next, mask pixels based on not just hue, but also saturation and value thresholds. I suggest
that .
1 of 6 LAB 5 IMAGE FILTERING ECE180 Introduction to.docxmercysuttle
1 of 6
LAB 5: IMAGE FILTERING
ECE180: Introduction to Signal Processing
OVERVIEW
You have recently learned about the convolution sum that serves as the basis of the FIR filter difference equation. The filter
coefficient sequence {𝑏𝑘} – equivalent to the filter’s impulse response ℎ[𝑛] – may be viewed as a one-dimensional moving
window that slides over the input signal 𝑥[𝑛] to compute the output signal 𝑦[𝑛] at each time step. Extending the moving
window concept to a 2-D array that slides over an image pixel array provides a useful and popular way to filter an image.
In this lab project you will implement two types of moving-window image filters, one based on convolution and the other
based on the median value of the pixel grayscale values spanned by the window. You will also gain experience with the
built-in image convolution filter imfilter.
OUTLINE
1. Develop and test a 33 median filter
2. Develop and test a 33 convolution filter
3. Evaluate the median and convolution filters to reduce noise while preserving edges
4. Study the behavior of various 33 convolution filter kernels for smoothing, edge detection, and sharpening
5. Learn how to use imfilter to convolution-filter color images, and study the various mechanisms offered by
imfilter to deal with boundary effects
PREPARATION – TO BE COMPLETED BEFORE LAB
Study these tutorial videos:
1. Nested “for” loops -- http://youtu.be/q2xfz8mOuSI?t=1m8s (review this part)
2. Functions -- http://youtu.be/0zTmMIh6I8A (review as needed)
Ensure that you have added the ECE180 DFS folders to your MATLAB path, especially the “images” and “matlab” subfolders.
Follow along with the tutorial video http://youtu.be/MEqUd0dJNBA, if necessary.
LAB ACTIVITIES
1. Develop and test a 33 median filter function:
1.1. Implement the following algorithm as the function med3x3:
TIP: First implement and debug the algorithm as a script and then convert it to a function as a final step. Use any
of the smaller grayscale images from the ECE180 “images” folder as you develop the function, or use the test
image X described in the Step 1.2.
(a) Create the function template and save it to an .m file with the same name as the function,
(b) Accept a grayscale image x as the function input,
http://youtu.be/q2xfz8mOuSI?t=1m8s
http://youtu.be/0zTmMIh6I8A
http://youtu.be/MEqUd0dJNBA
2 of 6
(c) Copy x to the output image y and then initialize y(:) to zero; this technique creates y as the same size and
data type as x,
(d) Determine the number of image rows and columns (see size),
(e) Loop over all pixels in image x (subject to boundary limits):
Extract a 33 neighborhood (subarray) about the current pixel,
Flatten the 2-D array to a 1-D array,
Sort the 1-D array values (see sort),
Assign the middle value of the sorted array to the current output pixel, and
(f) Return the median-filtered image y.
1.2. Enter load lab_5_verify to load the
Design and implementation of a Neural Network based image compression engine as part of Final Year Project by Jesu Joseph and Shibu Menon at Nanyang Technological University. The project won the best possible grade and excellent accolades from the research center.
2. OVERVIEW
OpenCV is the most popular Image Processing and
Computer Vision library
Free for both academic and commercial use
Very easy to learn
It has C++, C, Python and Java interfaces and supports
Windows, Linux, Mac OS, iOS and Android
Designed for computational efficiency and with a strong
focus on real-time applications
Lot of documentation online
5. LOADING, SHOWING AND SAVING IMAGES
Loading: image = cv2.imread(“file_name",0)
(0 means Gray Scale, no number will use original
image’s colors)
Displaying: cv2.imshow(“some headline",image)
(Usually followed by: cv2.waitKey(0) so the image
will not close immediately)
Saving: cv2.imwrite(“file_name",image)
Code: load_and_display.py
6. HISTOGRAMS AND HISTOGRAMS EQUALIZATIONS
Histogram: Showing how many pixels have a
certain intensity (between 0 and 255) in a picture.
7. HISTOGRAMS AND HISTOGRAMS
EQUALIZATIONS (CONT.)
“Good” pictures have their histograms nearly
equally spread over the entire range.
However in a lot of pictures this is not always the
case
8. HISTOGRAMS AND HISTOGRAMS
EQUALIZATIONS (CONT.)
Solution: Histogram equalization
(see theoretical equations here:
http://www.math.uci.edu/icamp/courses/math77c/demos/hist_eq.pdf)
With openCV: image2 = cv2.equalizeHist(image)
Code:
load_and_display.py
9. HISTOGRAMS AND HISTOGRAMS
EQUALIZATIONS (CONT.)
On color images:
Split the color channels with: b,g,r = cv2.split(image)
Equalize each channel separately
Merge the channels with: image2 = cv2.merge((b,g,r))
Code: equalizing_color_images.py
10. GAMMA CORRECTION
Sometimes images are too dark, or too bright
Fixing it with just adding/substracting intensities
produses bad results
Solution: Gamma correction
Transform intensities from [0,255] to [0,1] with a LUT
(look up table)
Apply this to all pixels: O = I ^ (1 / G) (G is the gamma
value, higher = brighter)
Transform back to [0,255] with LUT
11. GAMMA CORRECTION (CONT.)
In openCV:
def adjust_gamma(image, gamma=1.0):
invGamma = 1.0 / gamma
table = np.array([((i / 255.0) ** invGamma) * 255
for i in np.arange(0, 256)]).astype("uint8")
return cv2.LUT(image, table)
adjusted = adjust_gamma(original, gamma=2)
Code:
gamma_correction.py
12. SMOOTHING, SHARPENING AND NOISE REMOVAL
Smoothing is done by applying a simple filter to the picture, for
example (3x3 kernel):
Each pixel is averaged with its 8 neighbors.
Gaussian smoothing : Each pixel is averaged (with Gaussian
weights) with its 8 neighbors.
Median smoothing: Each pixel is gets the median value of him
and its 8 neighbors.
13. SMOOTHING, SHARPENING AND NOISE
REMOVAL (CONT.)
In openCV (5x5 kernel:
average_blur = cv2.blur(image,(5,5))
gaussian = cv2.GaussianBlur(image,(5,5),0)
median = cv2.medianBlur(image,5)
Code:
smoothing _and_cleaning.py
14. SMOOTHING, SHARPENING AND NOISE
REMOVAL (CONT.)
Sharpening: Done be subtracting from the picture, a Gaussian
blurred version of itself
In openCV:
gaussian = cv2.GaussianBlur(image,(9,9),10)
sharpened = cv2.addWeighted(image,1.5,gassuian,-0.5,0)
Code:
smoothing _and_cleaning.py
15. SMOOTHING, SHARPENING AND NOISE
REMOVAL (CONT.)
Some types of noise (especially Salt & Pepper) can
be removed by using a median filter (with a small
kernel)
Code:
smoothing _and_cleaning.py
16. MORPHOLOGICAL OPERATIONS (EROSION,
DILATION)
Morphological transformations are some simple operations
based on the image shape.
It is normally performed on binary images.
It needs two inputs, one is our original image, second one is
called structuring element or kernel which decides the
nature of operation.
Two basic morphological operators are Erosion and Dilation
Erosion: Match the value of all pixels in the kernel to the one
with the minimum value .
Dilation: Match the value of all pixels in the kernel to the one
with the maximum value .
17. MORPHOLOGICAL OPERATIONS (EROSION,
DILATION) (CONT.)
On openCV (with kernel of 5x5):
kernel = np.ones((5,5),np.uint8)
eroded = cv2.erode(image,kernel)
dilated = cv2.dilate(image,kernel)
Original Eroded
Dilated
Code:
erosion_dialation_inversion.py
18. EDGE DETECTION (CANNY)
Canny Edge Detection is a popular edge detection algorithm. It was
developed by John F. Canny in 1986
Does the following steps:
Cleaning the image by blurring it.
Finding Intensity Gradient of the Image:
Using Sobel to find intensities of gradients in x and y directions creates a
picture of gradient intensities.
Non-maximum Suppression:
Suppress (set to 0) all pixels which are not a local maximum, to thin the
edges.
Hysteresis Thresholding:
Any edges with intensity gradient more than maxVal are sure to be edges
and those below minVal are sure to be non-edges, so discarded. Those
who lie between these two thresholds are classified edges or non-edges
based on their connectivity. If they are connected to “sure-edge” pixels,
they are considered to be part of edges. Otherwise, they are also
discarded
19. EDGE DETECTION (CANNY) (CONT.)
In openCV:
edges = cv2.Canny(img,100,200)
(The two numbers are min-val and max-val)
Code: edge_detection.py
20. TRANSFORMATION
Transformation: Reshape the picture such that is gets 4 co-ordinates from
the original picture and 4 new coordinates, and trasnforms the picture so the
4 points (and all points between them) will match the new ones.
In openCV :
M = cv2.getPerspectiveTransform(pts1,pts2)
dst = cv2.warpPerspective(img,M,(257,259))
(The last two numbers are the size of the new image)
Code: trasnformation_and_adaptive_threshold.py
21. ADAPTIVE THRESHOLDING
Thresholding: Set pixel to 255 if it’s intensity is above a
certain threshold, otherwise set to 0.
Simple thresholding: Threshold is constant for the entire
picture.
Adaptive thresholding: Different thresholds for different
regions of the same image
Mean: Threshold value is the mean of neighborhood area.
Gaussian: Threshold value is the weighted sum of
neighborhood values where weights are a Gaussian
window.