🤖 AIによる機械翻訳(非公式) — これは OpenCV 4.13.0 公式リファレンス(英語)を AI (Claude) で自動翻訳したものです。訳に誤りを含む場合があります。正確な情報は 公式英語版(原文) を参照してください。
Package org.opencv.imgcodecs
クラス Imgcodecs
- java.lang.Object
-
- org.opencv.imgcodecs.Imgcodecs
-
public class Imgcodecs extends java.lang.Object
-
-
フィールドの要約
-
コンストラクタの要約
コンストラクタ Constructor Description Imgcodecs()
-
メソッドの要約
すべてのメソッド 静的メソッド 具象メソッド Modifier and Type Method Description static booleanhaveImageReader​(java.lang.String filename)Checks if the specified image file can be decoded by OpenCV.static booleanhaveImageWriter​(java.lang.String filename)Checks if the specified image file or specified file extension can be encoded by OpenCV.static longimcount​(java.lang.String filename)Returns the number of images inside the given file The function imcount returns the number of pages in a multi-page image (e.g.static longimcount​(java.lang.String filename, int flags)Returns the number of images inside the given file The function imcount returns the number of pages in a multi-page image (e.g.static Matimdecode​(Mat buf, int flags)Reads an image from a buffer in memory.static booleanimdecodeanimation​(Mat buf, Animation animation)Loads frames from an animated image buffer into an Animation structure.static booleanimdecodeanimation​(Mat buf, Animation animation, int start)Loads frames from an animated image buffer into an Animation structure.static booleanimdecodeanimation​(Mat buf, Animation animation, int start, int count)Loads frames from an animated image buffer into an Animation structure.static booleanimdecodemulti​(Mat buf, int flags, java.util.List<Mat> mats)Reads a multi-page image from a buffer in memory.static booleanimdecodemulti​(Mat buf, int flags, java.util.List<Mat> mats, Range range)Reads a multi-page image from a buffer in memory.static MatimdecodeWithMetadata​(Mat buf, MatOfInt metadataTypes, java.util.List<Mat> metadata)Reads an image from a memory buffer and extracts associated metadata.static MatimdecodeWithMetadata​(Mat buf, MatOfInt metadataTypes, java.util.List<Mat> metadata, int flags)Reads an image from a memory buffer and extracts associated metadata.static booleanimencode​(java.lang.String ext, Mat img, MatOfByte buf)Encodes an image into a memory buffer.static booleanimencode​(java.lang.String ext, Mat img, MatOfByte buf, MatOfInt params)Encodes an image into a memory buffer.static booleanimencodeanimation​(java.lang.String ext, Animation animation, MatOfByte buf)Encodes an Animation to a memory buffer.static booleanimencodeanimation​(java.lang.String ext, Animation animation, MatOfByte buf, MatOfInt params)Encodes an Animation to a memory buffer.static booleanimencodemulti​(java.lang.String ext, java.util.List<Mat> imgs, MatOfByte buf)Encodes array of images into a memory buffer.static booleanimencodemulti​(java.lang.String ext, java.util.List<Mat> imgs, MatOfByte buf, MatOfInt params)Encodes array of images into a memory buffer.static booleanimencodeWithMetadata​(java.lang.String ext, Mat img, MatOfInt metadataTypes, java.util.List<Mat> metadata, MatOfByte buf)Encodes an image into a memory buffer.static booleanimencodeWithMetadata​(java.lang.String ext, Mat img, MatOfInt metadataTypes, java.util.List<Mat> metadata, MatOfByte buf, MatOfInt params)Encodes an image into a memory buffer.static Matimread​(java.lang.String filename)Loads an image from a file.static Matimread​(java.lang.String filename, int flags)Loads an image from a file.static voidimread​(java.lang.String filename, Mat dst)Loads an image from a file.static voidimread​(java.lang.String filename, Mat dst, int flags)Loads an image from a file.static booleanimreadanimation​(java.lang.String filename, Animation animation)Loads frames from an animated image file into an Animation structure.static booleanimreadanimation​(java.lang.String filename, Animation animation, int start)Loads frames from an animated image file into an Animation structure.static booleanimreadanimation​(java.lang.String filename, Animation animation, int start, int count)Loads frames from an animated image file into an Animation structure.static booleanimreadmulti​(java.lang.String filename, java.util.List<Mat> mats)Loads a multi-page image from a file.static booleanimreadmulti​(java.lang.String filename, java.util.List<Mat> mats, int flags)Loads a multi-page image from a file.static booleanimreadmulti​(java.lang.String filename, java.util.List<Mat> mats, int start, int count)Loads images of a multi-page image from a file.static booleanimreadmulti​(java.lang.String filename, java.util.List<Mat> mats, int start, int count, int flags)Loads images of a multi-page image from a file.static MatimreadWithMetadata​(java.lang.String filename, MatOfInt metadataTypes, java.util.List<Mat> metadata)Reads an image from a file along with associated metadata.static MatimreadWithMetadata​(java.lang.String filename, MatOfInt metadataTypes, java.util.List<Mat> metadata, int flags)Reads an image from a file along with associated metadata.static booleanimwrite​(java.lang.String filename, Mat img)Saves an image to a specified file.static booleanimwrite​(java.lang.String filename, Mat img, MatOfInt params)Saves an image to a specified file.static booleanimwriteanimation​(java.lang.String filename, Animation animation)Saves an Animation to a specified file.static booleanimwriteanimation​(java.lang.String filename, Animation animation, MatOfInt params)Saves an Animation to a specified file.static booleanimwritemulti​(java.lang.String filename, java.util.List<Mat> img)static booleanimwritemulti​(java.lang.String filename, java.util.List<Mat> img, MatOfInt params)static booleanimwriteWithMetadata​(java.lang.String filename, Mat img, MatOfInt metadataTypes, java.util.List<Mat> metadata)Saves an image to a specified file with metadata The function imwriteWithMetadata saves the image to the specified file.static booleanimwriteWithMetadata​(java.lang.String filename, Mat img, MatOfInt metadataTypes, java.util.List<Mat> metadata, MatOfInt params)Saves an image to a specified file with metadata The function imwriteWithMetadata saves the image to the specified file.
-
-
-
フィールドの詳細
-
IMAGE_METADATA_UNKNOWN
public static final int IMAGE_METADATA_UNKNOWN
- 関連項目:
- 定数フィールド値
-
IMAGE_METADATA_EXIF
public static final int IMAGE_METADATA_EXIF
- 関連項目:
- 定数フィールド値
-
IMAGE_METADATA_XMP
public static final int IMAGE_METADATA_XMP
- 関連項目:
- 定数フィールド値
-
IMAGE_METADATA_ICCP
public static final int IMAGE_METADATA_ICCP
- 関連項目:
- 定数フィールド値
-
IMAGE_METADATA_CICP
public static final int IMAGE_METADATA_CICP
- 関連項目:
- 定数フィールド値
-
IMAGE_METADATA_MAX
public static final int IMAGE_METADATA_MAX
- 関連項目:
- 定数フィールド値
-
IMREAD_UNCHANGED
public static final int IMREAD_UNCHANGED
- 関連項目:
- 定数フィールド値
-
IMREAD_GRAYSCALE
public static final int IMREAD_GRAYSCALE
- 関連項目:
- 定数フィールド値
-
IMREAD_COLOR_BGR
public static final int IMREAD_COLOR_BGR
- 関連項目:
- 定数フィールド値
-
IMREAD_COLOR
public static final int IMREAD_COLOR
- 関連項目:
- 定数フィールド値
-
IMREAD_ANYDEPTH
public static final int IMREAD_ANYDEPTH
- 関連項目:
- 定数フィールド値
-
IMREAD_ANYCOLOR
public static final int IMREAD_ANYCOLOR
- 関連項目:
- 定数フィールド値
-
IMREAD_LOAD_GDAL
public static final int IMREAD_LOAD_GDAL
- 関連項目:
- 定数フィールド値
-
IMREAD_REDUCED_GRAYSCALE_2
public static final int IMREAD_REDUCED_GRAYSCALE_2
- 関連項目:
- 定数フィールド値
-
IMREAD_REDUCED_COLOR_2
public static final int IMREAD_REDUCED_COLOR_2
- 関連項目:
- 定数フィールド値
-
IMREAD_REDUCED_GRAYSCALE_4
public static final int IMREAD_REDUCED_GRAYSCALE_4
- 関連項目:
- 定数フィールド値
-
IMREAD_REDUCED_COLOR_4
public static final int IMREAD_REDUCED_COLOR_4
- 関連項目:
- 定数フィールド値
-
IMREAD_REDUCED_GRAYSCALE_8
public static final int IMREAD_REDUCED_GRAYSCALE_8
- 関連項目:
- 定数フィールド値
-
IMREAD_REDUCED_COLOR_8
public static final int IMREAD_REDUCED_COLOR_8
- 関連項目:
- 定数フィールド値
-
IMREAD_IGNORE_ORIENTATION
public static final int IMREAD_IGNORE_ORIENTATION
- 関連項目:
- 定数フィールド値
-
IMREAD_COLOR_RGB
public static final int IMREAD_COLOR_RGB
- 関連項目:
- 定数フィールド値
-
IMWRITE_BMP_COMPRESSION_RGB
public static final int IMWRITE_BMP_COMPRESSION_RGB
- 関連項目:
- 定数フィールド値
-
IMWRITE_BMP_COMPRESSION_BITFIELDS
public static final int IMWRITE_BMP_COMPRESSION_BITFIELDS
- 関連項目:
- 定数フィールド値
-
IMWRITE_EXR_COMPRESSION_NO
public static final int IMWRITE_EXR_COMPRESSION_NO
- 関連項目:
- 定数フィールド値
-
IMWRITE_EXR_COMPRESSION_RLE
public static final int IMWRITE_EXR_COMPRESSION_RLE
- 関連項目:
- 定数フィールド値
-
IMWRITE_EXR_COMPRESSION_ZIPS
public static final int IMWRITE_EXR_COMPRESSION_ZIPS
- 関連項目:
- 定数フィールド値
-
IMWRITE_EXR_COMPRESSION_ZIP
public static final int IMWRITE_EXR_COMPRESSION_ZIP
- 関連項目:
- 定数フィールド値
-
IMWRITE_EXR_COMPRESSION_PIZ
public static final int IMWRITE_EXR_COMPRESSION_PIZ
- 関連項目:
- 定数フィールド値
-
IMWRITE_EXR_COMPRESSION_PXR24
public static final int IMWRITE_EXR_COMPRESSION_PXR24
- 関連項目:
- 定数フィールド値
-
IMWRITE_EXR_COMPRESSION_B44
public static final int IMWRITE_EXR_COMPRESSION_B44
- 関連項目:
- 定数フィールド値
-
IMWRITE_EXR_COMPRESSION_B44A
public static final int IMWRITE_EXR_COMPRESSION_B44A
- 関連項目:
- 定数フィールド値
-
IMWRITE_EXR_COMPRESSION_DWAA
public static final int IMWRITE_EXR_COMPRESSION_DWAA
- 関連項目:
- 定数フィールド値
-
IMWRITE_EXR_COMPRESSION_DWAB
public static final int IMWRITE_EXR_COMPRESSION_DWAB
- 関連項目:
- 定数フィールド値
-
IMWRITE_EXR_TYPE_HALF
public static final int IMWRITE_EXR_TYPE_HALF
- 関連項目:
- 定数フィールド値
-
IMWRITE_EXR_TYPE_FLOAT
public static final int IMWRITE_EXR_TYPE_FLOAT
- 関連項目:
- 定数フィールド値
-
IMWRITE_JPEG_QUALITY
public static final int IMWRITE_JPEG_QUALITY
- 関連項目:
- 定数フィールド値
-
IMWRITE_JPEG_PROGRESSIVE
public static final int IMWRITE_JPEG_PROGRESSIVE
- 関連項目:
- 定数フィールド値
-
IMWRITE_JPEG_OPTIMIZE
public static final int IMWRITE_JPEG_OPTIMIZE
- 関連項目:
- 定数フィールド値
-
IMWRITE_JPEG_RST_INTERVAL
public static final int IMWRITE_JPEG_RST_INTERVAL
- 関連項目:
- 定数フィールド値
-
IMWRITE_JPEG_LUMA_QUALITY
public static final int IMWRITE_JPEG_LUMA_QUALITY
- 関連項目:
- 定数フィールド値
-
IMWRITE_JPEG_CHROMA_QUALITY
public static final int IMWRITE_JPEG_CHROMA_QUALITY
- 関連項目:
- 定数フィールド値
-
IMWRITE_JPEG_SAMPLING_FACTOR
public static final int IMWRITE_JPEG_SAMPLING_FACTOR
- 関連項目:
- 定数フィールド値
-
IMWRITE_PNG_COMPRESSION
public static final int IMWRITE_PNG_COMPRESSION
- 関連項目:
- 定数フィールド値
-
IMWRITE_PNG_STRATEGY
public static final int IMWRITE_PNG_STRATEGY
- 関連項目:
- 定数フィールド値
-
IMWRITE_PNG_BILEVEL
public static final int IMWRITE_PNG_BILEVEL
- 関連項目:
- 定数フィールド値
-
IMWRITE_PNG_FILTER
public static final int IMWRITE_PNG_FILTER
- 関連項目:
- 定数フィールド値
-
IMWRITE_PNG_ZLIBBUFFER_SIZE
public static final int IMWRITE_PNG_ZLIBBUFFER_SIZE
- 関連項目:
- 定数フィールド値
-
IMWRITE_PXM_BINARY
public static final int IMWRITE_PXM_BINARY
- 関連項目:
- 定数フィールド値
-
IMWRITE_EXR_TYPE
public static final int IMWRITE_EXR_TYPE
- 関連項目:
- 定数フィールド値
-
IMWRITE_EXR_COMPRESSION
public static final int IMWRITE_EXR_COMPRESSION
- 関連項目:
- 定数フィールド値
-
IMWRITE_EXR_DWA_COMPRESSION_LEVEL
public static final int IMWRITE_EXR_DWA_COMPRESSION_LEVEL
- 関連項目:
- 定数フィールド値
-
IMWRITE_WEBP_QUALITY
public static final int IMWRITE_WEBP_QUALITY
- 関連項目:
- 定数フィールド値
-
IMWRITE_HDR_COMPRESSION
public static final int IMWRITE_HDR_COMPRESSION
- 関連項目:
- 定数フィールド値
-
IMWRITE_PAM_TUPLETYPE
public static final int IMWRITE_PAM_TUPLETYPE
- 関連項目:
- 定数フィールド値
-
IMWRITE_TIFF_RESUNIT
public static final int IMWRITE_TIFF_RESUNIT
- 関連項目:
- 定数フィールド値
-
IMWRITE_TIFF_XDPI
public static final int IMWRITE_TIFF_XDPI
- 関連項目:
- 定数フィールド値
-
IMWRITE_TIFF_YDPI
public static final int IMWRITE_TIFF_YDPI
- 関連項目:
- 定数フィールド値
-
IMWRITE_TIFF_COMPRESSION
public static final int IMWRITE_TIFF_COMPRESSION
- 関連項目:
- 定数フィールド値
-
IMWRITE_TIFF_ROWSPERSTRIP
public static final int IMWRITE_TIFF_ROWSPERSTRIP
- 関連項目:
- 定数フィールド値
-
IMWRITE_TIFF_PREDICTOR
public static final int IMWRITE_TIFF_PREDICTOR
- 関連項目:
- 定数フィールド値
-
IMWRITE_JPEG2000_COMPRESSION_X1000
public static final int IMWRITE_JPEG2000_COMPRESSION_X1000
- 関連項目:
- 定数フィールド値
-
IMWRITE_AVIF_QUALITY
public static final int IMWRITE_AVIF_QUALITY
- 関連項目:
- 定数フィールド値
-
IMWRITE_AVIF_DEPTH
public static final int IMWRITE_AVIF_DEPTH
- 関連項目:
- 定数フィールド値
-
IMWRITE_AVIF_SPEED
public static final int IMWRITE_AVIF_SPEED
- 関連項目:
- 定数フィールド値
-
IMWRITE_JPEGXL_QUALITY
public static final int IMWRITE_JPEGXL_QUALITY
- 関連項目:
- 定数フィールド値
-
IMWRITE_JPEGXL_EFFORT
public static final int IMWRITE_JPEGXL_EFFORT
- 関連項目:
- 定数フィールド値
-
IMWRITE_JPEGXL_DISTANCE
public static final int IMWRITE_JPEGXL_DISTANCE
- 関連項目:
- 定数フィールド値
-
IMWRITE_JPEGXL_DECODING_SPEED
public static final int IMWRITE_JPEGXL_DECODING_SPEED
- 関連項目:
- 定数フィールド値
-
IMWRITE_BMP_COMPRESSION
public static final int IMWRITE_BMP_COMPRESSION
- 関連項目:
- 定数フィールド値
-
IMWRITE_GIF_LOOP
public static final int IMWRITE_GIF_LOOP
- 関連項目:
- 定数フィールド値
-
IMWRITE_GIF_SPEED
public static final int IMWRITE_GIF_SPEED
- 関連項目:
- 定数フィールド値
-
IMWRITE_GIF_QUALITY
public static final int IMWRITE_GIF_QUALITY
- 関連項目:
- 定数フィールド値
-
IMWRITE_GIF_DITHER
public static final int IMWRITE_GIF_DITHER
- 関連項目:
- 定数フィールド値
-
IMWRITE_GIF_TRANSPARENCY
public static final int IMWRITE_GIF_TRANSPARENCY
- 関連項目:
- 定数フィールド値
-
IMWRITE_GIF_COLORTABLE
public static final int IMWRITE_GIF_COLORTABLE
- 関連項目:
- 定数フィールド値
-
IMWRITE_GIF_FAST_NO_DITHER
public static final int IMWRITE_GIF_FAST_NO_DITHER
- 関連項目:
- 定数フィールド値
-
IMWRITE_GIF_FAST_FLOYD_DITHER
public static final int IMWRITE_GIF_FAST_FLOYD_DITHER
- 関連項目:
- 定数フィールド値
-
IMWRITE_GIF_COLORTABLE_SIZE_8
public static final int IMWRITE_GIF_COLORTABLE_SIZE_8
- 関連項目:
- 定数フィールド値
-
IMWRITE_GIF_COLORTABLE_SIZE_16
public static final int IMWRITE_GIF_COLORTABLE_SIZE_16
- 関連項目:
- 定数フィールド値
-
IMWRITE_GIF_COLORTABLE_SIZE_32
public static final int IMWRITE_GIF_COLORTABLE_SIZE_32
- 関連項目:
- 定数フィールド値
-
IMWRITE_GIF_COLORTABLE_SIZE_64
public static final int IMWRITE_GIF_COLORTABLE_SIZE_64
- 関連項目:
- 定数フィールド値
-
IMWRITE_GIF_COLORTABLE_SIZE_128
public static final int IMWRITE_GIF_COLORTABLE_SIZE_128
- 関連項目:
- 定数フィールド値
-
IMWRITE_GIF_COLORTABLE_SIZE_256
public static final int IMWRITE_GIF_COLORTABLE_SIZE_256
- 関連項目:
- 定数フィールド値
-
IMWRITE_HDR_COMPRESSION_NONE
public static final int IMWRITE_HDR_COMPRESSION_NONE
- 関連項目:
- 定数フィールド値
-
IMWRITE_HDR_COMPRESSION_RLE
public static final int IMWRITE_HDR_COMPRESSION_RLE
- 関連項目:
- 定数フィールド値
-
IMWRITE_JPEG_SAMPLING_FACTOR_411
public static final int IMWRITE_JPEG_SAMPLING_FACTOR_411
- 関連項目:
- 定数フィールド値
-
IMWRITE_JPEG_SAMPLING_FACTOR_420
public static final int IMWRITE_JPEG_SAMPLING_FACTOR_420
- 関連項目:
- 定数フィールド値
-
IMWRITE_JPEG_SAMPLING_FACTOR_422
public static final int IMWRITE_JPEG_SAMPLING_FACTOR_422
- 関連項目:
- 定数フィールド値
-
IMWRITE_JPEG_SAMPLING_FACTOR_440
public static final int IMWRITE_JPEG_SAMPLING_FACTOR_440
- 関連項目:
- 定数フィールド値
-
IMWRITE_JPEG_SAMPLING_FACTOR_444
public static final int IMWRITE_JPEG_SAMPLING_FACTOR_444
- 関連項目:
- 定数フィールド値
-
IMWRITE_PAM_FORMAT_NULL
public static final int IMWRITE_PAM_FORMAT_NULL
- 関連項目:
- 定数フィールド値
-
IMWRITE_PAM_FORMAT_BLACKANDWHITE
public static final int IMWRITE_PAM_FORMAT_BLACKANDWHITE
- 関連項目:
- 定数フィールド値
-
IMWRITE_PAM_FORMAT_GRAYSCALE
public static final int IMWRITE_PAM_FORMAT_GRAYSCALE
- 関連項目:
- 定数フィールド値
-
IMWRITE_PAM_FORMAT_GRAYSCALE_ALPHA
public static final int IMWRITE_PAM_FORMAT_GRAYSCALE_ALPHA
- 関連項目:
- 定数フィールド値
-
IMWRITE_PAM_FORMAT_RGB
public static final int IMWRITE_PAM_FORMAT_RGB
- 関連項目:
- 定数フィールド値
-
IMWRITE_PAM_FORMAT_RGB_ALPHA
public static final int IMWRITE_PAM_FORMAT_RGB_ALPHA
- 関連項目:
- 定数フィールド値
-
IMWRITE_PNG_FILTER_NONE
public static final int IMWRITE_PNG_FILTER_NONE
- 関連項目:
- 定数フィールド値
-
IMWRITE_PNG_FILTER_SUB
public static final int IMWRITE_PNG_FILTER_SUB
- 関連項目:
- 定数フィールド値
-
IMWRITE_PNG_FILTER_UP
public static final int IMWRITE_PNG_FILTER_UP
- 関連項目:
- 定数フィールド値
-
IMWRITE_PNG_FILTER_AVG
public static final int IMWRITE_PNG_FILTER_AVG
- 関連項目:
- 定数フィールド値
-
IMWRITE_PNG_FILTER_PAETH
public static final int IMWRITE_PNG_FILTER_PAETH
- 関連項目:
- 定数フィールド値
-
IMWRITE_PNG_FAST_FILTERS
public static final int IMWRITE_PNG_FAST_FILTERS
- 関連項目:
- 定数フィールド値
-
IMWRITE_PNG_ALL_FILTERS
public static final int IMWRITE_PNG_ALL_FILTERS
- 関連項目:
- 定数フィールド値
-
IMWRITE_PNG_STRATEGY_DEFAULT
public static final int IMWRITE_PNG_STRATEGY_DEFAULT
- 関連項目:
- 定数フィールド値
-
IMWRITE_PNG_STRATEGY_FILTERED
public static final int IMWRITE_PNG_STRATEGY_FILTERED
- 関連項目:
- 定数フィールド値
-
IMWRITE_PNG_STRATEGY_HUFFMAN_ONLY
public static final int IMWRITE_PNG_STRATEGY_HUFFMAN_ONLY
- 関連項目:
- 定数フィールド値
-
IMWRITE_PNG_STRATEGY_RLE
public static final int IMWRITE_PNG_STRATEGY_RLE
- 関連項目:
- 定数フィールド値
-
IMWRITE_PNG_STRATEGY_FIXED
public static final int IMWRITE_PNG_STRATEGY_FIXED
- 関連項目:
- 定数フィールド値
-
IMWRITE_TIFF_COMPRESSION_NONE
public static final int IMWRITE_TIFF_COMPRESSION_NONE
- 関連項目:
- 定数フィールド値
-
IMWRITE_TIFF_COMPRESSION_CCITTRLE
public static final int IMWRITE_TIFF_COMPRESSION_CCITTRLE
- 関連項目:
- 定数フィールドの値
-
IMWRITE_TIFF_COMPRESSION_CCITTFAX3
public static final int IMWRITE_TIFF_COMPRESSION_CCITTFAX3
- 関連項目:
- 定数フィールドの値
-
IMWRITE_TIFF_COMPRESSION_CCITT_T4
public static final int IMWRITE_TIFF_COMPRESSION_CCITT_T4
- 関連項目:
- 定数フィールドの値
-
IMWRITE_TIFF_COMPRESSION_CCITTFAX4
public static final int IMWRITE_TIFF_COMPRESSION_CCITTFAX4
- 関連項目:
- 定数フィールドの値
-
IMWRITE_TIFF_COMPRESSION_CCITT_T6
public static final int IMWRITE_TIFF_COMPRESSION_CCITT_T6
- 関連項目:
- 定数フィールドの値
-
IMWRITE_TIFF_COMPRESSION_LZW
public static final int IMWRITE_TIFF_COMPRESSION_LZW
- 関連項目:
- 定数フィールドの値
-
IMWRITE_TIFF_COMPRESSION_OJPEG
public static final int IMWRITE_TIFF_COMPRESSION_OJPEG
- 関連項目:
- 定数フィールドの値
-
IMWRITE_TIFF_COMPRESSION_JPEG
public static final int IMWRITE_TIFF_COMPRESSION_JPEG
- 関連項目:
- 定数フィールドの値
-
IMWRITE_TIFF_COMPRESSION_T85
public static final int IMWRITE_TIFF_COMPRESSION_T85
- 関連項目:
- 定数フィールドの値
-
IMWRITE_TIFF_COMPRESSION_T43
public static final int IMWRITE_TIFF_COMPRESSION_T43
- 関連項目:
- 定数フィールドの値
-
IMWRITE_TIFF_COMPRESSION_NEXT
public static final int IMWRITE_TIFF_COMPRESSION_NEXT
- 関連項目:
- 定数フィールドの値
-
IMWRITE_TIFF_COMPRESSION_CCITTRLEW
public static final int IMWRITE_TIFF_COMPRESSION_CCITTRLEW
- 関連項目:
- 定数フィールドの値
-
IMWRITE_TIFF_COMPRESSION_PACKBITS
public static final int IMWRITE_TIFF_COMPRESSION_PACKBITS
- 関連項目:
- 定数フィールドの値
-
IMWRITE_TIFF_COMPRESSION_THUNDERSCAN
public static final int IMWRITE_TIFF_COMPRESSION_THUNDERSCAN
- 関連項目:
- 定数フィールドの値
-
IMWRITE_TIFF_COMPRESSION_IT8CTPAD
public static final int IMWRITE_TIFF_COMPRESSION_IT8CTPAD
- 関連項目:
- 定数フィールドの値
-
IMWRITE_TIFF_COMPRESSION_IT8LW
public static final int IMWRITE_TIFF_COMPRESSION_IT8LW
- 関連項目:
- 定数フィールドの値
-
IMWRITE_TIFF_COMPRESSION_IT8MP
public static final int IMWRITE_TIFF_COMPRESSION_IT8MP
- 関連項目:
- 定数フィールドの値
-
IMWRITE_TIFF_COMPRESSION_IT8BL
public static final int IMWRITE_TIFF_COMPRESSION_IT8BL
- 関連項目:
- 定数フィールドの値
-
IMWRITE_TIFF_COMPRESSION_PIXARFILM
public static final int IMWRITE_TIFF_COMPRESSION_PIXARFILM
- 関連項目:
- 定数フィールドの値
-
IMWRITE_TIFF_COMPRESSION_PIXARLOG
public static final int IMWRITE_TIFF_COMPRESSION_PIXARLOG
- 関連項目:
- 定数フィールドの値
-
IMWRITE_TIFF_COMPRESSION_DEFLATE
public static final int IMWRITE_TIFF_COMPRESSION_DEFLATE
- 関連項目:
- 定数フィールドの値
-
IMWRITE_TIFF_COMPRESSION_ADOBE_DEFLATE
public static final int IMWRITE_TIFF_COMPRESSION_ADOBE_DEFLATE
- 関連項目:
- 定数フィールドの値
-
IMWRITE_TIFF_COMPRESSION_DCS
public static final int IMWRITE_TIFF_COMPRESSION_DCS
- 関連項目:
- 定数フィールドの値
-
IMWRITE_TIFF_COMPRESSION_JBIG
public static final int IMWRITE_TIFF_COMPRESSION_JBIG
- 関連項目:
- 定数フィールドの値
-
IMWRITE_TIFF_COMPRESSION_SGILOG
public static final int IMWRITE_TIFF_COMPRESSION_SGILOG
- 関連項目:
- 定数フィールドの値
-
IMWRITE_TIFF_COMPRESSION_SGILOG24
public static final int IMWRITE_TIFF_COMPRESSION_SGILOG24
- 関連項目:
- 定数フィールドの値
-
IMWRITE_TIFF_COMPRESSION_JP2000
public static final int IMWRITE_TIFF_COMPRESSION_JP2000
- 関連項目:
- 定数フィールドの値
-
IMWRITE_TIFF_COMPRESSION_LERC
public static final int IMWRITE_TIFF_COMPRESSION_LERC
- 関連項目:
- 定数フィールドの値
-
IMWRITE_TIFF_COMPRESSION_LZMA
public static final int IMWRITE_TIFF_COMPRESSION_LZMA
- 関連項目:
- 定数フィールドの値
-
IMWRITE_TIFF_COMPRESSION_ZSTD
public static final int IMWRITE_TIFF_COMPRESSION_ZSTD
- 関連項目:
- 定数フィールドの値
-
IMWRITE_TIFF_COMPRESSION_WEBP
public static final int IMWRITE_TIFF_COMPRESSION_WEBP
- 関連項目:
- 定数フィールドの値
-
IMWRITE_TIFF_COMPRESSION_JXL
public static final int IMWRITE_TIFF_COMPRESSION_JXL
- 関連項目:
- 定数フィールドの値
-
IMWRITE_TIFF_PREDICTOR_NONE
public static final int IMWRITE_TIFF_PREDICTOR_NONE
- 関連項目:
- 定数フィールドの値
-
IMWRITE_TIFF_PREDICTOR_HORIZONTAL
public static final int IMWRITE_TIFF_PREDICTOR_HORIZONTAL
- 関連項目:
- 定数フィールドの値
-
IMWRITE_TIFF_PREDICTOR_FLOATINGPOINT
public static final int IMWRITE_TIFF_PREDICTOR_FLOATINGPOINT
- 関連項目:
- 定数フィールドの値
-
IMWRITE_TIFF_RESOLUTION_UNIT_NONE
public static final int IMWRITE_TIFF_RESOLUTION_UNIT_NONE
- 関連項目:
- 定数フィールドの値
-
IMWRITE_TIFF_RESOLUTION_UNIT_INCH
public static final int IMWRITE_TIFF_RESOLUTION_UNIT_INCH
- 関連項目:
- 定数フィールドの値
-
IMWRITE_TIFF_RESOLUTION_UNIT_CENTIMETER
public static final int IMWRITE_TIFF_RESOLUTION_UNIT_CENTIMETER
- 関連項目:
- 定数フィールドの値
-
-
メソッドの詳細
-
imread
public static Mat imread​(java.lang.String filename, int flags)
Loads an image from a file. imread Theimreadfunction loads an image from the specified file and returns OpenCV matrix. If the image cannot be read (because of a missing file, improper permissions, or unsupported/invalid format), the function returns an empty matrix. Currently, the following file formats are supported:- Windows ビットマップ - \*.bmp, \*.dib (常にサポートされている)
- GIF ファイル - \*.gif (常にサポートされている)
- JPEGファイル - \*.jpeg, \*.jpg, \*.jpe (*Note* セクションを参照)
- JPEG 2000ファイル - \*.jp2 (*Note* セクションを参照)
- Portable Network Graphics - \*.png (*Note* セクションを参照)
- WebP - \*.webp (*Note* セクションを参照)
- AVIF - \*.avif (*Note* セクションを参照)
- Portable image format - \*.pbm, \*.pgm, \*.ppm, \*.pxm, \*.pnm (常にサポートされている)
- PFMファイル - \*.pfm (*Note* セクションを参照)
- Sun rasters - \*.sr, \*.ras (常にサポートされている)
- TIFFファイル - \*.tiff, \*.tif (*Note* セクションを参照)
- OpenEXR画像ファイル - \*.exr (*Note* セクションを参照)
- Radiance HDR - \*.hdr, \*.pic (常にサポートされている)
- GDALがサポートするラスタおよびベクトルの地理空間データ (*Note* セクションを参照)
- この関数は画像の種類をファイル拡張子ではなく内容から判別する。
- カラー画像の場合、デコードされた画像のチャンネルは B G R の順で格納される。
- IMREAD_GRAYSCALE を使用する場合、利用可能であればコーデック内部のグレースケール変換が使われる。結果は cvtColor() の出力と異なることがある。
- Microsoft Windows\* および Mac OS\* では、デフォルトで OpenCV に同梱されているコーデック (libjpeg, libpng, libtiff, libjasper) が使われる。したがって OpenCV は常に JPEG、PNG、TIFF を読み込める。Mac OS には Mac OS ネイティブの画像リーダを使うオプションもある。ただし、Mac OS に組み込まれたカラーマネジメントの影響で、現状これらのネイティブ画像ローダはピクセル値の異なる画像を返す点に注意すること。
- Linux\*、BSD系、その他のUnix系オープンソースOSでは、OpenCV はOSに付属するコーデックを探す。コーデックのサポートを得るには、関連パッケージ (Debian\* や Ubuntu\* の "libjpeg-dev" などの開発用ファイルを含む) がインストールされていることを確認するか、CMake で OPENCV_BUILD_3RDPARTY_LIBS フラグを有効にすること。
- CMake で *WITH_GDAL* フラグが true に設定され、画像の読み込みに REF: IMREAD_LOAD_GDAL が使われている場合、画像のデコードには [GDAL](http://www.gdal.org) ドライバが使われ、[Raster](http://www.gdal.org/formats_list.html) および [Vector](http://www.gdal.org/ogr_formats.html) フォーマットがサポートされる。
- 画像ファイルに EXIF 情報が埋め込まれている場合、EXIF の向き情報が考慮され、REF: IMREAD_IGNORE_ORIENTATION または REF: IMREAD_UNCHANGED フラグが渡されない限り、それに応じて画像が回転される。
- PFM画像の浮動小数点値を保持するには、IMREAD_UNCHANGEDフラグを使用すること。
- デフォルトでは、ピクセル数は 2^30 未満でなければならない。この上限は環境変数
OPENCV_IO_MAX_IMAGE_PIXELSを設定することで変更できる。REF: tutorial_env_reference を参照。
- 引数:
filename- 読み込むファイルの名前。flags- cv::ImreadModes の値を取れるフラグ。デフォルトは cv::IMREAD_COLOR_BGR。- 戻り値:
- 自動生成
-
imread
public static Mat imread​(java.lang.String filename)
Loads an image from a file. imread Theimreadfunction loads an image from the specified file and returns OpenCV matrix. If the image cannot be read (because of a missing file, improper permissions, or unsupported/invalid format), the function returns an empty matrix. Currently, the following file formats are supported:- Windows ビットマップ - \*.bmp, \*.dib (常にサポートされている)
- GIF ファイル - \*.gif (常にサポートされている)
- JPEGファイル - \*.jpeg, \*.jpg, \*.jpe (*Note* セクションを参照)
- JPEG 2000ファイル - \*.jp2 (*Note* セクションを参照)
- Portable Network Graphics - \*.png (*Note* セクションを参照)
- WebP - \*.webp (*Note* セクションを参照)
- AVIF - \*.avif (*Note* セクションを参照)
- Portable image format - \*.pbm, \*.pgm, \*.ppm, \*.pxm, \*.pnm (常にサポートされている)
- PFMファイル - \*.pfm (*Note* セクションを参照)
- Sun rasters - \*.sr, \*.ras (常にサポートされている)
- TIFFファイル - \*.tiff, \*.tif (*Note* セクションを参照)
- OpenEXR画像ファイル - \*.exr (*Note* セクションを参照)
- Radiance HDR - \*.hdr, \*.pic (常にサポートされている)
- GDALがサポートするラスタおよびベクトルの地理空間データ (*Note* セクションを参照)
- この関数は画像の種類をファイル拡張子ではなく内容から判別する。
- カラー画像の場合、デコードされた画像のチャンネルは B G R の順で格納される。
- IMREAD_GRAYSCALE を使用する場合、利用可能であればコーデック内部のグレースケール変換が使われる。結果は cvtColor() の出力と異なることがある。
- Microsoft Windows\* および Mac OS\* では、デフォルトで OpenCV に同梱されているコーデック (libjpeg, libpng, libtiff, libjasper) が使われる。したがって OpenCV は常に JPEG、PNG、TIFF を読み込める。Mac OS には Mac OS ネイティブの画像リーダを使うオプションもある。ただし、Mac OS に組み込まれたカラーマネジメントの影響で、現状これらのネイティブ画像ローダはピクセル値の異なる画像を返す点に注意すること。
- Linux\*、BSD系、その他のUnix系オープンソースOSでは、OpenCV はOSに付属するコーデックを探す。コーデックのサポートを得るには、関連パッケージ (Debian\* や Ubuntu\* の "libjpeg-dev" などの開発用ファイルを含む) がインストールされていることを確認するか、CMake で OPENCV_BUILD_3RDPARTY_LIBS フラグを有効にすること。
- CMake で *WITH_GDAL* フラグが true に設定され、画像の読み込みに REF: IMREAD_LOAD_GDAL が使われている場合、画像のデコードには [GDAL](http://www.gdal.org) ドライバが使われ、[Raster](http://www.gdal.org/formats_list.html) および [Vector](http://www.gdal.org/ogr_formats.html) フォーマットがサポートされる。
- 画像ファイルに EXIF 情報が埋め込まれている場合、EXIF の向き情報が考慮され、REF: IMREAD_IGNORE_ORIENTATION または REF: IMREAD_UNCHANGED フラグが渡されない限り、それに応じて画像が回転される。
- PFM画像の浮動小数点値を保持するには、IMREAD_UNCHANGEDフラグを使用すること。
- デフォルトでは、ピクセル数は 2^30 未満でなければならない。この上限は環境変数
OPENCV_IO_MAX_IMAGE_PIXELSを設定することで変更できる。REF: tutorial_env_reference を参照。
- 引数:
filename- 読み込むファイルの名前。- 戻り値:
- 自動生成
-
imread
public static void imread​(java.lang.String filename, Mat dst, int flags)Loads an image from a file. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts and the return value.- 引数:
filename- 読み込むファイルの名前。dst- 画像が読み込まれるオブジェクト。flags- cv::ImreadModes の値を取れるフラグ。デフォルトは cv::IMREAD_COLOR_BGR。覚え書き: img 引数を通して渡される画像は、あらかじめ確保しておくことができる。形状と型が読み込む画像と一致する場合、そのメモリが再利用される。
-
imread
public static void imread​(java.lang.String filename, Mat dst)Loads an image from a file. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts and the return value.- 引数:
filename- 読み込むファイルの名前。dst- 画像が読み込まれるオブジェクト。覚え書き: img 引数を通して渡される画像は、あらかじめ確保しておくことができる。形状と型が読み込む画像と一致する場合、そのメモリが再利用される。
-
imreadWithMetadata
public static Mat imreadWithMetadata​(java.lang.String filename, MatOfInt metadataTypes, java.util.List<Mat> metadata, int flags)
Reads an image from a file along with associated metadata. This function behaves similarly to cv::imread(), loading an image from the specified file. In addition to the image pixel data, it also attempts to extract any available metadata embedded in the file (such as EXIF, XMP, etc.), depending on file format support. 覚え書き: In the case of color images, the decoded images will have the channels stored in B G R order.- 引数:
filename- 読み込むファイルの名前。metadataTypes- metadata で返されるメタデータチャンクの型を格納する出力ベクトル。ImageMetadataType を参照。metadata- 取得したメタデータを格納する、ベクトルのベクトルまたは行列のベクトルである出力。flags- cv::ImreadModes の値を取れるフラグ。デフォルトは cv::IMREAD_ANYCOLOR。- 戻り値:
- 読み込まれた画像を cv::Mat オブジェクトとして返す。画像を読み込めない場合、この関数は空の行列を返す。
-
imreadWithMetadata
public static Mat imreadWithMetadata​(java.lang.String filename, MatOfInt metadataTypes, java.util.List<Mat> metadata)
Reads an image from a file along with associated metadata. This function behaves similarly to cv::imread(), loading an image from the specified file. In addition to the image pixel data, it also attempts to extract any available metadata embedded in the file (such as EXIF, XMP, etc.), depending on file format support. 覚え書き: In the case of color images, the decoded images will have the channels stored in B G R order.- 引数:
filename- 読み込むファイルの名前。metadataTypes- metadata で返されるメタデータチャンクの型を格納する出力ベクトル。ImageMetadataType を参照。metadata- 取得したメタデータを格納する、ベクトルのベクトルまたは行列のベクトルである出力。- 戻り値:
- 読み込まれた画像を cv::Mat オブジェクトとして返す。画像を読み込めない場合、この関数は空の行列を返す。
-
imreadmulti
public static boolean imreadmulti​(java.lang.String filename, java.util.List<Mat> mats, int flags)Loads a multi-page image from a file. The function imreadmulti loads a multi-page image from the specified file into a vector of Mat objects.- 引数:
filename- 読み込むファイルの名前。mats- 各ページを保持する Mat オブジェクトのベクトル。flags- cv::ImreadModes の値を取れるフラグ。デフォルトは cv::IMREAD_ANYCOLOR。SEE: cv::imread- 戻り値:
- 自動生成
-
imreadmulti
public static boolean imreadmulti​(java.lang.String filename, java.util.List<Mat> mats)Loads a multi-page image from a file. The function imreadmulti loads a multi-page image from the specified file into a vector of Mat objects.- 引数:
filename- 読み込むファイルの名前。mats- 各ページを保持する Mat オブジェクトのベクトル。SEE: cv::imread- 戻り値:
- 自動生成
-
imreadmulti
public static boolean imreadmulti​(java.lang.String filename, java.util.List<Mat> mats, int start, int count, int flags)Loads images of a multi-page image from a file. The function imreadmulti loads a specified range from a multi-page image from the specified file into a vector of Mat objects.- 引数:
filename- 読み込むファイルの名前。mats- 各ページを保持する Mat オブジェクトのベクトル。start- 読み込む画像の開始インデックスcount- 読み込む画像の数flags- cv::ImreadModes の値を取れるフラグ。デフォルトは cv::IMREAD_ANYCOLOR。SEE: cv::imread- 戻り値:
- 自動生成
-
imreadmulti
public static boolean imreadmulti​(java.lang.String filename, java.util.List<Mat> mats, int start, int count)Loads images of a multi-page image from a file. The function imreadmulti loads a specified range from a multi-page image from the specified file into a vector of Mat objects.- 引数:
filename- 読み込むファイルの名前。mats- 各ページを保持する Mat オブジェクトのベクトル。start- 読み込む画像の開始インデックスcount- 読み込む画像の数 SEE: cv::imread- 戻り値:
- 自動生成
-
imreadanimation
public static boolean imreadanimation​(java.lang.String filename, Animation animation, int start, int count)Loads frames from an animated image file into an Animation structure. The function imreadanimation loads frames from an animated image file (e.g., GIF, AVIF, APNG, WEBP) into the provided Animation struct.- 引数:
filename- ファイルへのパスを含む文字列。animation- 読み込まれたフレームが格納される Animation 構造体への参照。関数を呼び出す前に初期化しておく必要がある。start- 読み込む最初のフレームのインデックス。これは省略可能で、デフォルトは 0。count- 読み込むフレームの数。これは省略可能で、デフォルトは 32767。- 戻り値:
- ファイルが正常に読み込まれ、フレームが抽出された場合はtrueを返す。それ以外の場合はfalseを返す。
-
imreadanimation
public static boolean imreadanimation​(java.lang.String filename, Animation animation, int start)Loads frames from an animated image file into an Animation structure. The function imreadanimation loads frames from an animated image file (e.g., GIF, AVIF, APNG, WEBP) into the provided Animation struct.- 引数:
filename- ファイルへのパスを含む文字列。animation- 読み込まれたフレームが格納される Animation 構造体への参照。関数を呼び出す前に初期化しておく必要がある。start- 読み込む最初のフレームのインデックス。これは省略可能で、デフォルトは 0。- 戻り値:
- ファイルが正常に読み込まれ、フレームが抽出された場合はtrueを返す。それ以外の場合はfalseを返す。
-
imreadanimation
public static boolean imreadanimation​(java.lang.String filename, Animation animation)Loads frames from an animated image file into an Animation structure. The function imreadanimation loads frames from an animated image file (e.g., GIF, AVIF, APNG, WEBP) into the provided Animation struct.- 引数:
filename- ファイルへのパスを含む文字列。animation- 読み込まれたフレームが格納される Animation 構造体への参照。関数を呼び出す前に初期化しておく必要がある。- 戻り値:
- ファイルが正常に読み込まれ、フレームが抽出された場合はtrueを返す。それ以外の場合はfalseを返す。
-
imdecodeanimation
public static boolean imdecodeanimation​(Mat buf, Animation animation, int start, int count)
Loads frames from an animated image buffer into an Animation structure. The function imdecodeanimation loads frames from an animated image buffer (e.g., GIF, AVIF, APNG, WEBP) into the provided Animation struct.- 引数:
buf- 画像バッファを含む InputArray への参照。animation- 読み込まれたフレームが格納される Animation 構造体への参照。関数を呼び出す前に初期化しておく必要がある。start- 読み込む最初のフレームのインデックス。これは省略可能で、デフォルトは 0。count- 読み込むフレームの数。これは省略可能で、デフォルトは 32767。- 戻り値:
- バッファの読み込みに成功しフレームが抽出された場合は true、そうでない場合は false を返す。
-
imdecodeanimation
public static boolean imdecodeanimation​(Mat buf, Animation animation, int start)
Loads frames from an animated image buffer into an Animation structure. The function imdecodeanimation loads frames from an animated image buffer (e.g., GIF, AVIF, APNG, WEBP) into the provided Animation struct.- 引数:
buf- 画像バッファを含む InputArray への参照。animation- 読み込まれたフレームが格納される Animation 構造体への参照。関数を呼び出す前に初期化しておく必要がある。start- 読み込む最初のフレームのインデックス。これは省略可能で、デフォルトは 0。- 戻り値:
- バッファの読み込みに成功しフレームが抽出された場合は true、そうでない場合は false を返す。
-
imdecodeanimation
public static boolean imdecodeanimation​(Mat buf, Animation animation)
Loads frames from an animated image buffer into an Animation structure. The function imdecodeanimation loads frames from an animated image buffer (e.g., GIF, AVIF, APNG, WEBP) into the provided Animation struct.- 引数:
buf- 画像バッファを含む InputArray への参照。animation- 読み込まれたフレームが格納される Animation 構造体への参照。関数を呼び出す前に初期化しておく必要がある。- 戻り値:
- バッファの読み込みに成功しフレームが抽出された場合は true、そうでない場合は false を返す。
-
imwriteanimation
public static boolean imwriteanimation​(java.lang.String filename, Animation animation, MatOfInt params)Saves an Animation to a specified file. The function imwriteanimation saves the provided Animation data to the specified file in an animated format. Supported formats depend on the implementation and may include formats like GIF, AVIF, APNG, or WEBP.- 引数:
filename- アニメーションを保存するファイルの名前。ファイル拡張子によってフォーマットが決まる。animation- 保存するフレームとメタデータを含む Animation 構造体への定数参照。params- ペア (paramId_1, paramValue_1, paramId_2, paramValue_2, ...) としてエンコードされた、フォーマット固有の省略可能な引数。これらの引数はエンコード処理の追加オプションを指定するために使われる。指定可能な引数の詳細についてはcv::ImwriteFlagsを参照。- 戻り値:
- アニメーションが正常に保存された場合はtrueを返す。それ以外の場合はfalseを返す。
-
imwriteanimation
public static boolean imwriteanimation​(java.lang.String filename, Animation animation)Saves an Animation to a specified file. The function imwriteanimation saves the provided Animation data to the specified file in an animated format. Supported formats depend on the implementation and may include formats like GIF, AVIF, APNG, or WEBP.- 引数:
filename- アニメーションを保存するファイルの名前。ファイル拡張子によってフォーマットが決まる。animation- 保存するフレームとメタデータを含む Animation 構造体への定数参照。これらの引数はエンコード処理の追加オプションを指定するために使われる。指定可能な引数の詳細についてはcv::ImwriteFlagsを参照。- 戻り値:
- アニメーションが正常に保存された場合はtrueを返す。それ以外の場合はfalseを返す。
-
imencodeanimation
public static boolean imencodeanimation​(java.lang.String ext, Animation animation, MatOfByte buf, MatOfInt params)Encodes an Animation to a memory buffer. The function imencodeanimation encodes the provided Animation data into a memory buffer in an animated format. Supported formats depend on the implementation and may include formats like GIF, AVIF, APNG, or WEBP.- 引数:
ext- エンコードされるデータのフォーマットを決定するファイル拡張子。animation- エンコードするフレームとメタデータを含む Animation 構造体への定数参照。buf- エンコードされたデータが格納される unsigned char のベクトルへの参照。params- ペア (paramId_1, paramValue_1, paramId_2, paramValue_2, ...) としてエンコードされた、フォーマット固有の省略可能な引数。これらの引数はエンコード処理の追加オプションを指定するために使われる。指定可能な引数の詳細についてはcv::ImwriteFlagsを参照。- 戻り値:
- アニメーションのエンコードに成功した場合は true、そうでない場合は false を返す。
-
imencodeanimation
public static boolean imencodeanimation​(java.lang.String ext, Animation animation, MatOfByte buf)Encodes an Animation to a memory buffer. The function imencodeanimation encodes the provided Animation data into a memory buffer in an animated format. Supported formats depend on the implementation and may include formats like GIF, AVIF, APNG, or WEBP.- 引数:
ext- エンコードされるデータのフォーマットを決定するファイル拡張子。animation- エンコードするフレームとメタデータを含む Animation 構造体への定数参照。buf- エンコードされたデータが格納される unsigned char のベクトルへの参照。paramValue_1, paramId_2, paramValue_2, ...)。これらの引数はエンコード処理の追加オプションを指定するために使われる。指定可能な引数の詳細についてはcv::ImwriteFlagsを参照。- 戻り値:
- アニメーションのエンコードに成功した場合は true、そうでない場合は false を返す。
-
imcount
public static long imcount​(java.lang.String filename, int flags)Returns the number of images inside the given file The function imcount returns the number of pages in a multi-page image (e.g. TIFF), the number of frames in an animation (e.g. AVIF), and 1 otherwise. If the image cannot be decoded, 0 is returned.- 引数:
filename- 読み込むファイルの名前。flags- cv::ImreadModes の値を取れるフラグ。デフォルトは cv::IMREAD_ANYCOLOR。TODO: cv::IMREAD_LOAD_GDAL フラグが使われた場合、OpenCV の GDAL デコーダがまだマルチページ読み込みをサポートしていないため、戻り値は 0 または 1 になる。- 戻り値:
- 自動生成
-
imcount
public static long imcount​(java.lang.String filename)
Returns the number of images inside the given file The function imcount returns the number of pages in a multi-page image (e.g. TIFF), the number of frames in an animation (e.g. AVIF), and 1 otherwise. If the image cannot be decoded, 0 is returned.- 引数:
filename- 読み込むファイルの名前。TODO: cv::IMREAD_LOAD_GDAL フラグが使われた場合、OpenCV の GDAL デコーダがまだマルチページ読み込みをサポートしていないため、戻り値は 0 または 1 になる。- 戻り値:
- 自動生成
-
imwrite
public static boolean imwrite​(java.lang.String filename, Mat img, MatOfInt params)Saves an image to a specified file. The function imwrite saves the image to the specified file. The image format is chosen based on the filename extension (see cv::imread for the list of extensions). In general, only 8-bit unsigned (CV_8U) single-channel or 3-channel (with 'BGR' channel order) images can be saved using this function, with these exceptions:-
With BMP encoder, 8-bit unsigned (CV_8U) images can be saved.
- アルファチャンネルを持つBMP画像はこの関数で保存できる。これを行うには、8ビット4チャンネル (CV_8UC4) のBGRA画像を作成し、アルファチャンネルが最後のコンポーネントになるようにする。完全に透明なピクセルはアルファ値を0に、完全に不透明なピクセルはアルファ値を255にする。OpenCV v4.13.0以降ではデフォルトでBI_BITFIELDS圧縮を使用する。IMWRITE_BMP_COMPRESSIONを参照。
-
With OpenEXR encoder, only 32-bit float (CV_32F) images can be saved. More than 4 channels can be saved. (imread can load it then.)
- 8ビット符号なし (CV_8U) 画像はサポートされていない。
-
With Radiance HDR encoder, non 64-bit float (CV_64F) images can be saved.
- すべての画像が32ビット浮動小数点 (CV_32F) に変換される。
- JPEG 2000エンコーダでは、8ビット符号なし (CV_8U) および16ビット符号なし (CV_16U) 画像を保存できる。
-
With JPEG XL encoder, 8-bit unsigned (CV_8U), 16-bit unsigned (CV_16U) and 32-bit float(CV_32F) images can be saved.
- アルファチャンネルを持つJPEG XL画像はこの関数で保存できる。これを行うには、8ビット4チャンネル (CV_8UC4) / 16ビット4チャンネル (CV_16UC4) / 32ビット浮動小数点4チャンネル (CV_32FC4) のBGRA画像を作成し、アルファチャンネルが最後のコンポーネントになるようにする。完全に透明なピクセルはアルファ値を0に、完全に不透明なピクセルはアルファ値を255/65535/1.0にする。
- PAMエンコーダでは、8ビット符号なし (CV_8U) および16ビット符号なし (CV_16U) 画像を保存できる。
-
With PNG encoder, 8-bit unsigned (CV_8U) and 16-bit unsigned (CV_16U) images can be saved.
- アルファチャンネルを持つPNG画像はこの関数で保存できる。これを行うには、8ビット4チャンネル (CV_8UC4) / 16ビット4チャンネル (CV_16UC4) のBGRA画像を作成し、アルファチャンネルが最後のコンポーネントになるようにする。完全に透明なピクセルはアルファ値を0に、完全に不透明なピクセルはアルファ値を255/65535にする (下記のコードサンプルを参照)。
- PGM/PPMエンコーダでは、8ビット符号なし (CV_8U) および16ビット符号なし (CV_16U) 画像を保存できる。
-
With TIFF encoder, 8-bit unsigned (CV_8U), 8-bit signed (CV_8S),
16-bit unsigned (CV_16U), 16-bit signed (CV_16S),
32-bit signed (CV_32S),
32-bit float (CV_32F) and 64-bit float (CV_64F) images can be saved.
- 複数の画像 (Mat のベクトル) を TIFF フォーマットで保存できる (下のコードサンプルを参照)。
- 32ビット浮動小数点3チャンネル (CV_32FC3) のTIFF画像は、LogLuvハイダイナミックレンジエンコーディング (1ピクセルあたり4バイト) を使用して保存される
-
With GIF encoder, 8-bit unsigned (CV_8U) images can be saved.
- アルファチャンネルを持つGIF画像はこの関数で保存できる。これを行うには、8ビット4チャンネル (CV_8UC4) のBGRA画像を作成し、アルファチャンネルが最後のコンポーネントになるようにする。完全に透明なピクセルはアルファ値を0に、完全に不透明なピクセルはアルファ値を255にする。
- 8ビットシングルチャンネル画像 (CV_8UC1) は、GIFがインデックスカラー形式に制限されているためサポートされていない。
-
With AVIF encoder, 8-bit unsigned (CV_8U) and 16-bit unsigned (CV_16U) images can be saved.
- CV_16U画像は10ビットまたは12ビットでのみ保存できる (16ビットでは不可)。IMWRITE_AVIF_DEPTHを参照。
- アルファチャンネルを持つAVIF画像はこの関数で保存できる。これを行うには、8ビット4チャンネル (CV_8UC4) / 16ビット4チャンネル (CV_16UC4) のBGRA画像を作成し、アルファチャンネルが最後のコンポーネントになるようにする。完全に透明なピクセルはアルファ値を0に、完全に不透明なピクセルはアルファ値を255 (8ビット) / 1023 (10ビット) / 4095 (12ビット) にする (下記のコードサンプルを参照)。
- 引数:
filename- ファイルの名前。img- (Mat または Mat のベクトル) 保存する画像。params- ペア (paramId_1, paramValue_1, paramId_2, paramValue_2, ... .) としてエンコードされたフォーマット固有の引数。cv::ImwriteFlags を参照。- 戻り値:
- 画像が指定したファイルに正常に書き込まれた場合はtrue、それ以外の場合はfalse。
-
With BMP encoder, 8-bit unsigned (CV_8U) images can be saved.
-
imwrite
public static boolean imwrite​(java.lang.String filename, Mat img)Saves an image to a specified file. The function imwrite saves the image to the specified file. The image format is chosen based on the filename extension (see cv::imread for the list of extensions). In general, only 8-bit unsigned (CV_8U) single-channel or 3-channel (with 'BGR' channel order) images can be saved using this function, with these exceptions:-
With BMP encoder, 8-bit unsigned (CV_8U) images can be saved.
- アルファチャンネルを持つBMP画像はこの関数で保存できる。これを行うには、8ビット4チャンネル (CV_8UC4) のBGRA画像を作成し、アルファチャンネルが最後のコンポーネントになるようにする。完全に透明なピクセルはアルファ値を0に、完全に不透明なピクセルはアルファ値を255にする。OpenCV v4.13.0以降ではデフォルトでBI_BITFIELDS圧縮を使用する。IMWRITE_BMP_COMPRESSIONを参照。
-
With OpenEXR encoder, only 32-bit float (CV_32F) images can be saved. More than 4 channels can be saved. (imread can load it then.)
- 8ビット符号なし (CV_8U) 画像はサポートされていない。
-
With Radiance HDR encoder, non 64-bit float (CV_64F) images can be saved.
- すべての画像が32ビット浮動小数点 (CV_32F) に変換される。
- JPEG 2000エンコーダでは、8ビット符号なし (CV_8U) および16ビット符号なし (CV_16U) 画像を保存できる。
-
With JPEG XL encoder, 8-bit unsigned (CV_8U), 16-bit unsigned (CV_16U) and 32-bit float(CV_32F) images can be saved.
- アルファチャンネルを持つJPEG XL画像はこの関数で保存できる。これを行うには、8ビット4チャンネル (CV_8UC4) / 16ビット4チャンネル (CV_16UC4) / 32ビット浮動小数点4チャンネル (CV_32FC4) のBGRA画像を作成し、アルファチャンネルが最後のコンポーネントになるようにする。完全に透明なピクセルはアルファ値を0に、完全に不透明なピクセルはアルファ値を255/65535/1.0にする。
- PAMエンコーダでは、8ビット符号なし (CV_8U) および16ビット符号なし (CV_16U) 画像を保存できる。
-
With PNG encoder, 8-bit unsigned (CV_8U) and 16-bit unsigned (CV_16U) images can be saved.
- アルファチャンネルを持つPNG画像はこの関数で保存できる。これを行うには、8ビット4チャンネル (CV_8UC4) / 16ビット4チャンネル (CV_16UC4) のBGRA画像を作成し、アルファチャンネルが最後のコンポーネントになるようにする。完全に透明なピクセルはアルファ値を0に、完全に不透明なピクセルはアルファ値を255/65535にする (下記のコードサンプルを参照)。
- PGM/PPMエンコーダでは、8ビット符号なし (CV_8U) および16ビット符号なし (CV_16U) 画像を保存できる。
-
With TIFF encoder, 8-bit unsigned (CV_8U), 8-bit signed (CV_8S),
16-bit unsigned (CV_16U), 16-bit signed (CV_16S),
32-bit signed (CV_32S),
32-bit float (CV_32F) and 64-bit float (CV_64F) images can be saved.
- 複数の画像 (Mat のベクトル) を TIFF フォーマットで保存できる (下のコードサンプルを参照)。
- 32ビット浮動小数点3チャンネル (CV_32FC3) のTIFF画像は、LogLuvハイダイナミックレンジエンコーディング (1ピクセルあたり4バイト) を使用して保存される
-
With GIF encoder, 8-bit unsigned (CV_8U) images can be saved.
- アルファチャンネルを持つGIF画像はこの関数で保存できる。これを行うには、8ビット4チャンネル (CV_8UC4) のBGRA画像を作成し、アルファチャンネルが最後のコンポーネントになるようにする。完全に透明なピクセルはアルファ値を0に、完全に不透明なピクセルはアルファ値を255にする。
- 8ビットシングルチャンネル画像 (CV_8UC1) は、GIFがインデックスカラー形式に制限されているためサポートされていない。
-
With AVIF encoder, 8-bit unsigned (CV_8U) and 16-bit unsigned (CV_16U) images can be saved.
- CV_16U画像は10ビットまたは12ビットでのみ保存できる (16ビットでは不可)。IMWRITE_AVIF_DEPTHを参照。
- アルファチャンネルを持つAVIF画像はこの関数で保存できる。これを行うには、8ビット4チャンネル (CV_8UC4) / 16ビット4チャンネル (CV_16UC4) のBGRA画像を作成し、アルファチャンネルが最後のコンポーネントになるようにする。完全に透明なピクセルはアルファ値を0に、完全に不透明なピクセルはアルファ値を255 (8ビット) / 1023 (10ビット) / 4095 (12ビット) にする (下記のコードサンプルを参照)。
- 引数:
filename- ファイルの名前。img- (Mat または Mat のベクトル) 保存する画像。- 戻り値:
- 画像が指定したファイルに正常に書き込まれた場合はtrue、それ以外の場合はfalse。
-
With BMP encoder, 8-bit unsigned (CV_8U) images can be saved.
-
imwriteWithMetadata
public static boolean imwriteWithMetadata​(java.lang.String filename, Mat img, MatOfInt metadataTypes, java.util.List<Mat> metadata, MatOfInt params)Saves an image to a specified file with metadata The function imwriteWithMetadata saves the image to the specified file. It does the same thing as imwrite, but additionally writes metadata if the corresponding format supports it.- 引数:
filename- ファイルの名前。imwrite と同様に、画像フォーマットはファイル拡張子によって決まる。img- (Mat または Mat のベクトル) 保存する画像。metadataTypes- 書き込むために metadata に格納されたメタデータチャンクの型を持つベクトル。ImageMetadataType を参照。metadata- ファイルに格納するメタデータのチャンクを持つ、ベクトルのベクトルまたは行列のベクトルparams- ペア (paramId_1, paramValue_1, paramId_2, paramValue_2, ... .) としてエンコードされたフォーマット固有の引数。cv::ImwriteFlags を参照。- 戻り値:
- 自動生成
-
imwriteWithMetadata
public static boolean imwriteWithMetadata​(java.lang.String filename, Mat img, MatOfInt metadataTypes, java.util.List<Mat> metadata)Saves an image to a specified file with metadata The function imwriteWithMetadata saves the image to the specified file. It does the same thing as imwrite, but additionally writes metadata if the corresponding format supports it.- 引数:
filename- ファイルの名前。imwrite と同様に、画像フォーマットはファイル拡張子によって決まる。img- (Mat または Mat のベクトル) 保存する画像。metadataTypes- 書き込むために metadata に格納されたメタデータチャンクの型を持つベクトル。ImageMetadataType を参照。metadata- ファイルに格納するメタデータのチャンクを持つ、ベクトルのベクトルまたは行列のベクトル- 戻り値:
- 自動生成
-
imwritemulti
public static boolean imwritemulti​(java.lang.String filename, java.util.List<Mat> img, MatOfInt params)
-
imwritemulti
public static boolean imwritemulti​(java.lang.String filename, java.util.List<Mat> img)
-
imdecode
public static Mat imdecode​(Mat buf, int flags)
Reads an image from a buffer in memory. The function imdecode reads an image from the specified buffer in the memory. If the buffer is too short or contains invalid data, the function returns an empty matrix ( Mat::data==NULL ). See cv::imread for the list of supported formats and flags description. 覚え書き: In the case of color images, the decoded images will have the channels stored in B G R order.- 引数:
buf- 入力配列またはバイトのベクトル。flags- cv::ImreadModes の値を取れるフラグ。- 戻り値:
- 自動生成
-
imdecodeWithMetadata
public static Mat imdecodeWithMetadata​(Mat buf, MatOfInt metadataTypes, java.util.List<Mat> metadata, int flags)
Reads an image from a memory buffer and extracts associated metadata. This function decodes an image from the specified memory buffer. If the buffer is too short or contains invalid data, the function returns an empty matrix ( Mat::data==NULL ). See cv::imread for the list of supported formats and flags description. 覚え書き: In the case of color images, the decoded images will have the channels stored in B G R order.- 引数:
buf- エンコードされた画像データを含む、入力配列またはバイトのベクトル。metadataTypes- metadata で返されるメタデータチャンクの型を格納する出力ベクトル。cv::ImageMetadataType を参照metadata- 取得したメタデータを格納する、ベクトルのベクトルまたは行列のベクトルである出力flags- cv::ImreadModes の値を取れるフラグ。デフォルトは cv::IMREAD_ANYCOLOR。- 戻り値:
- デコードされた画像を cv::Mat オブジェクトとして返す。デコードに失敗した場合、この関数は空の行列を返す。
-
imdecodeWithMetadata
public static Mat imdecodeWithMetadata​(Mat buf, MatOfInt metadataTypes, java.util.List<Mat> metadata)
Reads an image from a memory buffer and extracts associated metadata. This function decodes an image from the specified memory buffer. If the buffer is too short or contains invalid data, the function returns an empty matrix ( Mat::data==NULL ). See cv::imread for the list of supported formats and flags description. 覚え書き: In the case of color images, the decoded images will have the channels stored in B G R order.- 引数:
buf- エンコードされた画像データを含む、入力配列またはバイトのベクトル。metadataTypes- metadata で返されるメタデータチャンクの型を格納する出力ベクトル。cv::ImageMetadataType を参照metadata- 取得したメタデータを格納する、ベクトルのベクトルまたは行列のベクトルである出力- 戻り値:
- デコードされた画像を cv::Mat オブジェクトとして返す。デコードに失敗した場合、この関数は空の行列を返す。
-
imdecodemulti
public static boolean imdecodemulti​(Mat buf, int flags, java.util.List<Mat> mats, Range range)
Reads a multi-page image from a buffer in memory. The function imdecodemulti reads a multi-page image from the specified buffer in the memory. If the buffer is too short or contains invalid data, the function returns false. See cv::imreadmulti for the list of supported formats and flags description. 覚え書き: In the case of color images, the decoded images will have the channels stored in B G R order.- 引数:
buf- 入力配列またはバイトのベクトル。flags- cv::ImreadModes の値を取れるフラグ。mats- 複数ある場合に各ページを保持する Mat オブジェクトのベクトル。range- ページの連続した選択範囲。- 戻り値:
- 自動生成
-
imdecodemulti
public static boolean imdecodemulti​(Mat buf, int flags, java.util.List<Mat> mats)
Reads a multi-page image from a buffer in memory. The function imdecodemulti reads a multi-page image from the specified buffer in the memory. If the buffer is too short or contains invalid data, the function returns false. See cv::imreadmulti for the list of supported formats and flags description. 覚え書き: In the case of color images, the decoded images will have the channels stored in B G R order.- 引数:
buf- 入力配列またはバイトのベクトル。flags- cv::ImreadModes の値を取れるフラグ。mats- 複数ある場合に各ページを保持する Mat オブジェクトのベクトル。- 戻り値:
- 自動生成
-
imencode
public static boolean imencode​(java.lang.String ext, Mat img, MatOfByte buf, MatOfInt params)Encodes an image into a memory buffer. The function imencode compresses the image and stores it in the memory buffer that is resized to fit the result. See cv::imwrite for the list of supported formats and flags description.- 引数:
ext- 出力フォーマットを定義するファイル拡張子。先頭にピリオドを含めなければならない。img- 圧縮する画像。buf- 圧縮された画像に合わせてサイズ変更される出力バッファ。params- フォーマット固有のパラメータ。cv::imwrite および cv::ImwriteFlags を参照。- 戻り値:
- 自動生成
-
imencode
public static boolean imencode​(java.lang.String ext, Mat img, MatOfByte buf)Encodes an image into a memory buffer. The function imencode compresses the image and stores it in the memory buffer that is resized to fit the result. See cv::imwrite for the list of supported formats and flags description.- 引数:
ext- 出力フォーマットを定義するファイル拡張子。先頭にピリオドを含めなければならない。img- 圧縮する画像。buf- 圧縮された画像に合わせてサイズ変更される出力バッファ。- 戻り値:
- 自動生成
-
imencodeWithMetadata
public static boolean imencodeWithMetadata​(java.lang.String ext, Mat img, MatOfInt metadataTypes, java.util.List<Mat> metadata, MatOfByte buf, MatOfInt params)Encodes an image into a memory buffer. The function imencode compresses the image and stores it in the memory buffer that is resized to fit the result. See cv::imwrite for the list of supported formats and flags description.- 引数:
ext- 出力フォーマットを定義するファイル拡張子。先頭にピリオドを含めなければならない。img- 圧縮する画像。metadataTypes- 書き込むために metadata に格納されたメタデータチャンクの型を持つベクトル。ImageMetadataType を参照。metadata- ファイルに格納するメタデータのチャンクを持つ、ベクトルのベクトルまたは行列のベクトルbuf- 圧縮された画像に合わせてサイズ変更される出力バッファ。params- フォーマット固有のパラメータ。cv::imwrite および cv::ImwriteFlags を参照。- 戻り値:
- 自動生成
-
imencodeWithMetadata
public static boolean imencodeWithMetadata​(java.lang.String ext, Mat img, MatOfInt metadataTypes, java.util.List<Mat> metadata, MatOfByte buf)Encodes an image into a memory buffer. The function imencode compresses the image and stores it in the memory buffer that is resized to fit the result. See cv::imwrite for the list of supported formats and flags description.- 引数:
ext- 出力フォーマットを定義するファイル拡張子。先頭にピリオドを含めなければならない。img- 圧縮する画像。metadataTypes- 書き込むために metadata に格納されたメタデータチャンクの型を持つベクトル。ImageMetadataType を参照。metadata- ファイルに格納するメタデータのチャンクを持つ、ベクトルのベクトルまたは行列のベクトルbuf- 圧縮された画像に合わせてサイズ変更される出力バッファ。- 戻り値:
- 自動生成
-
imencodemulti
public static boolean imencodemulti​(java.lang.String ext, java.util.List<Mat> imgs, MatOfByte buf, MatOfInt params)Encodes array of images into a memory buffer. The function is analog to cv::imencode for in-memory multi-page image compression. See cv::imwrite for the list of supported formats and flags description.- 引数:
ext- 出力フォーマットを定義するファイル拡張子。先頭にピリオドを含めなければならない。imgs- 書き込む画像のベクトル。buf- 圧縮されたデータに合わせてサイズ変更される出力バッファ。params- フォーマット固有のパラメータ。cv::imwrite および cv::ImwriteFlags を参照。- 戻り値:
- 自動生成
-
imencodemulti
public static boolean imencodemulti​(java.lang.String ext, java.util.List<Mat> imgs, MatOfByte buf)Encodes array of images into a memory buffer. The function is analog to cv::imencode for in-memory multi-page image compression. See cv::imwrite for the list of supported formats and flags description.- 引数:
ext- 出力フォーマットを定義するファイル拡張子。先頭にピリオドを含めなければならない。imgs- 書き込む画像のベクトル。buf- 圧縮されたデータに合わせてサイズ変更される出力バッファ。- 戻り値:
- 自動生成
-
haveImageReader
public static boolean haveImageReader​(java.lang.String filename)
Checks if the specified image file can be decoded by OpenCV. The function haveImageReader checks if OpenCV is capable of reading the specified file. This can be useful for verifying support for a given image format before attempting to load an image.- 引数:
filename- チェック対象のファイル名。- 戻り値:
- 指定したファイルに対する画像リーダーが利用可能でファイルを開ける場合は true、そうでなければ false。覚え書き: この関数は、OpenCVに組み込まれているか動的にロードされる画像コーデックの利用可能性をチェックする。画像コーデックの実装をロードしてデータをデコードするのではなく、シグネチャチェックを用いる。ファイルを開けない場合やフォーマットが未対応の場合、この関数は false を返す。SEE: cv::haveImageWriter, cv::imread, cv::imdecode
-
haveImageWriter
public static boolean haveImageWriter​(java.lang.String filename)
Checks if the specified image file or specified file extension can be encoded by OpenCV. The function haveImageWriter checks if OpenCV is capable of writing images with the specified file extension. This can be useful for verifying support for a given image format before attempting to save an image.- 引数:
filename- ファイル名またはファイル拡張子(例: ".jpg", ".png")。完全なファイル名よりも拡張子を指定することが推奨される。- 戻り値:
- 指定した拡張子に対する画像ライターが利用可能な場合は true、そうでなければ false。覚え書き: この関数は、OpenCVに組み込まれているか動的にロードされる画像コーデックの利用可能性をチェックする。ファイルが実際に存在するかをチェックするのではなく、指定された型のファイルを書き込めるかどうかをチェックする。SEE: cv::haveImageReader, cv::imwrite, cv::imencode
-
-