Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Image rotation detection probelm
Replies: 32   Last Post: Aug 8, 2013 10:46 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Phillip

Posts: 12
Registered: 8/2/10
Re: Image rotation detection probelm
Posted: Dec 11, 2012 5:54 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hi Darren,

The warning appears because you can't do much useful maths on an integer array. Just follow the suggestion shown in the warning. This will convert the image from integer to double/single precision "float" (i.e. a number that can have decimal points). Single uses half the memory but you get half the precision in terms of decimal points etc... generally use single if you are worried about memory issues, otherwise, you may as well use double. The default for new Matlab variables is double.

Cheers,

Phillip

"Darren g" wrote in message <ka74i0$32b$1@newscl01ah.mathworks.com>...
> Hi Phillip,
>
> Thanks. I have tried the following code for measuring the pure shift but it show the error
>
> Warning: CONV2 on values of class UINT8 is obsolete.
> Use CONV2(DOUBLE(A),DOUBLE(B)) or CONV2(SINGLE(A),SINGLE(B)) instead.

> > In uint8.conv2 at 11
> In xcorr2 at 17
> In translation at 18
>
> The code is here.
>
> clear all;
> image1 = imread('0001.jpg');
>
> xShift = 0;
> yShift = 20;
> translatingElement = translate(strel(1), [yShift xShift]);
> image2 = imdilate(image1,translatingElement);
> image1 = image1(1+yShift:end-yShift,1+xShift:end-xShift);
> % get rid of Infs from the imdilate function
> image2 = image2(1+yShift:end-yShift,1+xShift:end-xShift);
> figure (1);
> imagesc(image1);
> axis image;
> figure (2);
> imagesc(image2);
> axis image;
>
> d = xcorr2(image1,image2);
> figure (3);
> imagesc(d);
> axis image;
> [maxd, maxd_pos_Col] = max(max(d))
> [maxd, maxd_pos_Row] = max(d(:, maxd_pos_Col))
>
> Shift = RowCentre - maxd_pos_Row
>
> I could not figure out the error?
>
> Thanks.
> Darren



Date Subject Author
6/19/09
Read Image rotation detection probelm
Pradyumna A
6/19/09
Read Re: Image rotation detection probelm
Matt
9/16/09
Read Re: Image rotation detection probelm
Hamid Reza Mohseni Nejad
8/2/10
Read Re: Image rotation detection probelm
Phillip
12/21/10
Read Re: Image rotation detection probelm
chee ali
12/21/10
Read Re: Image rotation detection probelm
Phillip
12/21/10
Read Re: Image rotation detection probelm
Matt J
12/21/10
Read Re: Image rotation detection probelm
Phillip
11/14/12
Read Re: Image rotation detection probelm
Darren g
11/14/12
Read Re: Image rotation detection probelm
Phillip
11/19/12
Read Re: Image rotation detection probelm
Darren g
11/19/12
Read Re: Image rotation detection probelm
Phillip
11/20/12
Read Re: Image rotation detection probelm
Darren g
11/20/12
Read Re: Image rotation detection probelm
Phillip
11/26/12
Read Re: Image rotation detection probelm
Darren g
11/26/12
Read Re: Image rotation detection probelm
Phillip
11/27/12
Read Re: Image rotation detection probelm
Darren g
11/28/12
Read Re: Image rotation detection probelm
Phillip
11/29/12
Read Re: Image rotation detection probelm
Darren g
12/2/12
Read Re: Image rotation detection probelm
Phillip
12/3/12
Read Re: Image rotation detection probelm
Darren g
12/4/12
Read Re: Image rotation detection probelm
Phillip
12/11/12
Read Re: Image rotation detection probelm
Darren g
12/11/12
Read Re: Image rotation detection probelm
Phillip
12/12/12
Read Re: Image rotation detection probelm
Darren g
12/12/12
Read Re: Image rotation detection probelm
Steven Lord
2/6/13
Read Re: Image rotation detection probelm
Darren g
12/20/12
Read Re: Image rotation detection probelm
Phillip
12/20/12
Read Re: Image rotation detection probelm
Kev
12/20/12
Read Re: Image rotation detection probelm
Kev
7/7/13
Read Re: Image rotation detection probelm
xmlfor
8/8/13
Read Re: Image rotation detection probelm
jacaboo

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.