Image Processing 主講人:虞台文. Content Smoothing Image Morphology Some Applications of Image Morphology Flood Fill Resize Image Pyramids Threshold.

Slides:



Advertisements
Similar presentations
Image Transforms 主講人:虞台文. Content Overview Convolution Edge Detection – Gradients – Sobel operator – Canny edge detector – Laplacian Hough Transforms.
Advertisements

Course Syllabus 1.Color 2.Camera models, camera calibration 3.Advanced image pre-processing Line detection Corner detection Maximally stable extremal regions.
Chapter 9: Morphological Image Processing
Some Basic Morphological Algorithm
Course Syllabus 1.Color 2.Camera models, camera calibration 3.Advanced image pre-processing Line detection Corner detection Maximally stable extremal regions.
Introduction to Morphological Operators
Morphological Image Processing Md. Rokanujjaman Assistant Professor Dept of Computer Science and Engineering Rajshahi University.
Tutorial # 10 Morphological Operations I8oZE.
Provides mathematical tools for shape analysis in both binary and grayscale images Chapter 13 – Mathematical Morphology Usages: (i)Image pre-processing.
Digital Image Processing, 2nd ed. © 2002 R. C. Gonzalez & R. E. Woods Chapter 9 Morphological Image Processing Chapter 9 Morphological.
Morphology Structural processing of images Image Processing and Computer Vision: 33 Morphological Transformations Set theoretic methods of extracting.
Chapter 9 Morphological Image Processing. Preview Morphology: denotes a branch of biology that deals with the form and structure of animals and planets.
3. Introduction to Digital Image Analysis
Morphological Image Processing Spring 2006, Jen-Chang Liu.
Morphological Image Processing
2007Theo Schouten1 Morphology Set theory is the mathematical basis for morphology. Sets in Euclidic space E 2 (or rather Z 2 : the set of pairs of integers)
E.G.M. PetrakisBinary Image Processing1 Binary Image Analysis Segmentation produces homogenous regions –each region has uniform gray-level –each region.
Chapter 2. Image Analysis. Image Analysis Domains Frequency Domain Spatial Domain.
Detect Candle.  Open VC++ Directories configuration: Tools > Options > Projects and Solutions > VC++ Directories  Choose "Show directories for: Include.
Lecture 5. Morphological Image Processing. 10/6/20152 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of animals.
Morphological Image Processing
MATHEMATICAL MORPHOLOGY I.INTRODUCTION II.BINARY MORPHOLOGY III.GREY-LEVEL MORPHOLOGY.
Mathematical Morphology Lecture 14 Course book reading: GW Lucia Ballerini Digital Image Processing.
Chapter 9.  Mathematical morphology: ◦ A useful tool for extracting image components in the representation of region shape.  Boundaries, skeletons,
L. Akshay Masare Piyush Awasthi IMAGE PROCESSING AND OPENCV.
Course Syllabus 1.Color 2.Camera models, camera calibration 3.Advanced image pre-processing Line detection Corner detection Maximally stable extremal regions.
Digital Image Processing Chapter 9: Morphological Image Processing 5 September 2007 Digital Image Processing Chapter 9: Morphological Image Processing.
Morphological Processing
Morphological Image Processing
J. Shanbehzadeh M. Hosseinajad Khwarizmi University of Tehran.
Introduction of OpenCV Alireza Shirani Researcher of Medical Image and Signal Processing M. S Electrical Engineering yahoo. com Spring.
Image Segmentation and Morphological Processing Digital Image Processing in Life- Science Aviad Baram
1 Regions and Binary Images Hao Jiang Computer Science Department Sept. 25, 2014.
Digital Image Processing
Mathematical Morphology Mathematical morphology (matematická morfologie) –A special image analysis discipline based on morphological transformations of.
DIGITAL IMAGE PROCESSING Instructors: Dr J. Shanbehzadeh Mostafa Mahdijo Mostafa Mahdijo ( J.Shanbehzadeh.
Digital Image Processing CSC331 Morphological image processing 1.
Morphological Image Processing การทำงานกับรูปภาพด้วยวิธีมอร์โฟโลจิคัล
Erosion: Erosion is used for shrinking of element A by using element B
Mathematical Morphology
References Books: Chapter 11, Image Processing, Analysis, and Machine Vision, Sonka et al Chapter 9, Digital Image Processing, Gonzalez & Woods.
CS654: Digital Image Analysis
Image Processing and Analysis (ImagePandA)
1 Mathematic Morphology used to extract image components that are useful in the representation and description of region shape, such as boundaries extraction.
DIGITAL IMAGE PROCESSING
Morphological Image Processing Robotics. 2/22/2016Introduction to Machine Vision Remember from Lecture 12: GRAY LEVEL THRESHOLDING Objects Set threshold.
 Mathematical morphology is a tool for extracting image components that are useful in the representation and description of region shape, such as boundaries,
TOPIC 12 IMAGE SEGMENTATION & MORPHOLOGY. Image segmentation is approached from three different perspectives :. Region detection: each pixel is assigned.
BYST Morp-1 DIP - WS2002: Morphology Digital Image Processing Morphological Image Processing Bundit Thipakorn, Ph.D. Computer Engineering Department.
Morphology Morphology deals with form and structure Mathematical morphology is a tool for extracting image components useful in: –representation and description.
Machine Vision ENT 273 Hema C.R. Binary Image Processing Lecture 3.
ECE472/572 - Lecture 14 Morphological Image Processing 11/17/11.
Lecture(s) 3-4. Morphological Image Processing. 3/13/20162 Introduction ► ► Morphology: a branch of biology that deals with the form and structure of.
Morphological Image Processing (Chapter 9) CSC 446 Lecturer: Nada ALZaben.
Morphological Image Processing
Lecture 11+x+1 Chapter 9 Morphological Image Processing.
COMP 9517 Computer Vision Binary Image Analysis 4/15/2018
Digital Image Processing CP-7008 Lecture # 09 Morphological Image Processing Fall 2011.
HIT and MISS.
Introduction to Morphological Operators
CS Digital Image Processing Lecture 5
Binary Image processing بهمن 92
Introduction to Digital Image Analysis Part II: Image Analysis
Morphological Operation
Morphological Image Processing
ECE 692 – Advanced Topics in Computer Vision
CS654: Digital Image Analysis
Morphological Operators
DIGITAL IMAGE PROCESSING Elective 3 (5th Sem.)
Morphological Filters Applications and Extension Morphological Filters
Presentation transcript:

Image Processing 主講人:虞台文

Content Smoothing Image Morphology Some Applications of Image Morphology Flood Fill Resize Image Pyramids Threshold

Image Processing Smoothing

Smoothing is also called blurring Why smoothing? – reduce noise and camera artifact – reduce the resolution of an image in a principled way

Smoothing void cvSmooth( const CvArr* src, CvArr* dst, int smoothtype=CV_GAUSSIAN, int param1=3, int param2=0, double param3=0, double param4=0 ); void cvSmooth( const CvArr* src, CvArr* dst, int smoothtype=CV_GAUSSIAN, int param1=3, int param2=0, double param3=0, double param4=0 ); smoothtype: CV_BLUR_NO_SCALE CV_BLUR CV_GAUSSIAN CV_MEDIAN CV_BILATERAL Depending on smoothtype

Smoothing

Example cvSmooth BLUR MEDIAN GAUSSIAN BILATERAL param1=7 param2=7 param1=7 param2=7 param1=7 param3=50.0 Param4=3.5 Original

Exercise Download Test Program Download Test Program

Image Processing Image Morphology

Morphological Operations Morphological operations come from the word “morphing” in Biology which means “changing a shape”. Morphing

Morphological Operations Originated from set operations Can be used to manipulate object shapes such as thinning, thickening, filling, etc.

Binary Image Representation A

Basic Set Operations

Translation and Reflection Operations TranslationReflection A (A)z(A)z

Logical Operations

Basic Morphological Operations Dilation – Enlarge a region Erosion – Shrink a region Opening – Get rid of small portions of region that jut out from the boundary into the background region Closing – Close up internal holes in a region and eliminate “bays” along the boundary

Basic Morphological Operations Defined based on a structure element  Morphological Operation Structure Element

Structure Elements

Dilation A = Object to be dilated B = Structuring element

Dilation A B

Erosion A = Object to be eroded B = Structuring element

Erosion B A

Example: Application of Dilation and Erosion Remove small objects such as noise

Duality Between Dilation and Erosion Pf)

Opening

Combination of all parts of A that can completely contain B Opening eliminates narrow and small details and corners.

Example: Opening

Closing

Closing fills narrow gaps and notches

Example: Closing

Opening vs. Closing Duality Properties of Opening Properties of Closing Idempotent property: can’t change any more

Example: Application of Morphological Operations Finger print enhancement

Example: Application of Morphological Operations Finger print enhancement

Image Processing Some Applications of Image Morphology

Hit-or-Miss Transformation X W W  X  Xc Xc *

Hit-or-Miss Transformation A contains pattern X A c contains pattern X c *

Hit-or-Miss Transformation *

*

Boundary Extraction A shrinks a little bit

Boundary Extraction

Original image Boundary

Region Filling Enlarge the filler a little bit Make the filler inside A

Region Filling Original image Results of region filling

Extraction of Connected Components Enlarge the extractor a little bit Make the extractor part of A

Extraction of Connected Components

Morphological Operations for Gray Images

Dilation and Erosion by OpenCV void cvDilate( const CvArr* A, CvArr* C, IplConvKernel* B=0, int iterations=1 ); void cvDilate( const CvArr* A, CvArr* C, IplConvKernel* B=0, int iterations=1 ); void cvErode( const CvArr* A, CvArr* C, IplConvKernel* B=0, int iterations=1 ); void cvErode( const CvArr* A, CvArr* C, IplConvKernel* B=0, int iterations=1 ); A Source image. C Destination image. B Structuring element used for erosion. If it is NULL, a 3×3 rectangular structuring element is used. iterations Number of times erosion is applied.

Making Your Own Kernel IplConvKernel* cvCreateStructuringElementEx( int nCols, int nRows, int anchorX, int anchorY, int shape, int* values ); IplConvKernel* cvCreateStructuringElementEx( int nCols, int nRows, int anchorX, int anchorY, int shape, int* values );

More General Morphology A Source image. C Destination image. temp Temporary image, required in some cases. B Structuring element. operation Type of morphological operation. iterations Number of times erosion is applied. void cvMorphologyEx( const CvArr* A, CvArr* C, CvArr* temp, IplConvKernel* B, int operation, int iterations ); void cvMorphologyEx( const CvArr* A, CvArr* C, CvArr* temp, IplConvKernel* B, int operation, int iterations );

More General Morphology A Source image. C Destination image. temp Temporary image, required in some cases. B Structuring element. operation Type of morphological operation. iterations Number of times erosion is applied. void cvMorphologyEx( const CvArr* A, CvArr* C, CvArr* temp, IplConvKernel* B, int operation, int iterations ); void cvMorphologyEx( const CvArr* A, CvArr* C, CvArr* temp, IplConvKernel* B, int operation, int iterations );

More General Morphology CV_MOP_OPEN: C = open(A,B) = dilate(erode(A,B),B) CV_MOP_CLOSE: C = close(A,B) = erode(dilate(A,B),B) CV_MOP_GRADIENT: C = morph_grad(A,B) = dilate(A,B) - erode(A,B) CV_MOP_TOPHAT: C = tophat(A,B) = A - erode(A,B) CV_MOP_BLACKHAT: C = blackhat(A,B) = dilate(A,B) - A CV_MOP_OPEN: C = open(A,B) = dilate(erode(A,B),B) CV_MOP_CLOSE: C = close(A,B) = erode(dilate(A,B),B) CV_MOP_GRADIENT: C = morph_grad(A,B) = dilate(A,B) - erode(A,B) CV_MOP_TOPHAT: C = tophat(A,B) = A - erode(A,B) CV_MOP_BLACKHAT: C = blackhat(A,B) = dilate(A,B) - A

Exercise Download Test Program Download Test Program

Image Processing Flood Fill

Used to mark or isolate portions of an image for further processing or analysis Used to derive, from an input image, masks that can be used for subsequent routines to speed or restrict processing to only those pixels indicated by the mask. Some routines support mask

Flood Fill void cvFloodFill( IplImage* img, CvPoint seedPoint, CvScalar newVal, CvScalar loDiff = cvScalarAll(0), CvScalar upDiff = cvScalarAll(0), CvConnectedComp* comp = NULL, int flags = 4, CvArr* mask = NULL ); void cvFloodFill( IplImage* img, CvPoint seedPoint, CvScalar newVal, CvScalar loDiff = cvScalarAll(0), CvScalar upDiff = cvScalarAll(0), CvConnectedComp* comp = NULL, int flags = 4, CvArr* mask = NULL );

Flood Fill Download Test Program Download Test Program

Image Processing Resize

void cvResize( const CvArr* src, CvArr* dst, int interpolation=CV_INTER_LINEAR ); void cvResize( const CvArr* src, CvArr* dst, int interpolation=CV_INTER_LINEAR );

Image Processing Image Pyramids

Represent N  N image as a “pyramid” of 1  1, 2  2, 4  4, 2 k  2 k images (assuming N = 2 k )

Image Pyramids Represent the image using a collection of images – Called a pyramid because the resolution of the images decreases Most common pyramid: Gaussian pyramid – At each level, generate the next level by blurring the image with a Gaussian, then downsampling For reconstruction: Laplacian pyramid needed

Gaussian Pyramid At each level, generate the next level by blurring the image with a Gaussian, then downsampling

Problems on Gaussian Pyramid It is redundant Each level contains all of the low-frequencies that are available at the lower levels.

Laplacian Pyramid Original Image Reduce Enlarge =- Shrunk and Enlarged Version Original Image Detail

The Detail The image represents everything in the high-resolution image that cannot be represented in a low-resolution image

Gaussian Pyramid & Lapacian Pyramid Gaussian PyramidLaplacian Pyramid

Image Compression

PyrDown void cvPyrDown( const CvArr* src, CvArr* dst, int filter=CV_GAUSSIAN_5x5 ); void cvPyrDown( const CvArr* src, CvArr* dst, int filter=CV_GAUSSIAN_5x5 ); The function performs the downsampling step of the Gaussian pyramid decomposition. First it convolves the source image with the specified filter and then downsamples the image by rejecting even rows and columns.

PyrUp void cvPyrUp( const CvArr* src, CvArr* dst, int filter=CV_GAUSSIAN_5x5 ); void cvPyrUp( const CvArr* src, CvArr* dst, int filter=CV_GAUSSIAN_5x5 ); The function cvPyrUp performs up-sampling step of Gaussian pyramid decomposition. First it upsamples the source image by injecting even zero rows and columns and then convolves result with the specified filter multiplied by 4 for interpolation. So the destination image is four times larger than the source image.

Image Segmentation

Pyramid Image Segmentation void cvPyrSegmentation( IplImage* src, IplImage* dst, CvMemStorage* storage, CvSeq** comp, int level, double threshold1, double threshold2 ) void cvPyrSegmentation( IplImage* src, IplImage* dst, CvMemStorage* storage, CvSeq** comp, int level, double threshold1, double threshold2 )

Pyramid Image Segmentation Download Test Program Download Test Program

Image Processing Threshold

double cvThreshold( CvArr* src, CvArr* dst, double threshold, double max_value, int threshold_type ); double cvThreshold( CvArr* src, CvArr* dst, double threshold, double max_value, int threshold_type );

Threshold double cvThreshold( CvArr* src, CvArr* dst, double threshold, double max_value, int threshold_type ); double cvThreshold( CvArr* src, CvArr* dst, double threshold, double max_value, int threshold_type ); CV_THRESH_OTSU

Threshold double cvThreshold( CvArr* src, CvArr* dst, double threshold, double max_value, int threshold_type ); double cvThreshold( CvArr* src, CvArr* dst, double threshold, double max_value, int threshold_type );

Threshold CV_THRESHOLD_BINARY threshold=100 CV_THRESHOLD_BINARY | CV_THRESHOLD_OTSU

Adaptive Threshold void cvAdaptiveThreshold( CvArr* src, CvArr* dst, double max_val, int adaptive_method = CV_ADAPTIVE_THRESH_MEAN_C int threshold_type = CV_THRESH_BINARY, int block_size = 3, double param1 = 5 ); void cvAdaptiveThreshold( CvArr* src, CvArr* dst, double max_val, int adaptive_method = CV_ADAPTIVE_THRESH_MEAN_C int threshold_type = CV_THRESH_BINARY, int block_size = 3, double param1 = 5 );

Adaptive Threshold CV_ADAPTIVE_THRESH_MEAN_C CV_THRESHOLD_BINARY threshold=5

Threshold & Adaptive Threshold Download Test Program Download Test Program