docstr: Standardized image metadata.
  
  Parameters
  ----------
  index : int, Ellipsis
      If int, get the properties of the index-th image in the
      ImageResource. If ``...``, get the properties of the image stack
      that contains all images. If None (default), use ``index=0`` if the
      image contains exactly one image and ``index=...`` otherwise.
  colorspace : str, int
      The colorspace to convert into after loading and before returning
      the image. If None (default) keep grayscale images as is, convert
      images with an alpha channel to ``RGBA`` and all other images to
      ``RGB``. If int, interpret ``colorspace`` as one of OpenCVs
      `conversion flags
      <https://docs.opencv.org/4.x/d8/d01/group__imgproc__color__conversions.html>`_
      and use it for conversion. If str, convert the image into the given
      colorspace. Possible string values are: ``"RGB"``, ``"BGR"``,
      ``"RGBA"``, ``"BGRA"``, ``"GRAY"``, ``"HSV"``, or ``"LAB"``.
  flags : int
      The OpenCV flag(s) to pass to the reader. Refer to the `OpenCV docs
      <https://docs.opencv.org/4.x/d4/da8/group__imgcodecs.html#ga288b8b3da0892bd651fce07b3bbd3a56>`_
      for details.
  
  Returns
  -------
  props : ImageProperties
      A dataclass filled with standardized image metadata.
  
  Notes
  -----
  Reading properties with OpenCV involves decoding pixel data, because
  OpenCV doesn't provide a direct way to access metadata.
docstr_tok: ["Standardized","image","metadata",".","Parameters","--","--","--","--","--","index",":","int",",","Ellipsis","If","int",",","get","the","properties","of","the","index-th","image","in","the","ImageResource",".","If","``","...","``",",","get","the","properties","of","the","image","stack","that","contains","all","images",".","If","None","(","default",")",",","use","``","index=0","``","if","the","image","contains","exactly","one","image","and","``","index=","...","``","otherwise",".","colorspace",":","str",",","int","The","colorspace","to","convert","into","after","loading","and","before","returning","the","image",".","If","None","(","default",")","keep","grayscale","images","as","is",",","convert","images","with","an","alpha","channel","to","``","RGBA","``","and","all","other","images","to","``","RGB","``",".","If","int",",","interpret","``","colorspace","``","as","one","of","OpenCVs","`","conversion","flags","<","https",":","\/\/docs.opencv.org\/4.x\/d8\/d01\/group__imgproc__color__conversions.html",">","`","_","and","use","it","for","conversion",".","If","str",",","convert","the","image","into","the","given","colorspace",".","Possible","string","values","are",":","``","``","RGB","''","``",",","``","``","BGR","''","``",",","``","``","RGBA","''","``",",","``","``","BGRA","''","``",",","``","``","GRAY","''","``",",","``","``","HSV","''","``",",","or","``","``","LAB","''","``",".","flags",":","int","The","OpenCV","flag","(","s",")","to","pass","to","the","reader",".","Refer","to","the","`","OpenCV","docs","<","https",":","\/\/docs.opencv.org\/4.x\/d4\/da8\/group__imgcodecs.html","#","ga288b8b3da0892bd651fce07b3bbd3a56",">","`","_","for","details",".","Returns","--","--","--","-","props",":","ImageProperties","A","dataclass","filled","with","standardized","image","metadata",".","Notes","--","--","-","Reading","properties","with","OpenCV","involves","decoding","pixel","data",",","because","OpenCV","does","n't","provide","a","direct","way","to","access","metadata","."]
code: def properties(
      self,
      index: int = None,
      colorspace: Union[int, str] = None,
      flags: int = cv2.IMREAD_COLOR,
  ) -> ImageProperties:
      """Standardized image metadata.
  
      Parameters
      ----------
      index : int, Ellipsis
          If int, get the properties of the index-th image in the
          ImageResource. If ``...``, get the properties of the image stack
          that contains all images. If None (default), use ``index=0`` if the
          image contains exactly one image and ``index=...`` otherwise.
      colorspace : str, int
          The colorspace to convert into after loading and before returning
          the image. If None (default) keep grayscale images as is, convert
          images with an alpha channel to ``RGBA`` and all other images to
          ``RGB``. If int, interpret ``colorspace`` as one of OpenCVs
          `conversion flags
          <https://docs.opencv.org/4.x/d8/d01/group__imgproc__color__conversions.html>`_
          and use it for conversion. If str, convert the image into the given
          colorspace. Possible string values are: ``"RGB"``, ``"BGR"``,
          ``"RGBA"``, ``"BGRA"``, ``"GRAY"``, ``"HSV"``, or ``"LAB"``.
      flags : int
          The OpenCV flag(s) to pass to the reader. Refer to the `OpenCV docs
          <https://docs.opencv.org/4.x/d4/da8/group__imgcodecs.html#ga288b8b3da0892bd651fce07b3bbd3a56>`_
          for details.
  
      Returns
      -------
      props : ImageProperties
          A dataclass filled with standardized image metadata.
  
      Notes
      -----
      Reading properties with OpenCV involves decoding pixel data, because
      OpenCV doesn't provide a direct way to access metadata.
  
      """
  
      if index is None:
          n_images = cv2.imcount(self.file_handle, flags)
          is_batch = n_images > 1
      elif index is Ellipsis:
          n_images = cv2.imcount(self.file_handle, flags)
          is_batch = True
      else:
          is_batch = False
  
      # unfortunately, OpenCV doesn't allow reading shape without reading pixel data
      if is_batch:
          img = self.read(index=0, flags=flags, colorspace=colorspace)
          return ImageProperties(
              shape=(n_images, *img.shape),
              dtype=img.dtype,
              n_images=n_images,
              is_batch=True,
          )
  
      img = self.read(index=index, flags=flags, colorspace=colorspace)
      return ImageProperties(
          shape=img.shape, dtype=img.dtype, is_batch=False
      )
  
file_path: imageio/imageio/plugins/opencv.py
imports: import warnings
  from pathlib import Path
  from typing import Any, Dict, List, Optional, Union
  import cv2
  import numpy
  from ..core import Request
  from ..core.request import URI_BYTES, InitializationError, IOMode
  from ..core.v3_plugin_api import ImageProperties, PluginV3
  from ..typing import ArrayLike
label_desc: Use image node_id 5 for calling the OpenCVPlugin obj's underlying member method code with example usage: obj.properties(index, colorspace, flags) and returns: ImageProperties, ImageProperties