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

In summary: SmithIn summary, the conversation is about trying to take the inverse of an image matrix using MATLAB. The individual is getting an error because the function inv() is not defined for the input type of the image matrix. The expert suggests converting the matrix to a double-precision floating-point datatype before using the inv() function. The purpose of inverting an image matrix is questioned.
  • #1
Az83
7
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
  • #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.
 
  • #3
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.
 
  • #4
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.
 
  • #5
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
 

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

What is the inverse of an image array?

The inverse of an image array is a mathematical operation that reverses the values of each pixel in an image, resulting in a negative version of the original image.

Why would someone want to use the inverse of an image array?

The inverse of an image array can be used for various purposes such as creating artistic effects, enhancing image contrast, and correcting exposure issues.

How is the inverse of an image array calculated?

The inverse of an image array is calculated by subtracting the original pixel values from the maximum value possible (usually 255 in 8-bit images).

What is the difference between the inverse of an image array and a negative image?

The inverse of an image array and a negative image are often confused, but they are not the same. A negative image simply inverts the colors of an image, whereas the inverse of an image array inverts the pixel values.

Can the inverse of an image array be undone?

Yes, the inverse of an image array can be undone by applying the inverse operation again.

Similar threads

Replies
23
Views
5K
Replies
1
Views
3K
Replies
1
Views
1K
Replies
2
Views
2K
Replies
4
Views
3K
Replies
1
Views
1K
Replies
2
Views
988
Back
Top