chsasank/Image-Rectification
关于
Compute Vanishing points using RANSAC and rectify the image
设计与媒体实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- 0
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文Automated Rectification of Image
Implements the modified version of the following paper:
Modifcation note: Instead of finding edge direction using structural tensor and its eigenvectors as in paper, I have used more reliable canny edge detection and probabalistic hough line transform.
Results
Input image:

After rectification:

How it works
First, compute list of 'edgelets'. An edgelet is a tuple of edge location, edge direction and edge strength.
edgelets1 = compute_edgelets(image)
vis_edgelets(image, edgelets1) # Visualize the edgelets

Next, find dominant vanishing point using ransac algorithm. In our case it turns out to be horizontal.
vp1 = ransac_vanishing_point(edgelets1, num_ransac_iter=2000,
threshold_inlier=5)
vp1 = reestimate_model(vp1, edgelets1, threshold_reestimate=5)
vis_model(image, vp1) # Visualize the vanishing point model

Remove the inliers for horizontal vanishing point. Vertical lines should now be dominant. Recompute the vanishing point using ransac should give us vertical vanishing point.
edgelets2 = remove_inliers(vp1, edgelets1, 10)
vp2 = ransac_vanishing_point(edgelets2, num_ransac_iter=2000,
threshold_inlier=5)
vp2 = reestimate_model(vp2, edgelets2, threshold_reestimate=5)
vis_model(image, vp2) # Visualize the vanishing point model

Finally, compute homography and warp the image so that we have a fronto parellel view with orthogonal axes:
warped_img = compute_homography_and_warp(image, vp1, vp2,
clip_factor=clip_factor)

探索相关项目
加载中…