Skip to content

Commit

Permalink
Sign flip
Browse files Browse the repository at this point in the history
  • Loading branch information
pierotofy committed Jun 16, 2022
1 parent d211d36 commit 1eb76a4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions bin/rs_plot
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ def plot_features(image, points, orig_points):
for p, s, a in zip(pixels_orig, sizes_orig, angles_orig):
orig_patches.append(Wedge(p, s, a + 1, a - 1))

collection = PatchCollection(patches, alpha=0.5, edgecolor='r', facecolor='w')
orig_collection = PatchCollection(orig_patches, alpha=1, edgecolor='b', facecolor='w')
collection = PatchCollection(patches, alpha=0.5, edgecolor='b', facecolor='w')
orig_collection = PatchCollection(orig_patches, alpha=0.5, edgecolor='r', facecolor='w')

ax.add_collection(orig_collection)
ax.add_collection(collection)
Expand Down
8 changes: 4 additions & 4 deletions opensfm/actions/rs_correct.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,16 +108,16 @@ def run_dataset(dataset: DataSetBase, rolling_shutter_readout: Optional[float])

error = reprojected_point - point

# Calculate new camera pose using the formula
# used in: A two-step approach for the correction of rolling
# Calculate new camera pose using the ideas
# from: A two-step approach for the correction of rolling
# shutter distortion in UAV photogrammetry
# https://www.sciencedirect.com/science/article/abs/pii/S0924271619302849

pixel_y = shot.camera.normalized_to_pixel_coordinates(point)[1]
rs_time = exifs[shot_id].get('rolling_shutter', rolling_shutter_readout) / 1000.0
origin = shot.pose.get_origin()

new_origin = origin + exifs[shot_id]['speed'] * rs_time * (pixel_y - shot.camera.height / 2.0) / shot.camera.height
new_origin = origin - exifs[shot_id]['speed'] * rs_time * (pixel_y - shot.camera.height / 2.0) / shot.camera.height

# Reproject the point using the new origin
shot.pose.set_origin(new_origin)
Expand Down

0 comments on commit 1eb76a4

Please sign in to comment.