Image 是否有其他方法返回rgb图像以提取注册图像中的初始计数?

Image 是否有其他方法返回rgb图像以提取注册图像中的初始计数?,image,matlab,rgb,Image,Matlab,Rgb,我已经进行了图像注册,现在我想在rgb中应用注册的图像,因为我需要提取countourr。由于imregister只处理灰度图像,我将图像转换为灰度,但现在我无法找到轮廓的强度值来找到轮廓索引。imregister应用于图像的哪种算法来改变像素的强度值?或者有另一种方法返回到rgb图像以提取注册图像中的初始计数?有人有什么建议吗? 下面是我的matlab代码: % Algorithm for image validation % Open the two images which will be

我已经进行了图像注册,现在我想在rgb中应用注册的图像,因为我需要提取countourr。由于imregister只处理灰度图像,我将图像转换为灰度,但现在我无法找到轮廓的强度值来找到轮廓索引。imregister应用于图像的哪种算法来改变像素的强度值?或者有另一种方法返回到rgb图像以提取注册图像中的初始计数?有人有什么建议吗? 下面是我的matlab代码:

% Algorithm for image validation
% Open the two images which will be compared
name2=input('Image name ( automated segmentation)     ','s');
img_automated=imread(name2,'png');
figure (1), imshow(img_automated), title('Image automated')
name=input('Image name ( manual segmentation)     ','s');
img_manual=imread(name,'png');
img_manual_gray=rgb2gray(img_manual);
%img_manual_gray=img_manual(:,:,3);
figure (2), imshow (img_manual),title('Image manual')
img_automated_gray=rgb2gray(img_automated);
%img_automated_gray=img_automated(:,:,3);
%img_double=im2double(img_automated_gray);
figure (3), imshow (img_automated_gray), title (' Image converted to double ');

%img_automated_gray2=rgb2gray(img_automated);
% View images side by side
figure (6), imshowpair(img_manual,img_automated_eq,'diff')
title('Images overlap')
   %% Configure parameters in imreconfig
  [optimizer,metric]=imregconfig('Multimodal');
%% Default registration
registered=imregister(img_automated_gray,img_manual_gray,'rigid',optimizer,metric);
%tform = imregtform(img_automated,img_manual,imref2d,'affine',optimizer,metric)
figure(7), imshowpair(registered, img_manual_gray,'falsecolor'); title('Default registration');
figure(8), imshowpair(registered, img_manual_gray,'montage','Scaling','independent'); title('Default registration');
figure(9), imshow(registered);

C = imfuse(registered,img_automated);
figure(21);imshow(C);

%%%%%%%%%%%%%%% Here%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%我尝试了这个过程来恢复注册图像中应用的转换,他们在初始的自动rgb图像中应用了这个过程,但是B与注册图像不同。有什么建议吗

tform = imregtform(img_automated_gray,img_manual_gray,'rigid',optimizer,metric);
B = imwarp(img_automated,tform);
figure(22);imshow(B);
图片链接: (手册-rgb)
您使用imregtform的方法是正确的。缺少的一点是,默认情况下,imwarp选择的输出网格的分辨率与输入网格的分辨率相同,并且限制足够大,可以捕获整个输出图像

在大多数注册案例中,这不是您想要的。您需要的是指定“OutputView”名称/值,以指定输出网格中所需的分辨率和限制。在许多注册用例中,这是固定图像的分辨率/限制:

tform = imregtform(img_automated_gray,img_manual_gray,'rigid',optimizer,metric);
B = imwarp(img_automated,tform,'OutputView',imref2d(size(img_manual_gray)));
figure(22);imshow(B);

你能把你的问题缩小到最小的代码吗?你能在相反的方向上进行配准,这样带轮廓的图像就是参考图像吗?不,因为我希望手动分割是我的参考图像,而不是带计数的初始rgb图像,这是我想注册的与手动分割相关的图像(传递到同一坐标系)。我的问题是,配准过程改变了配准图像的强度值,因此无法提取配准图像的计数。你有什么建议可以去伯爵府吗?