Problem with image registration on images with simple patterns
显示 更早的评论
I have trouble matching features on images with simple patterns like shown in two attached pictures. SURF, BRISK and other feature detection functions in CV toolbox work well with images rich in features but fail at these -see the attached result of automatic image registration. I tried every feature detection function the toolbox offers and tried changing various input parameters like thresholds, quality, contrast, octaves, filter sizes, etc without any luck. I also tried binarizing the images and separately HOG feature extractor. The script below that I used is straight from Matlab examples.
Can anyone (@Image Analyst @Walter Roberson) advise?
Thanks!
original = rgb2gray(imread('A0.png'));
ptsOriginal = detectSURFFeatures(original,'NumOctaves',1,'NumScaleLevels',5,'MetricThreshold',10);
[featuresOriginal,validPtsOriginal] = extractFeatures(original,ptsOriginal);
figure
distorted = rgb2gray(imread(sprintf('A2.png',k)));
subplot(121), imshowpair(original,distorted,'m'),
ptsDistorted = detectSURFFeatures(distorted,'NumOctaves',1,'NumScaleLevels',5,'MetricThreshold',5);
[featuresDistorted,validPtsDistorted] = extractFeatures(distorted,ptsDistorted);
indexPairs = matchFeatures(featuresOriginal,featuresDistorted);
matchedOriginal = validPtsOriginal(indexPairs(:,1));
matchedDistorted = validPtsDistorted(indexPairs(:,2));
[tform, inlierDistorted,inlierOriginal] = ...
estimateGeometricTransform(matchedDistorted,...
matchedOriginal,'similarity');
outputView = imref2d(size(original));
recovered = imwarp(distorted,tform,'OutputView',outputView);
subplot(122), imshowpair(original,recovered)

采纳的回答
更多回答(1 个)
Image Analyst
2020-8-19
1 个投票
I think the periodicity and enormous translations and rotations may be causing problem. You might try imregcorr().
Otherwise try segmenting out the rectangle using tradtional methods:
- Threshold the image
- call regionprops asking for centroids.
- fit a line with polyfit through the centroids to determine the angle
- Call imrotate
- threshold again and call regionprops
- call imtranslate to align with other, reference image.
or:
- Threshold the image
- call bwconvhull(mask, 'union')
- call regionprops asking for orientation
- call imrotate
- threshold again and call regionprops
- call imtranslate
2 个评论
Image Analyst
2020-8-19
类别
在 帮助中心 和 File Exchange 中查找有关 Computer Vision with Simulink 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

