首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >以两种分辨率扫描同一物体的两幅图像构造微观和宏观信息

以两种分辨率扫描同一物体的两幅图像构造微观和宏观信息
EN

Stack Overflow用户
提问于 2021-04-17 20:18:39
回答 1查看 56关注 0票数 0

我有扫描电镜图像扫描在两个放大,类似于这个样本图像。我想把这些合并成一个图像,这样我就可以在小尺度和大尺度上获得关于毛孔的信息。我想知道如何使用python或Matlab从那些2D切片创建单个图像。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-04-18 22:09:26

您可以使用MATLAB estimateGeometricTransform示例:

代码语言:javascript
复制
% Read the images.
I1 = rgb2gray(imread('macro.png'));
I2 = rgb2gray(imread('micro.png'));

% Reuse MATLAB example.
original = I1;
distorted = I2;

% Detect and extract features from the original and the transformed images.
% (Use more octaves and scales and lower threshold for improving robustness).
ptsOriginal  = detectSURFFeatures(original, 'NumOctaves', 5, 'NumScaleLevels', 5, 'MetricThreshold', 10);
ptsDistorted = detectSURFFeatures(distorted, 'NumOctaves', 5, 'NumScaleLevels', 5, 'MetricThreshold', 10);
[featuresOriginal,validPtsOriginal] = extractFeatures(original,ptsOriginal);
[featuresDistorted,validPtsDistorted] = extractFeatures(distorted,ptsDistorted);

% Match and display features between the images.
index_pairs = matchFeatures(featuresOriginal,featuresDistorted);
matchedPtsOriginal  = validPtsOriginal(index_pairs(:,1));
matchedPtsDistorted = validPtsDistorted(index_pairs(:,2));
figure
showMatchedFeatures(original,distorted,matchedPtsOriginal,matchedPtsDistorted)
title('Matched SURF Points With Outliers');

% Exclude the outliers, estimate the transformation matrix, and display the results.
[tform,inlierPtsDistorted,inlierPtsOriginal] = estimateGeometricTransform(matchedPtsDistorted,matchedPtsOriginal, 'similarity');
figure
showMatchedFeatures(original,distorted, inlierPtsOriginal,inlierPtsDistorted);
title('Matched inlier points');   

%Recover the original image from the distorted image.
outputView = imref2d(size(original));
Ir = imwarp(distorted,tform,'OutputView',outputView);
figure; imshow(Ir); 
title('Recovered image');

% Visualize it somehow...
imshowpair(original, Ir)

结果:

注意:

我手动删除了图像中的文本。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/67142592

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档