Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Inverse of an image array

  1. May 6, 2008 #1
    I'm trying to take the inverse of an image matrix by doing the following:

    >> A=imread ('noise.jpg');
    >> inv(A)

    But I'm getting the following error:

    ??? Undefined function or method 'inv' for input arguments of type 'uint8'.

    How can I change the image matrix so that I can take the inverse of it?
     
  2. jcsd
  3. May 10, 2008 #2
    Erm what?! hah

    well what lanagauge is that?! Matlab?
    maby try inv('noise.jpg') :S

    hmmm i duno not sure would be easier to know what language your doing it in and what functions or methods you have available.
     
  4. May 10, 2008 #3

    jtbell

    User Avatar

    Staff: Mentor

    If this is C++, you must be using some non-standard add-on library. imread() and inv() are not standard C++ functions, as far as I know.
     
  5. May 13, 2008 #4

    DrGreg

    User Avatar
    Science Advisor
    Gold Member

    I recognise this as MATLAB. It would have helped if you had said so.

    imread() takes an image file and returns an N x M x 3 array of 8-bit unsigned integers. inv() expects an N x N array of floating points.

    I have to ask why would you want to invert an image array? I don't understand the point.
     
  6. May 13, 2008 #5

    chroot

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    I also don't understand why you'd want the matrix inverse of an image, but you can use this:

    inv(double(A))

    You just need to convert the array to the double-precision floating-point datatype before inv() will know what to do with it.

    - Warren
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?



Similar Discussions: Inverse of an image array
  1. C++ Array (Replies: 10)

  2. C# arrays (Replies: 1)

  3. Array storage (Replies: 1)

Loading...