Lab 2

Original Images:

I took my 2 photos for each sized targets at each distance of 2, 4, 8, and 16 feet. The photos were taken inline with the center of the target. I also blured the image to help get ride of any noise on the balls.

2ft Small Target Slightly Blured:
2ft Large Target Slightly Blured:
4ft Small Target Slightly Blured:
4ft Large Target Slightly Blured:
8ft Small Target Slightly Blured:
8ft Large Target Slightly Blured:
16ft Small Target Slightly Blured:
16ft Large Target Slightly Blured:

Thresholded Image:

To threshold the image, I converted the rgb image to hsv and then found values of hue and saturation which matched those of the tennis balls.

2ft Small Target:
2ft Large Target:
4ft Small Target:
4ft Large Target:
8ft Small Target:
8ft Large Target:
16ft Small Target:
16ft Large Target:

Segmented Image:

Red dots have been placed in the center of each segment to identify the different segments. I found the segments using the wavefront algorithim.

2ft Small Target:
2ft Large Target:
4ft Small Target:
4ft Large Target:
8ft Small Target:
8ft Large Target:
16ft Small Target:
16ft Large Target:

Data:

2ft Small Target

Centroids(row,col): (150,1019), (173,613), (532,628), (537,1016)
Pixel Counts Per Region(in same order as centroids): 35881, 35874, 34913, 33315 px
Estimated Pixels per Inch: 80.97

2ft Large Target

Centroids(row,col): (107,1398), (113,395), (1069,408), (1073,1381)
Pixel Counts Per Region(in same order as centroids): 21941, 22294, 23896, 23660 px
Estimated Pixels per Inch: 66.89

4ft Small Target

Centroids(row,col): (431,954), (440,784), (590,790), (592,955)
Pixel Counts Per Region(in same order as centroids): 6007, 6125, 6464, 6007 px
Estimated Pixels per Inch: 33.88

4ft Large Target

Centroids(row,col): (275,1173), (282,670), (757,678), (760,1163)
Pixel Counts Per Region(in same order as centroids): 5716 5641 5568 5792 px
Estimated Pixels per Inch: 33.88

8ft Small Target

Centroids(row,col): (532,798), (537,717), (609,721), (609,799)
Pixel Counts Per Region(in same order as centroids): 1350, 1428, 1529, 1345 px
Estimated Pixels per Inch: 16.22

8ft Large Target

Centroids(row,col): (480,1009), (484,768) ,(712,770), (712,1009)
Pixel Counts Per Region(in same order as centroids): 968, 1033, 1229, 1230 px
Estimated Pixels per Inch: 16.04

16ft Small Target

Centroids(row,col): (578,837), (580,798), (614,800), (615,837)
Pixel Counts Per Region(in same order as centroids): 250, 262, 331, 221 px
Estimated Pixels per Inch: 7.878

16ft Large Target

Centroids(row,col): (519,971),(520,854),(633,855),(633,972)
Pixel Counts Per Region(in same order as centroids): 134, 173, 275, 255 px
Estimated Pixels per Inch: 7.79

Distance Estimation:

2 ft Small Target

Estimated Distance: 1.6ft
Actual Distance: 2ft
Percentage Error: 20%
*This is the only outlier, all other errors are below 5%.

2 ft Large Target

Estimated Distance: 1.94ft
Actual Distance: 2ft
Percentage Error: 3%

4 ft Small Target

Estimated Distance: 3.828ft
Actual Distance: 4ft
Percentage Error: 4.3%

4 ft Large Target

Estimated Distance: 3.868ft
Actual Distance: 4ft
Percentage Error: 3.3%

8 ft Small Target

Estimated Distance: 7.99ft
Actual Distance: 8ft
Percentage Error: .125%

8 ft Large Target

Estimated Distance: 8.08ft
Actual Distance: 8ft
Percentage Error: 1%

16 ft Small Target

Estimated Distance: 16.45ft
Actual Distance: 16ft
Percentage Error: 2.81%

16 ft Large Target

Estimated Distance: 16.64ft
Actual Distance: 16ft
Percentage Error: 4%

Error Graph

Small Target Errors:

Large Target Errors:

Sources of Error:

It appears that a notable source of error is from positioning of the camera since one of the 2 feet images had 20% error while all other errors were under 5%. This could be a result of the same positioning error is much more signifigant at 2ft than it is at greater distances.