[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: conv2 shows error

From: Søren Hauberg
Subject: Re: conv2 shows error
Date: Wed, 06 Jul 2011 21:15:31 +0200

tor, 07 07 2011 kl. 00:28 +0530, skrev Junise Bin Abdul Nazar:
> Hi all,
> I am new to gnu octave. During my degree I used matlab as a part of my 
> syllabus.
> Now as a promoter of free software, I have started using octave
> instead of matlab.
> Now when I type the command:
> <*>S = conv2 (I, ones (5, 5) / 25, "same");<*>
> it showed the error:
> <*>error: invalid conversion of uint8 matrix to Matrix<*>
>  I cannot understand this. Please explain.

You did not specify the value of 'I' -- I assume you are not computing
the spatial average of the imaginary unit. My guess is that 'I' is an
image represented as an 'uint8' matrix. To use 'conv2' you need to cast
it into a 'double' matrix, i.e.

  S = conv2 (double (I), ones (5, 5) / 25, "same");

Alternatively, you can use the 'imfilter' function from the 'image'
package -- it takes care of types for you.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]