Line Segment Experiment

19
Line Segment Line Segment Experiment Experiment Instructor: Professor Henderson, Instructor: Professor Henderson, Thomas. Thomas. Student: Chun-Kai Wang Student: Chun-Kai Wang

description

Line Segment Experiment. Instructor: Professor Henderson, Thomas. Student: Chun-Kai Wang. Outline. The line-segment program Prototype The architecture Meaning of each option Examples How to read a pixel region picture in examples Examples of binary image Examples of gray-tone image - PowerPoint PPT Presentation

Transcript of Line Segment Experiment

Page 1: Line Segment Experiment

Line Segment Line Segment ExperimentExperiment

Instructor: Professor Henderson, Instructor: Professor Henderson, Thomas.Thomas.

Student: Chun-Kai WangStudent: Chun-Kai Wang

Page 2: Line Segment Experiment

OutlineOutline

The line-segment programThe line-segment program– PrototypePrototype– The architecture The architecture – Meaning of each optionMeaning of each option

ExamplesExamples– How to read a pixel region picture in examplesHow to read a pixel region picture in examples– Examples of binary imageExamples of binary image– Examples of gray-tone imageExamples of gray-tone image

Issue of performance evaluateIssue of performance evaluate

Page 3: Line Segment Experiment

The line-segment programThe line-segment program

Page 4: Line Segment Experiment

PrototypePrototype function segments = lineSegs(img, mag_thres, zero_thres, len, varargin)function segments = lineSegs(img, mag_thres, zero_thres, len, varargin)

% input: img - The input image. It is a binary image or a gray-tone image. Here we assume the foreground color is black and background col

or is white. mag_thres - The threshold value that determines the foregrounds

and the backgrounds. zero_thres - The threshold value that determines how many varian

ces from the zero degree can be tolerated. len - The len value for mark-seeds algorithm. varargin - Options. Those are strings.

% output: segments - List of begin and end points of line segments. Example call:Example call:

segs = lineSegs(im00, 0.49, 0.01, 9, ‘thin’, ‘sobel’);

Page 5: Line Segment Experiment

The architectureThe architecture

Page 6: Line Segment Experiment

Meaning of each option (1)Meaning of each option (1) Pre- edge detectingPre- edge detecting

– ‘‘thres’thres’: Convert the input image to binary by Otsu’s meth: Convert the input image to binary by Otsu’s method. This option is automatically enable when the option ‘thiod. This option is automatically enable when the option ‘thin’ is enable. The default value is disable.n’ is enable. The default value is disable.

– ‘‘thin’thin’: Thinning the image with Matlab built-in thinning alg: Thinning the image with Matlab built-in thinning algorithm (from “Thinning Methodologies-A Comprehensive Suorithm (from “Thinning Methodologies-A Comprehensive Survey,” Louisa Lam, Seong-Whan Lee, and Ching Y. Wuen, rvey,” Louisa Lam, Seong-Whan Lee, and Ching Y. Wuen, IEEE TrPAMI, vol. 14, no. 9, pp. 869-885, 1992IEEE TrPAMI, vol. 14, no. 9, pp. 869-885, 1992). This is des). This is design for the binary image only. The default value is disable.ign for the binary image only. The default value is disable.

Page 7: Line Segment Experiment

Meaning of each option (2)Meaning of each option (2) Edge detectingEdge detecting

– ‘‘sobel’sobel’: Use Sobel edge detector. One and only one of opti: Use Sobel edge detector. One and only one of options ‘sobel’ and ‘markseeds’ must be set enable. The deons ‘sobel’ and ‘markseeds’ must be set enable. The default value is enable.fault value is enable.

– ‘‘sobelmergesobelmerge’’: Merge the two directions of edges that are dete: Merge the two directions of edges that are detected by Sobel edge detector into one. This option is meaningfcted by Sobel edge detector into one. This option is meaningful only when the option ul only when the option ‘‘sobelsobel’’ is enable. The default value is is enable. The default value is disable.disable.

– ‘‘markseedsmarkseeds’’:: Use Mark-Seeds edge detector. Use Mark-Seeds edge detector. One and only onOne and only one of options ‘sobel’ and ‘markseeds’ must be set enable.e of options ‘sobel’ and ‘markseeds’ must be set enable. The default value is disable.The default value is disable.

Page 8: Line Segment Experiment

ExamplesExamples

Page 9: Line Segment Experiment

How to read a pixel region pictureHow to read a pixel region picture

A pixel region picture is a picture that shows values of each A pixel region picture is a picture that shows values of each pixel in some region of a image.pixel in some region of a image.

If a pixel region picture is for displaying line segments, each If a pixel region picture is for displaying line segments, each 1-pixel wide horizontal line or vertical line is a line segment. 1-pixel wide horizontal line or vertical line is a line segment. For example, there are eight line segments in the following For example, there are eight line segments in the following pictures, each with a unique color.pictures, each with a unique color.

Page 10: Line Segment Experiment

Examples of binary image Examples of binary image (1)(1)

The binary image and the region that we will use in the The binary image and the region that we will use in the following examples.following examples.

Page 11: Line Segment Experiment

Examples of binary image (2)Examples of binary image (2) Line segments with Sobel edge detector.Line segments with Sobel edge detector.

Page 12: Line Segment Experiment

Examples of binary image (3)Examples of binary image (3) Line segments with Sobel edge detector and edge merging.Line segments with Sobel edge detector and edge merging.

Page 13: Line Segment Experiment

Examples of binary image (4)Examples of binary image (4) Line segments with thinning algorithm and Sobel edge detector.Line segments with thinning algorithm and Sobel edge detector.

Page 14: Line Segment Experiment

Examples of binary image (5)Examples of binary image (5) Line segments with thinning algorithm, Sobel edge detector, Line segments with thinning algorithm, Sobel edge detector,

and edge merging.and edge merging.

Page 15: Line Segment Experiment

Examples of binary image (6)Examples of binary image (6) Line segments with mark-seeds edge detector.Line segments with mark-seeds edge detector.

Page 16: Line Segment Experiment

Examples of binary image (7)Examples of binary image (7) Line segments with thinning algorithm and mark-seeds edge Line segments with thinning algorithm and mark-seeds edge

detector.detector.

Page 17: Line Segment Experiment

Examples of gray-tone image Examples of gray-tone image (1)(1)

The binary image and the region that we will use in the following examples.The binary image and the region that we will use in the following examples.

Page 18: Line Segment Experiment

Examples of gray-tone image Examples of gray-tone image (2)(2)

Line segments with Sobel edge detector.Line segments with Sobel edge detector.

Page 19: Line Segment Experiment

Issue of performance evaluateIssue of performance evaluate Original image MINUS Segments image.Original image MINUS Segments image.

– But not all of lines in the original image are one-pixel But not all of lines in the original image are one-pixel wide. wide.

It is hard to find a automatic line segment It is hard to find a automatic line segment program performance evaluating tool because we program performance evaluating tool because we need to know line segments at the first hand to need to know line segments at the first hand to evaluate such a program, but how can we find a evaluate such a program, but how can we find a perfect line segment program at the first hand? perfect line segment program at the first hand?

The dependable method that I can think of is to The dependable method that I can think of is to evaluate the performance manually.evaluate the performance manually.