Skip to content

Commit 5583c00

Browse files
committed
Just making sure all checked in
1 parent 28c9a1d commit 5583c00

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

Image_based/BaseStatsImage.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ def __init__(self, fname_mask_image, fname_calculated=None, fname_debug=None, b_
6363
# Cached data doesn't exist, or we need to re-calculated
6464
self.stats_dict = self.stats_image(self.mask_image)
6565

66+
# TODO pull out into a read/write method
6667
try:
6768
# Convert any numpy arrays to lists prior to writing out
6869
for k, v in self.stats_dict.items():

Image_based/bezier_cyl_2d.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,7 @@ def read_json(fname, bezier_crv=None):
454454
bezier_crv_horiz = BezierCyl2D([10, 130], [620, 60], 40, [320, 190])
455455
assert(bezier_crv_horiz.orientation == "horizontal")
456456
assert(not bezier_crv_horiz.is_wire())
457+
# TODO set the two radii to be different and check that it renders corectly
457458
# Make a vertical curve
458459
bezier_crv_vert = BezierCyl2D([320, 30], [290, 470], 40, [310, 210])
459460
assert(bezier_crv_vert.orientation == "vertical")

Image_based/fit_bezier_cyl_2d_mask.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,9 @@
1717

1818

1919
class FitBezierCyl2DMask:
20-
def __init__(self, fname_mask_image, stats_image, fname_calculated=None, fname_debug=None, b_recalc=False):
20+
def __init__(self, fname_mask_image, fname_calculated=None, fname_debug=None, b_recalc=False):
2121
""" Read in the mask image, use the stats to start the quad fit, then fit the quad
2222
@param fname_mask_image: Mask image name
23-
@param stats_image: the stats for this image
2423
@param fname_calculated: the file name for the saved .json file; should be image name w/o _stats.json
2524
@param fname_debug: the file name for a debug image showing the bounding box, etc
2625
@param b_recalc: Force recalculate the result, y/n"""
@@ -98,11 +97,11 @@ def __init__(self, fname_mask_image, stats_image, fname_calculated=None, fname_d
9897
@staticmethod
9998
def create_bezier_crv_from_eigen_vectors(bezier_crv, im_mask, stats, params):
10099
""" Fit a quad to the mask, edge image
101-
@param bezier_crv - a blank bezier curve
100+
@param bezier_crv - a blank bezier curve (class BezierCyl2D)
102101
@param im_mask - the image mask
103-
@param stats - the stats from BaseStatsImage
102+
@param stats - the stats from BaseStatsImage (class BaseStatsImage)
104103
@param params - the parameters to use in the fit
105-
@return fitted quad and parameters used in the fit"""
104+
@return fitted Bezier and parameters used in the fit"""
106105

107106
# Fit a Bezier curve to the mask - this does a bit of tweaking to try to extend the end points as
108107
# far as possible
@@ -119,6 +118,7 @@ def create_bezier_crv_from_eigen_vectors(bezier_crv, im_mask, stats, params):
119118
vec_len = vec_len * 1.1
120119

121120
bezier_crv = BezierCyl2D(pt_lower_left, pt_upper_right, 0.5 * stats['width'])
121+
return bezier_crv, params
122122

123123
@staticmethod
124124
def _adjust_bezier_crv_by_mask(fit_bezier_crv, im_mask, step_size=40, perc_width=1.2):

0 commit comments

Comments
 (0)