How to perform xcorr2 only in one direction?

1 次查看(过去 30 天)
Hi,
I'm working on two images having the same dimensions. They don't require to be aligned vertically, but only horizontally. Thus, because the images are very big, I would like to perform the xcorr2 function, but only in the horizontal direction, avoiding the unnecessary overlaps, to save time (currently, it takes about 75 minutes).
Is this possible? How?
Thanks for your answers.

回答(1 个)

Dimitris Iliou
Dimitris Iliou 2016-10-14
If I understand correctly, you are trying to use xcorr2 to align two images and also improve the processing time.
In general, xcorr2 is a function used to compare 2-D arrays; not specifically images.
That said, I would like to suggest two different things:
  1. xcorr2 allows you to use gpuArrays which will allow you to use the Parallel Computing Toolbox. This method has two caveats; the prerequisites to use this method are: (1) Parallel Computing Toolbox, (2) A CUDA-enabled GPU
  2. Instead of using xcrorr2 you could use the imregcorr function that is designed to work with images.
  • To use this function you would need to have the Image Processing Toolbox
  • You can find more details about this function in the following link:
In general, MATLAB has a set of functions that allow the automatic registration of images. Please see the following link for more details:
  1 个评论
Nut
Nut 2016-10-24
编辑:Nut 2016-10-24
I just had a look, your suggestions are not exactly the operation I asked, however the second one may fulfil my needs the same. I will try it.
Both your answers are very interesting, especially the second one. I didn't know the image registration techniques, so thank you very much, really great tip!
PS: I was trying to align the images using xcorr2 function because its documentation explains how to solve a similar problem, so I was using that method. As you correctly said, it entails a conversion from uint8 to double.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Image Processing Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by