painstakingly counting rice morphology and object recognition in image processing

34
PAINSTAKINGLY COUNTING RICE Morphology and Object Recognition in Image Processing Franz Parkins and Lamar Davies Mentored by: Dr. Josip Derado Ph.D

Upload: artan

Post on 11-Jan-2016

25 views

Category:

Documents


0 download

DESCRIPTION

PAINSTAKINGLY COUNTING RICE Morphology and Object Recognition in Image Processing. Franz Parkins and Lamar Davies Mentored by: Dr. Josip Derado , Ph.D. Morphology. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: PAINSTAKINGLY  COUNTING  RICE Morphology and Object Recognition in Image Processing

PAINSTAKINGLY

COUNTING RICEMorphology and Object Recognition in Image Processing

Franz Parkins and Lamar Davies

Mentored by: Dr. Josip Derado , Ph.D

Page 2: PAINSTAKINGLY  COUNTING  RICE Morphology and Object Recognition in Image Processing

Morphology

• The term morphology refers to the form or structure of anything; hence linguistic morphology , Geomorphology, Bio-morphology, Cosmic morphology, etc.

Page 3: PAINSTAKINGLY  COUNTING  RICE Morphology and Object Recognition in Image Processing

Morphology in Industry and Research

• Morphology is prolific in industry.

• A wide variety of unpolished ideas lie at the forefront.

Page 4: PAINSTAKINGLY  COUNTING  RICE Morphology and Object Recognition in Image Processing

The Ultimate Goal• Our focus is on:

1. Detecting objects

2. Enumerating them

Page 5: PAINSTAKINGLY  COUNTING  RICE Morphology and Object Recognition in Image Processing

Characterization

Morphological characterization for object recognition is, put simply, to decipher between the objects and their background.

Page 6: PAINSTAKINGLY  COUNTING  RICE Morphology and Object Recognition in Image Processing

Complexity of AlgorithmThe Algorithm has two main parts;

CLEANING and COUNTING.

Page 7: PAINSTAKINGLY  COUNTING  RICE Morphology and Object Recognition in Image Processing

Cleaning Rice

This step doesn’t involve a tiny broom. Metaphorically however, it is oddly appropriate, as we must somehow ‘sweep away’ all of the non-relevant data that will prevent an accurate rice count.

Page 8: PAINSTAKINGLY  COUNTING  RICE Morphology and Object Recognition in Image Processing

But Wait!!!!!

It is an absolute necessity to have quality photos! This it true for two reasons:

1.Clarity prevents “clutter”

2.Standardized distance

Page 9: PAINSTAKINGLY  COUNTING  RICE Morphology and Object Recognition in Image Processing

Humble Beginnings(The Lego Contraption)

Page 10: PAINSTAKINGLY  COUNTING  RICE Morphology and Object Recognition in Image Processing

Second Attempt(Crude but Effective)

Page 11: PAINSTAKINGLY  COUNTING  RICE Morphology and Object Recognition in Image Processing

Base Image

Page 12: PAINSTAKINGLY  COUNTING  RICE Morphology and Object Recognition in Image Processing

Basic Contrast Cleaning Method

Page 13: PAINSTAKINGLY  COUNTING  RICE Morphology and Object Recognition in Image Processing

Grid Filter Cleaning

Page 14: PAINSTAKINGLY  COUNTING  RICE Morphology and Object Recognition in Image Processing

Strel Filter Method(Mathworks Image Filter)

Page 15: PAINSTAKINGLY  COUNTING  RICE Morphology and Object Recognition in Image Processing

Circular Filter Cleaning

Page 16: PAINSTAKINGLY  COUNTING  RICE Morphology and Object Recognition in Image Processing

Combined FilterOriginal image Strel + Contrast + Grid

Filters

Page 17: PAINSTAKINGLY  COUNTING  RICE Morphology and Object Recognition in Image Processing

Combined FilterOriginal image Contrast + Circle + Grid

Filters

Page 18: PAINSTAKINGLY  COUNTING  RICE Morphology and Object Recognition in Image Processing

How Do We Actually Count Rice?

• Area Estimation

• Border Following

• Horizontal Layered Scanning (HLS)

Page 19: PAINSTAKINGLY  COUNTING  RICE Morphology and Object Recognition in Image Processing

Area EstimationThe idea behind area estimation is

simply to count the number of rice pixels in the image and then divide by the number of pixels in an average single rice grain.

2,694 pixels!!

Page 20: PAINSTAKINGLY  COUNTING  RICE Morphology and Object Recognition in Image Processing

Area Estimation

• Pros: – Easily implemented– Less complex

• Cons: – Reliance on average grain size (variance)– Inability to use destructive filters

Page 21: PAINSTAKINGLY  COUNTING  RICE Morphology and Object Recognition in Image Processing

Border Following

The intention is to define the border and starting pixel of each rice grain, then follow each border around to the starting point, thus circling the rice grain and marking it as counted before moving on to the next.

Page 22: PAINSTAKINGLY  COUNTING  RICE Morphology and Object Recognition in Image Processing

Border-defined Image

1

32

65

4

9

8

10

7

Page 23: PAINSTAKINGLY  COUNTING  RICE Morphology and Object Recognition in Image Processing

Border Following

• Pros– Very accurate and easy to filter “false”

rice• Cons

– Algorithm exceeds limits of Matlab unless used in conjunction with a very small image (approx 200x200 pixels).

– Difficult to differentiate rice in close proximity.

Page 24: PAINSTAKINGLY  COUNTING  RICE Morphology and Object Recognition in Image Processing

Horizontal Layered Scanning

HLS scans the image one row at a time while comparing to the previous row. The amount of rice scanned in each row is tracked, tallied, and counted accordingly.

Page 25: PAINSTAKINGLY  COUNTING  RICE Morphology and Object Recognition in Image Processing

Horizontal Layered Scanning[1, 0]

[2, 0]

[1,1][0, 2]

[1, 2]

[0, 3]

Page 26: PAINSTAKINGLY  COUNTING  RICE Morphology and Object Recognition in Image Processing

Horizontal Layered Scanning

• Pros– Easily implemented and accurate– Does not rely on massively looping

algorithms, making it more efficient• Cons

– Accuracy is greatly dependent on quality cleaning

– Consecutive line errors

Page 27: PAINSTAKINGLY  COUNTING  RICE Morphology and Object Recognition in Image Processing

Solving Consecutive Line Errors

Page 28: PAINSTAKINGLY  COUNTING  RICE Morphology and Object Recognition in Image Processing

Rice Count Chart(Using Industry Grade Strel Filter w/ HLS)

Actual # Number of Rice Counted Accuracy10 9.4 9.6 9.4 9.8 10.0 96.4%20 21.0 19.2 19.4 19.8 19.3 96.7%30 28.0 29.0 30.0 29.4 29.0 96.9%40 37.3 40.3 39.3 40.2 40.0 98.1%50 48.6 46.0 48.2 51.2 46.2 96.1%60 57.8 52.6 54.6 58.8 57.6 93.8%70 62.8 67.4 65.4 66.2 69.4 94.6%80 71.8 79.5 76.0 74.2 74.6 94.0%90 82.4 81.0 84.2 83.8 86.8 92.9%100 94.8 93.4 95.2 97.2 91.0 94.3%

Page 29: PAINSTAKINGLY  COUNTING  RICE Morphology and Object Recognition in Image Processing

OVERALLACCURACY

With industry grade strel filter

95% !!!

Page 30: PAINSTAKINGLY  COUNTING  RICE Morphology and Object Recognition in Image Processing

Rice Count Chart(Using our Circular Filter w/ HLS)

Actual # Number of Rice Counted Accuracy10 9.50 10.00 9.25 9.25 9.75 95.50%20 19.50 19.75 19.00 19.25 19.75 97.25%30 28.75 29.25 29.75 29.25 28.25 96.83%40 39.25 40.75 38.25 37.25 38.75 96.38%50 47.50 48.50 48.00 46.25 42.75 93.20%60 55.00 53.00 51.50 53.50 55.25 89.42%70 62.25 62.25 63.5 66.25 66.00 91.50%80 74.00 73.75 72.25 75.75 73.50 92.31%90 81.00 72.00 87.50 85.67 71.00 88.26%100 87.25 90.75 83.33 87.67 90.00 87.80%

Page 31: PAINSTAKINGLY  COUNTING  RICE Morphology and Object Recognition in Image Processing

OVERALLACCURACY

With our original circular filter

93% !!!

Page 32: PAINSTAKINGLY  COUNTING  RICE Morphology and Object Recognition in Image Processing

Progression• Given more time, we would use this

program to bring about world peace, and of course count the amount of rice it takes to cure world hunger…. By hand… and then have our program tell us that we are a couple of grains short of a bushel!!

Page 33: PAINSTAKINGLY  COUNTING  RICE Morphology and Object Recognition in Image Processing

No, Seriouslygiven more time…

• Refine the border program with switches.• Tracking rice centers instead of averaging

counts on multiple scans.• Better recognition of multiple-rice image

segments.• Reconstruction of overlapping rice.

Page 34: PAINSTAKINGLY  COUNTING  RICE Morphology and Object Recognition in Image Processing

THANK YOUFOR YOUR TIME!

ANY QUESTIONS?