Basic Image Processing
Basic Image Processing
Email: [email protected]
▪ Image Representation
▪ Types of image
▪ Image Features
▪ Introduction to OpenCV
▪ Load Image
▪ Access pixel value
▪ Set pixel value
▪ Digital image is presented by pixel matrix
▪ Image processing operation in a computer may be observed as a
matrix operation
O x
Image(3,4) = ?
▪ Represented by 3 matrices
▪ Colors are seen as variable
combination of primary colors Red
(R), Green (G), and blue (B)
▪ Each element are integer number
range from 0 to 255
▪ Intensity of the pixel with respect to the
color
▪ In RGB system, it’s possible to
(R,G,B)=(146,185,216)
create 2563=16777216 different
colors
Color Image
RGB components
R/G/B histogram
Color image processing is generally challenging
▪ Three separate, “independent” channels
▪ Time consuming
▪ Require nonlinear approaches
▪ Represented by 1 matrix
▪ Each element of the matrix is the
intensity of the corresponding pixel
▪ Range from 0 (black) to 255
(white)
▪ Covert from RGB image:
𝑮 = 𝟎. 𝟐𝟗𝟗𝑹 + 𝟎. 𝟓𝟖𝟕𝑮 + 𝟎. 𝟏𝟏𝟒𝑩
intensity=177
▪ Also called Boolean images
▪ Represented by a matrix
▪ All elements are 0 and 1
▪ 0 is black
▪ 1 is white
▪ Key points
▪ Location
Edge
▪ Direction
▪ scale Key points
▪ OpenCV: Open Source Computer Vision & Machine
Learning software library
▪ Created in 1999 by Intel
▪ Supported from 2008 by Willow Garage
▪ Willow Garage also supported the Robotic Operating system (ROS)
and Point Cloud Library (PCL)
▪ OpenCV is a cross-plaform
▪ Available in Windows, Linux, Android, MacOS …
Mat roi1(img1,Rect(50,50,100,100));
Mat roi2(img2,Rect(0,0,100,100));