What is the best method to use for interpolating RGB true colour images?
9 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
cui,xingxing
le 21 Sep 2022
Commenté : cui,xingxing
le 14 Oct 2022
What is the best method to use for interpolating RGB true colour images? It seems that I am not using the following 4 methods very well, the first and the fourth are actually the same, and the second interp2 cannot interpolate the R,G,B channels at the same time? The third method only supports ndgrid grid points and cannot interpolate images?
%% test performance speed
load param.mat % required params
numTimes = 1000; % test times
%% method1
t1 = tic;
for i = 1:numTimes
dstImg = imwarp(src,tform,OutputView=outputView);
end
T1 = toc(t1)
imshow(dstImg)
%% method2
t1 = tic;
for i = 1:numTimes
birdsEyeImgR = interp2(src(:,:,1),mapX,mapY,"linear",0);
% birdsEyeImgG = interp2(src(:,:,2),mapX,mapY,"linear",0);
% birdsEyeImgB = interp2(src(:,:,3),mapX,mapY,"linear",0);
% birdsEyeImg = cat(3,birdsEyeImgR,birdsEyeImgG,birdsEyeImgB);
end
T2 = toc(t1)
imshow(birdsEyeImgR)
%% method3, not is my expected result image
t1 = tic;
[X,Y] = ndgrid(1:size(src,1),1:size(src,2));
F = griddedInterpolant(X,Y,src,'linear','nearest');
for i = 1:numTimes
birdsEyeImgF = F(mapX,mapY);
end
T3 = toc(t1)
imshow(birdsEyeImgF)
%% method4
t1 = tic;
for i = 1:numTimes
BEV = transformImage(birdsEye,src);
end
T4 = toc(t1)
imshow(BEV)
Any recommendations for a more efficient method? your answer would be greatly appreciate!
0 commentaires
Réponse acceptée
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Geometric Transformation and Image Registration dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!