How Can I Take the Inverse of an Image Matrix in MATLAB?

AI Thread Summary
The discussion revolves around the attempt to invert an image matrix using MATLAB, specifically with the commands A=imread('noise.jpg') and inv(A). The user encounters an error indicating that the 'inv' function is undefined for 'uint8' input arguments. The conversation clarifies that imread returns an array of 8-bit unsigned integers, while the inv function requires a square matrix of double-precision floating-point numbers. The solution provided suggests converting the image matrix to double precision using inv(double(A)). Additionally, there is some confusion about the purpose of inverting an image matrix, with participants questioning the rationale behind this operation.
Az83
Messages
7
Reaction score
0
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?
 
Technology news on Phys.org
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.
 
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.
 
Az83 said:
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?
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.
 
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
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I had a Microsoft Technical interview this past Friday, the question I was asked was this : How do you find the middle value for a dataset that is too big to fit in RAM? I was not able to figure this out during the interview, but I have been look in this all weekend and I read something online that said it can be done at O(N) using something called the counting sort histogram algorithm ( I did not learn that in my advanced data structures and algorithms class). I have watched some youtube...
Back
Top