Error message in Intensity-Based Automatic Image Registration

10 ビュー (過去 30 日間)
Matthew Alston
Matthew Alston 2014 年 6 月 11 日
コメント済み: Walter Roberson 2021 年 3 月 2 日
Hi
I am trying to compare and analyze blank and dermatome maps (attached) in order to quantify number of shaded pixels and percentage of shaded pixels within the template body outline. Ultimately this will be used with pain and paresthesia maps. My understanding is that I wil want to use Image Registration in the Image processing toolbox, and that 'Intensity-Based Automatic Image Registration' would serve my purposes. While following the online tutorial I keep running into this error when I try to use imRegister:
Error using imregtform>parseInputs (line 252) The value of 'MovingImage' is invalid. All dimensions of the moving image should be greater than 4.
Error in imregtform (line 123) parsedInputs = parseInputs(varargin{:});
Error in imregister (line 119) tform = imregtform(varargin{:});
Any help on how to solve this problem or any general information on image registration would be greatly appreciated. My entire coding attempt is below for your viewing pleasure:
>> fixed = imread ('blankmap.jpg');
>> moving = imread ('dermatomemap.jpg');
>> figure, imshowpair (moving, fixed, 'montage')
Warning: Image is too big to fit on screen; displaying at 13% > In imuitools/private/initSize at 71 In imshow at 282 In imshowpair at 124
>> title ('unregistered')
>> [optimizer, metric] = imregconfig ('multimodal'); >> movingRegisteredDefault = imregister (moving, fixed, 'affine', optimizer, metric);
Error using imregtform>parseInputs (line 252) The value of 'MovingImage' is invalid. All dimensions of the moving image should be greater than 4.
Error in imregtform (line 123) parsedInputs = parseInputs(varargin{:});
Error in imregister (line 119) tform = imregtform(varargin{:});
Matt

採用された回答

Ben11
Ben11 2014 年 6 月 11 日
It might be that you need to use grayscale images (using rgb2gray). Eg:
movingRegisteredDefault = imregister (rgb2gray(moving), rgb2gray(fixed), 'affine', optimizer, metric);
or you can register using a single channel :
movingRegisteredDefault = imregister (moving(:,:,Channel), fixed(:,:,Channel), 'affine', optimizer, metric);
  4 件のコメント
mengying zhao
mengying zhao 2021 年 3 月 2 日
the second idea,shows don't define channel?how to solve?
Walter Roberson
Walter Roberson 2021 年 3 月 2 日
If you are registering a particular single channel, then assign the channel number to Channel before executing the code.

サインインしてコメントする。

その他の回答 (1 件)

Anand
Anand 2014 年 6 月 11 日
imregister expects the 2-D images to be in grayscale. It does not use color information as part of the registration.
If you're images are in RGB colorspace, you can do this:
moving = rgb2gray(moving);
fixed = rgb2gray(fixed);
[optimizer, metric] = imregconfig('multimodal');
movingRegisteredDefault = imregister(moving, fixed, 'affine', optimizer, metric);
  1 件のコメント
Matthew Alston
Matthew Alston 2014 年 6 月 11 日
Ahh thank you guys, that seems to have solved the problem

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeGeometric Transformation and Image Registration についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by