public class Imgcodecs extends Object
Constructor and Description |
---|
Imgcodecs() |
Modifier and Type | Method and Description |
---|---|
static boolean |
haveImageReader(String filename)
Returns true if the specified image can be decoded by OpenCV
|
static boolean |
haveImageWriter(String filename)
Returns true if an image with the specified filename can be encoded by OpenCV
|
static Mat |
imdecode(Mat buf,
int flags)
Reads an image from a buffer in memory.
|
static boolean |
imencode(String ext,
Mat img,
MatOfByte buf)
Encodes an image into a memory buffer.
|
static boolean |
imencode(String ext,
Mat img,
MatOfByte buf,
MatOfInt params)
Encodes an image into a memory buffer.
|
static Mat |
imread(String filename)
Loads an image from a file.
|
static Mat |
imread(String filename,
int flags)
Loads an image from a file.
|
static boolean |
imreadmulti(String filename,
List<Mat> mats)
Loads a multi-page image from a file.
|
static boolean |
imreadmulti(String filename,
List<Mat> mats,
int flags)
Loads a multi-page image from a file.
|
static boolean |
imwrite(String filename,
Mat img)
Saves an image to a specified file.
|
static boolean |
imwrite(String filename,
Mat img,
MatOfInt params)
Saves an image to a specified file.
|
public static final int IMWRITE_EXR_TYPE_HALF
public static final int IMWRITE_EXR_TYPE_FLOAT
public static final int IMREAD_UNCHANGED
public static final int IMREAD_GRAYSCALE
public static final int IMREAD_COLOR
public static final int IMREAD_ANYDEPTH
public static final int IMREAD_ANYCOLOR
public static final int IMREAD_LOAD_GDAL
public static final int IMREAD_REDUCED_GRAYSCALE_2
public static final int IMREAD_REDUCED_COLOR_2
public static final int IMREAD_REDUCED_GRAYSCALE_4
public static final int IMREAD_REDUCED_COLOR_4
public static final int IMREAD_REDUCED_GRAYSCALE_8
public static final int IMREAD_REDUCED_COLOR_8
public static final int IMREAD_IGNORE_ORIENTATION
public static final int IMWRITE_PNG_STRATEGY_DEFAULT
public static final int IMWRITE_PNG_STRATEGY_FILTERED
public static final int IMWRITE_PNG_STRATEGY_HUFFMAN_ONLY
public static final int IMWRITE_PNG_STRATEGY_RLE
public static final int IMWRITE_PNG_STRATEGY_FIXED
public static final int IMWRITE_PAM_FORMAT_NULL
public static final int IMWRITE_PAM_FORMAT_BLACKANDWHITE
public static final int IMWRITE_PAM_FORMAT_GRAYSCALE
public static final int IMWRITE_PAM_FORMAT_GRAYSCALE_ALPHA
public static final int IMWRITE_PAM_FORMAT_RGB
public static final int IMWRITE_PAM_FORMAT_RGB_ALPHA
public static final int IMWRITE_JPEG_QUALITY
public static final int IMWRITE_JPEG_PROGRESSIVE
public static final int IMWRITE_JPEG_OPTIMIZE
public static final int IMWRITE_JPEG_RST_INTERVAL
public static final int IMWRITE_JPEG_LUMA_QUALITY
public static final int IMWRITE_JPEG_CHROMA_QUALITY
public static final int IMWRITE_PNG_COMPRESSION
public static final int IMWRITE_PNG_STRATEGY
public static final int IMWRITE_PNG_BILEVEL
public static final int IMWRITE_PXM_BINARY
public static final int IMWRITE_EXR_TYPE
public static final int IMWRITE_WEBP_QUALITY
public static final int IMWRITE_PAM_TUPLETYPE
public static final int IMWRITE_TIFF_RESUNIT
public static final int IMWRITE_TIFF_XDPI
public static final int IMWRITE_TIFF_YDPI
public static final int IMWRITE_TIFF_COMPRESSION
public static final int IMWRITE_JPEG2000_COMPRESSION_X1000
public static Mat imdecode(Mat buf, int flags)
buf
- Input array or vector of bytes.flags
- The same flags as in cv::imread, see cv::ImreadModes.public static Mat imread(String filename, int flags)
filename
- Name of file to be loaded.flags
- Flag that can take values of cv::ImreadModespublic static Mat imread(String filename)
filename
- Name of file to be loaded.public static boolean haveImageReader(String filename)
filename
- File name of the imagepublic static boolean haveImageWriter(String filename)
filename
- File name of the imagepublic static boolean imencode(String ext, Mat img, MatOfByte buf, MatOfInt params)
ext
- File extension that defines the output format.img
- Image to be written.buf
- Output buffer resized to fit the compressed image.params
- Format-specific parameters. See cv::imwrite and cv::ImwriteFlags.public static boolean imencode(String ext, Mat img, MatOfByte buf)
ext
- File extension that defines the output format.img
- Image to be written.buf
- Output buffer resized to fit the compressed image.public static boolean imreadmulti(String filename, List<Mat> mats, int flags)
filename
- Name of file to be loaded.flags
- Flag that can take values of cv::ImreadModes, default with cv::IMREAD_ANYCOLOR.mats
- A vector of Mat objects holding each page, if more than one.
SEE: cv::imreadpublic static boolean imreadmulti(String filename, List<Mat> mats)
filename
- Name of file to be loaded.mats
- A vector of Mat objects holding each page, if more than one.
SEE: cv::imreadpublic static boolean imwrite(String filename, Mat img, MatOfInt params)
filename
- Name of the file.img
- Image to be saved.params
- Format-specific parameters encoded as pairs (paramId_1, paramValue_1, paramId_2, paramValue_2, ... .) see cv::ImwriteFlagspublic static boolean imwrite(String filename, Mat img)
filename
- Name of the file.img
- Image to be saved.Generated on Wed Oct 9 2019 23:24:43 UTC / OpenCV 4.1.2