Colorado School of Mines. Computer Vision. Professor William Hoff Dept of Electrical Engineering &Computer Science.

Similar documents
Colorado School of Mines. Computer Vision. Professor William Hoff Dept of Electrical Engineering &Computer Science.

Morphological Image Algorithms

Introduction. Computer Vision & Digital Image Processing. Preview. Basic Concepts from Set Theory

EECS490: Digital Image Processing. Lecture #17

CITS 4402 Computer Vision

Processing of binary images

Equation recognizer and calculator. By Daria Tolmacheva

[ ] Review. Edges and Binary Images. Edge detection. Derivative of Gaussian filter. Image gradient. Tuesday, Sept 16

Lab 2. Hanz Cuevas Velásquez, Bob Fisher Advanced Vision School of Informatics, University of Edinburgh Week 3, 2018

Identifying and Reading Visual Code Markers

Design Features Recognition Using Image Processing Techniques

Image Processing Toolbox

Image Processing. Bilkent University. CS554 Computer Vision Pinar Duygulu

Counting Particles or Cells Using IMAQ Vision

Image and Multidimensional Signal Processing

Morphological Image Processing

OBJECT SORTING IN MANUFACTURING INDUSTRIES USING IMAGE PROCESSING

INF Exercise for Thursday

CS443: Digital Imaging and Multimedia Binary Image Analysis. Spring 2008 Ahmed Elgammal Dept. of Computer Science Rutgers University

IN5520 Digital Image Analysis. Two old exams. Practical information for any written exam Exam 4300/9305, Fritz Albregtsen

Binary Image Processing. Introduction to Computer Vision CSE 152 Lecture 5

Previously. Edge detection. Today. Thresholding. Gradients -> edges 2/1/2011. Edges and Binary Image Analysis

UNIVERSITY OF OSLO. Faculty of Mathematics and Natural Sciences

Image Segmentation. Figure 1: Input image. Step.2. Use Morphological Opening to Estimate the Background

Colorado School of Mines. Computer Vision. Professor William Hoff Dept of Electrical Engineering &Computer Science.

Edges and Binary Image Analysis. Thurs Jan 26 Kristen Grauman UT Austin. Today. Edge detection and matching

Colorado School of Mines. Computer Vision. Professor William Hoff Dept of Electrical Engineering &Computer Science.

1 Background and Introduction 2. 2 Assessment 2

Robbery Detection Camera

Machine vision. Summary # 6: Shape descriptors

Biomedical Image Analysis. Mathematical Morphology

ECE 172A: Introduction to Intelligent Systems: Machine Vision, Fall Midterm Examination

Mathematical morphology (1)

Unit 4 End-of-Unit Assessment Study Guide

EE 584 MACHINE VISION

Digital Image Processing COSC 6380/4393

Binary Image Analysis. Binary Image Analysis. What kinds of operations? Results of analysis. Useful Operations. Example: red blood cell image

Edges and Binary Image Analysis April 12 th, 2018

11. Gray-Scale Morphology. Computer Engineering, i Sejong University. Dongil Han

Working with images and scenes

Fig. 1. Input image. Ibw=im2bw(I, 250/255); % threshold value should be between Fig. 2. Thresholded image cercuri-stele.

Image Processing Fundamentals. Nicolas Vazquez Principal Software Engineer National Instruments

Edges and Binary Images

- Low-level image processing Image enhancement, restoration, transformation

An adaptive container code character segmentation algorithm Yajie Zhu1, a, Chenglong Liang2, b

Figure 8-7: Cameraman.tif Before and After Remapping, and Widening its Dynamic Range

Chapter 9 Morphological Image Processing

SECTION 5 IMAGE PROCESSING 2

EECS490: Digital Image Processing. Lecture #23

EE795: Computer Vision and Intelligent Systems

Solving Word Jumbles

Image Analysis Lecture Segmentation. Idar Dyrdal

Eyes extraction from facial images using edge density

What will we learn? What is mathematical morphology? What is mathematical morphology? Fundamental concepts and operations

09/11/2017. Morphological image processing. Morphological image processing. Morphological image processing. Morphological image processing (binary)

Image Processing: Final Exam November 10, :30 10:30

Image segmentation. Stefano Ferrari. Università degli Studi di Milano Methods for Image Processing. academic year

Morphological Compound Operations-Opening and CLosing

EE368/CS232 Digital Image Processing Winter Homework #3 Solutions. Part A: Below, we show the binarized versions of the 36 template images.

ENG 7854 / 9804 Industrial Machine Vision. Midterm Exam March 1, 2010.

Computer Vision 2. SS 18 Dr. Benjamin Guthier Professur für Bildverarbeitung. Computer Vision 2 Dr. Benjamin Guthier

Ulrik Söderström 21 Feb Representation and description

A Simple Cigarette Butts Detection System

CHAPTER 3 SYSTEM DESCRIPTION

Digital Image Processing

Laboratory of Applied Robotics

Boundary descriptors. Representation REPRESENTATION & DESCRIPTION. Descriptors. Moore boundary tracking

CS534 Introduction to Computer Vision Binary Image Analysis. Ahmed Elgammal Dept. of Computer Science Rutgers University

2. Give an example of a non-constant function f(x, y) such that the average value of f over is 0.

Fetch the ball, Oncilla!

Colorado School of Mines. Computer Vision. Professor William Hoff Dept of Electrical Engineering &Computer Science.

Extracting Layers and Recognizing Features for Automatic Map Understanding. Yao-Yi Chiang

Homework Assignment 2 - SOLUTIONS Due Monday, September 21, 2015

Mathematical Morphology and Distance Transforms. Robin Strand

Discovering Visual Hierarchy through Unsupervised Learning Haider Razvi

Colorado School of Mines. Computer Vision. Professor William Hoff Dept of Electrical Engineering &Computer Science.

Practice Problems for Geometry from

Statistical Approach to a Color-based Face Detection Algorithm

morphology on binary images

OBJECT detection in general has many applications

Volume of Cylinders. Volume of Cones. Example Find the volume of the cylinder. Round to the nearest tenth.

CSCI 512 / EENG 512 Computer Vision Spring Lab 6. February 17, 2016

Vision Based Parking Space Classification

Geometry / Integrated II TMTA Test units.

Measurement 1 PYTHAGOREAN THEOREM. The area of the square on the hypotenuse of a right triangle is equal to the sum of the areas of

Number. Number. Number. Number

Getting Started With Images, Video, and Matlab. CSE 6367 Computer Vision Vassilis Athitsos University of Texas at Arlington

Albert M. Vossepoel. Center for Image Processing

Dilations. Dilations. Enlarges or Reduces a figure using a scale factor. Name: Period: Date: Dilations. Scale Factor =

How to create shapes. Drawing basic shapes. Adobe Photoshop Elements 8 guide

convolution shift invariant linear system Fourier Transform Aliasing and sampling scale representation edge detection corner detection

Real Time Detection and Tracking of Mouth Region of Single Human Face

CMPSCI 119 LAB #2 Anime Eyes Professor William T. Verts

Name: Class: Date: 2. I have four vertices. I have four right angles and all my sides are the same length.

Colorado School of Mines. Computer Vision. Professor William Hoff Dept of Electrical Engineering &Computer Science.

Face Detection on Similar Color Photographs

A Simple Automated Void Defect Detection for Poor Contrast X-ray Images of BGA

Understanding Tracking and StroMotion of Soccer Ball

CSE/EE-576, Final Project

CS 5540 Spring 2013 Assignment 3, v1.0 Due: Apr. 24th 11:59PM

Transcription:

Professor William Hoff Dept of Electrical Engineering &Computer Science http://inside.mines.edu/~whoff/ 1

Binary Image Processing Examples 2

Example Label connected components 1 1 1 1 1 assuming 4 connected assuming 8 connected 3

Example Label connected components 1 1 1 1 1 1 2 2 2 2 3 3 3 2 2 2 2 3 3 3 2 2 2 2 3 3 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 1 1 2 2 2 1 2 2 2 1 2 2 2 1 1 1 1 assuming 4 connected assuming 8 connected 4

Example Do erosion, then dilation (ie, opening) with structuring element 1 1 1 1 1 after erosion after dilation 5

Example Do erosion, then dilation (ie, opening) with structuring element 1 1 1 1 1 1 1 after erosion after dilation 6

Example Task: Segment coins from the background Namely, generate a binary (or logical ) image which is white (1) where there are coins, and black (0) elsewhere Want: No gaps in the coins No extraneous white pixels in the background Image eight.tif 7

clear all close all I = imread('eight.tif'); imshow(i,[]); B = im2bw(i, graythresh(i)); % threshold B = imcomplement(b); % we want black regions S = strel('disk',1); % define a small structuring element B1 = imopen(b,s); % get rid of small white regions S = strel('disk', 5, 0); % Need structuring element bigger than gaps B2 = imclose(b1,s); % Fill in gaps figure, imshow(b2); [L,n] = bwlabel(b2); % find connected components fprintf('n = %d\n', n); figure, imshow(l, []); RGB = label2rgb(l); % create false color image for visualization figure, imshow(rgb); 8

original image thresholded image, after morphological operations labeled image labeled image with false colors 9

Example Tasks count number of balls draw rectangles and/or crosshairs to mark each ball find the average of the ball locations This is image D67.gif from http://www.ux.uis.no/~tranden/brodatz.html. It is from the Brodatz image texture database, which is often used to test computer vision algorithms. 10

clear all close all I = imread('balls.gif'); imshow(i,[]) B = im2bw(i, graythresh(i)); % Threshold B = ~B; % Complement image S = strel('disk', 5, 0); I2 = imerode(b,s); figure, imshow(i2); [L, n] = bwlabel(i2); blobs = regionprops(l); for i=1:n rectangle('position', blobs(i).boundingbox, 'EdgeColor', 'r'); end allcentroids = cat(1,blobs(:).centroid); % Get all centroids avgcentroid = mean(allcentroids); % Get the average x,y xavg = avgcentroid(1); yavg = avgcentroid(2); % Display crosshair at the average figure(1); line([xavg-10 xavg+10], [yavg yavg], 'Color', 'r'); line([xavg xavg], [yavg-10 yavg+10], 'Color', 'r'); 11

12

Approach: Threshold the image Finding CCC Targets For most images, a global threshold is fine (ie, the Otsu algorithm). For images with poor contrast or where the target is small, local thresholding may be needed. clear all close all I = imread('robot.jpg'); imshow(i,[]); I = rgb2gray(i); % Global threshold W = im2bw(i, graythresh(i)); % White regions 13

Finding CCC Targets (continued) If there are a lot of tiny (noise) white regions, you may need to clean up the thresholded image. Otherwise you will have too many regions to process. You can use morphological opening to do this. Use a structuring element that is larger than the noise regions. S = strel('disk', radius, 0); W2 = imopen(w,s); figure, imshow(w2); Then, find connected components and extract their region properties (e.g., centroid, area, bounding box) [LW, nw] = bwlabel(w2); % Get labeled image LW blobswhite = regionprops(lw); % All white blobs 14

Finding CCC Targets (continued) Complement the image, and repeat the process to find all black blobs. Now check every possible pair of white and black blobs. Pseudocode: for each white blob for each black blob Get centroid of white blob Get centroid of black blob if distance between centroids < thresh % We have a possible CCC; draw a % crosshair at its centroid or draw a % rectangle around its bounding box end if end for end for 15

Finding CCC Targets (continued) To find the distance between two centroids, you can use Matlab s norm function. norm computes the norm of a vector, which is its length bc = blobsblack(ib).centroid; % Get black blob centroid wc = blobswhite(iw).centroid; % Get white blob centroid if norm(bc-wc) < thresh % Got a possible CCC; draw a rectangle : 16

If additional tests are needed You can check if the black bounding box encloses the white bounding box A bounding box is represented as [x0 y0 w h], where x0,y0 are the coordinates of the upper left point w,h are the width and height (x0,y0) w >> blobswhite(1).boundingbox ans = 0.5000 59.5000 175.0000 273.0000 (xc,yc) h 17

If additional tests are needed You can check the circularity ratio of the combined (white and black) region. The circularity ratio is defined as R = 4*pi*area/perim^2 For a perfect circle, R = 1 All other shapes have R less than 1 For example, a square has R = pi/4 0.78 So you might check if R > than some minimum value like 0.78 Note by default, bwlabel just computes area, centroid, and bounding box. To have it compute Perimeter too, use: Use perimeter of outer (black) blob black white Total area = white area + black area blobs = regionprops(l, 'Area', 'BoundingBox', 'Centroid', 'Perimeter'); 18