91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 3KB
    文件類型: .m
    金幣: 1
    下載: 0 次
    發布日期: 2021-06-05
  • 語言: Matlab
  • 標簽: Image??stitch??

資源簡介

這個代碼用于數字圖像處理中的圖像拼接,幾幅具有公共區域的圖像可以拼接成一幅全圖。

資源截圖

代碼片段和文件信息

%?Load?images.
buildingDir?=?fullfile(toolboxdir(‘vision‘)?‘visiondata‘?‘building‘);
buildingScene?=?imageDatastore(buildingDir);

%?Display?images?to?be?stitched
montage(buildingScene.Files)

%?Read?the?first?image?from?the?image?set.
I?=?readimage(buildingScene?1);

%?Initialize?features?for?I(1)
grayImage?=?rgb2gray(I);
points?=?detectSURFFeatures(grayImage);
[features?points]?=?extractFeatures(grayImage?points);

%?Initialize?all?the?transforms?to?the?identity?matrix.?Note?that?the
%?projective?transform?is?used?here?because?the?building?images?are?fairly
%?close?to?the?camera.?Had?the?scene?been?captured?from?a?further?distance
%?an?affine?transform?would?suffice.
numImages?=?numel(buildingScene.Files);
tforms(numImages)?=?projective2d(eye(3));

%?Iterate?over?remaining?image?pairs
for?n?=?2:numImages

????%?Store?points?and?features?for?I(n-1).
????pointsPrevious?=?points;
????featuresPrevious?=?features;

????%?Read?I(n).
????I?=?readimage(buildingScene?n);

????%?Detect?and?extract?SURF?features?for?I(n).
????grayImage?=?rgb2gray(I);
????points?=?detectSURFFeatures(grayImage);
????[features?points]?=?extractFeatures(grayImage?points);

????%?Find?correspondences?between?I(n)?and?I(n-1).
????indexPairs?=?matchFeatures(features?featuresPrevious?‘Unique‘?true);

????matchedPoints?=?points(indexPairs(:1)?:);
????matchedPointsPrev?=?pointsPrevious(indexPairs(:2)?:);

????%?Estimate?the?transformation?between?I(n)?and?I(n-1).
????tforms(n)?=?estimateGeometricTransform(matchedPoints?matchedPointsPrev...
????????‘projective‘?‘Confidence‘?99.9?‘MaxNumTrials‘?2000);

????%?Compute?T(1)?*?...?*?T(n-1)?*?T(n)
????tforms(n).T?=?tforms(n-1)

評論

共有 條評論