Skip to Content
Programming Computer Vision with Python
book

Programming Computer Vision with Python

by Jan Erik Solem
June 2012
Beginner to intermediate
260 pages
6h 28m
English
O'Reilly Media, Inc.
Content preview from Programming Computer Vision with Python

Chapter 9. Image Segmentation

Image segmentation is the process of partitioning an image into meaningful regions. Regions can be foreground versus background or individual objects in the image. The regions are constructed using some feature such as color, edges, or neighbor similarity. In this chapter we will look at some different techniques for segmentation.

9.1 Graph Cuts

A graph is a set of nodes (sometimes called vertices) with edges between them. See Figure 9-1 for an example.[26] The edges can be directed (as illustrated with arrows in Figure 9-1) or undirected, and may have weights associated with them.

A graph cut is the partitioning of a directed graph into two disjoint sets. Graph cuts can be used for solving many different computer vision problems like stereo depth reconstruction, image stitching, and image segmentation. By creating a graph from image pixels and their neighbors and introducing an energy or a “cost,” it is possible to use a graph cut process to segment an image in two or more regions. The basic idea is that similar pixels that are also close to each other should belong to the same partition.

The cost of a graph cut C (where C is a set of edges) is defined as the sum of the edge weights of the cuts

Equation 9-1. 

where wij is the weight of the edge (i, j) from node i to node j in the graph and the sum is taken over all edges in the cut C.

The idea behind graph ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning OpenCV 4 Computer Vision with Python 3 - Third Edition

Learning OpenCV 4 Computer Vision with Python 3 - Third Edition

Joseph Howse, Joe Minichino

Publisher Resources

ISBN: 9781449341916Errata PageSupplemental Content