getImage
Description
Examples
Read Image Stored in OpenCV Mat
Class
Add the MATLAB interface to OpenCV package names to the import list.
import clib.opencv.* import vision.opencv.util.*
Read an image into the MATLAB workspace.
img = imread("cameraman.tif");
Create a MATLAB interface object for the OpenCV InputOutput
array class.
[ocvMat,ocvArray] = createMat(img);
Read the image stored in the InputOutput
interface object.
output = getImage(ocvArray);
Display the output image.
figure imshow(output)
Input Arguments
ocvInput
— MATLAB interface object for OpenCV class
MatND
interface object | UMat
interface object | InputArray
interface object | InputOutputArray
interface object | OutputArray
interface object
MATLAB interface object for an OpenCV class, specified as one of these values:
MatND
interface object — Created by using thecreateMat
function and represents the OpenCVcv::Mat
class.UMat
interface object — Created by using thecreateUMat
function and represents the OpenCVcv::UMat
class.InputArray
interface object — Created by using thecreateMat
orcreateUMat
function and represents the OpenCVcv::_InputArray
class. TheInputArray
interface object passes array inputs to the OpenCV functions.InputOutputArray
interface object — Created by using thecreateMat
orcreateUMat
function and represents the OpenCVcv::_InputOutputArray
class. TheInputOutputArray
interface object passes array inputs to the OpenCV functions and writes the array outputs returned by the OpenCV functions.OutputArray
interface object — Created by using thecreateMat
orcreateUMat
function and represents the OpenCVcv::_OutputArray
class. TheOutputArray
interface object contains the array outputs returned by the OpenCV functions.
Output Arguments
outputImg
— Output image
M-by-N matrix | M-by-N-by-3 array
Output image read from a MATLAB interface object, returned as an M-by-N matrix for intensity images and M-by-N-by-3 array for color images.
Version History
Introduced in R2021b
Comando de MATLAB
Ha hecho clic en un enlace que corresponde a este comando de MATLAB:
Ejecute el comando introduciéndolo en la ventana de comandos de MATLAB. Los navegadores web no admiten comandos de MATLAB.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)