.. _package-rst-vision: ==================== Package rst.vision ==================== In computer science, image processing is any form of signal processing for which the input is an image. This package contains data types for representing images (:py:class:`Image `) or things which can be recognized in images (e.g. :py:class:`Face `). .. seealso:: Wikipedia article containing the definition above http://en.wikipedia.org/wiki/Image_processing Messages ======== .. container:: mess4ge-multi .. container:: mess4ge-graph .. digraph:: message_graph fontname="Arial"; fontsize=11; stylesheet="../_static/corlab.css"; node [fontsize=11] node [fontname="Arial"] edge [fontsize=11] edge [fontname="Arial"] "6" [label=<
Faces
Facefaces
UINT32width
UINT32height
>,shape=box,style=filled,fillcolor="white"]; "7" [label=<
Face
BoundingBoxregion
FLOAT64confidence
>,shape=box,style=filled,fillcolor="white"]; "8" [label=<
BoundingBox
Vec2DInttop_left
UINT32width
UINT32height
UINT32image_width
UINT32image_height
>,shape=box,style=filled,fillcolor="white"]; "9" [label=<
Vec2DInt
INT32x
INT32y
>,shape=box,style=filled,fillcolor="white"]; "1" [label=<
Images
Imageimages
>,shape=box,style=filled,fillcolor="white"]; "2" [label=<
Image
OCTET-VECTORdata
UINT32width
UINT32height
UINT32channels
Depthdepth
ColorModecolor_mode
DataOrderdata_order
>,shape=box,style=filled,fillcolor="white"]; "5" [label=<
DataOrder
DATA_SEPARATE0
DATA_INTERLEAVED1
>,shape=box,style=filled,fillcolor="white"]; "4" [label=<
ColorMode
COLOR_GRAYSCALE0
COLOR_RGB1
COLOR_BGR2
COLOR_YUV4
COLOR_YUV4228
>,shape=box,style=filled,fillcolor="white"]; "3" [label=<
Depth
DEPTH_8U8
DEPTH_16U16
DEPTH_32F32
>,shape=box,style=filled,fillcolor="white"]; "6":faces -> "7" []; "7":region -> "8" []; "8":top_left -> "9" []; "1":images -> "2" []; "2" -> "5" [dir=both,arrowtail=odiamond]; "2" -> "4" [dir=both,arrowtail=odiamond]; "2" -> "3" [dir=both,arrowtail=odiamond]; "2":data_order -> "5" []; "2":color_mode -> "4" []; "2":depth -> "3" []; .. container:: mess4ge-list .. container:: messages * :ref:`Images ` * :ref:`Faces ` * :ref:`Face ` * :ref:`Image ` .. container:: clearer clearer: should be made invisible via css .. _message-rst-vision-images: Message Images -------------- .. container:: message-rst-vision-images-multi .. container:: message-rst-vision-images-documentation .. py:class:: rst.vision.Images TODO A collection of images. .. codeauthor:: Johannes Wienke .. py:attribute:: images :type: array of :py:class:`rst.vision.Image` TODO .. container:: message-rst-vision-images-source :download:`Download this file ` .. literalinclude:: //home/jenkins/workspace/rst-manual-0.10-merge-simulator/rst-manual/../rst-proto/proto/stable/rst/vision/Images.proto :lines: 12-19 :language: protobuf :emphasize-lines: 6-6 .. _message-rst-vision-faces: Message Faces ------------- .. container:: message-rst-vision-faces-multi .. container:: message-rst-vision-faces-documentation .. py:class:: rst.vision.Faces A list of faces with information about the dimensions of a source image used by a face detector. This allows interpretation of the bounding box data contained in the Face types. .. codeauthor:: Sebastian Wrede .. py:attribute:: faces :type: array of :py:class:`rst.vision.Face` List of faces. .. py:attribute:: width :type: :py:class:`UINT32` **Unit**: pixel Width of the source image. .. py:attribute:: height :type: :py:class:`UINT32` **Unit**: pixel Height of the source image. .. container:: message-rst-vision-faces-source :download:`Download this file ` .. literalinclude:: //home/jenkins/workspace/rst-manual-0.10-merge-simulator/rst-manual/../rst-proto/proto/stable/rst/vision/Faces.proto :lines: 15-34 :language: protobuf :emphasize-lines: 6-6,12-12,18-18 .. _message-rst-vision-face: Message Face ------------ .. container:: message-rst-vision-face-multi .. container:: message-rst-vision-face-documentation .. py:class:: rst.vision.Face An object of this type represents a human face detected in an image. The region of the image which corresponds to the face is represented as a :py:class:`BoundingBox ` . .. codeauthor:: Johannes Wienke .. py:attribute:: region :type: :py:class:`rst.geometry.BoundingBox` TODO Bounding box for the detection. .. py:attribute:: confidence :type: :py:class:`FLOAT64` **Unit**: TODO TODO Detection confidence factor. .. container:: message-rst-vision-face-source :download:`Download this file ` .. literalinclude:: //home/jenkins/workspace/rst-manual-0.10-merge-simulator/rst-manual/../rst-proto/proto/stable/rst/vision/Face.proto :lines: 15-28 :language: protobuf :emphasize-lines: 6-6,12-12 .. _message-rst-vision-image: Message Image ------------- .. container:: message-rst-vision-image-multi .. container:: message-rst-vision-image-documentation .. py:class:: rst.vision.Image An uncompressed image with a certain pixel format, color and depth. The binary intensity data is contained in the :py:attr:`data ` field. The remaining fields contain information about the interpretation, that is dimensions (:py:attr:`width ` x :py:attr:`height `), color (:py:attr:`color_mode `, :py:attr:`channels `), depth (:py:attr:`depth `) and channel layout (:py:attr:`data_order `, :py:attr:`channels `), of that data. Suggested interpretation of RSB timestamps: create Image grab time .. todo:: to be more precisely defined. e.g. what does this mean for rolling shutter cameras? .. codeauthor:: Johannes Wienke .. py:attribute:: data :type: :py:class:`OCTET-VECTOR` **Constraint**: ``len(value) = (.width * .height * .channels * .depth) / 8`` Stores the actual pixel data of the image. The number of bytes and their interpretation depend on the values of the remaining fields. .. py:attribute:: width :type: :py:class:`UINT32` **Unit**: pixel The number of pixels in each row of the image. .. py:attribute:: height :type: :py:class:`UINT32` **Unit**: pixel The number of pixels in each column of the image. .. py:attribute:: channels :type: :py:class:`UINT32` **Unit**: number The number of color channels in the image. The interpretation of these channels depends on :py:attr:`color_mode `. .. py:attribute:: depth :type: :py:class:`rst.vision.Image.Depth` The number of bits used to encode .. py:attribute:: color_mode :type: :py:class:`rst.vision.Image.ColorMode` Colorspace and layout of the color channels of the image. Determines pixel layout in combination with :py:attr:`data_order `. .. py:attribute:: data_order :type: :py:class:`rst.vision.Image.DataOrder` Layout of the color planes of the image. Determines pixel layout in combination with :py:attr:`color_mode `. .. container:: message-rst-vision-image-source :download:`Download this file ` .. literalinclude:: //home/jenkins/workspace/rst-manual-0.10-merge-simulator/rst-manual/../rst-proto/proto/stable/rst/vision/Image.proto :lines: 25-167 :language: protobuf :emphasize-lines: 101-101,107-107,113-113,122-122,127-127,134-134,141-141 .. _message-rst-vision-image-depth: Message Depth ------------- .. container:: message-rst-vision-image-depth-multi .. container:: message-rst-vision-image-depth-documentation .. py:class:: rst.vision.Image.Depth Depth of one color channel. Reflecting the definitions from OpenCV's IplImage. .. py:attribute:: DEPTH_8U = 8 *Not documented* .. py:attribute:: DEPTH_16U = 16 *Not documented* .. py:attribute:: DEPTH_32F = 32 *Not documented* .. container:: message-rst-vision-image-depth-source :download:`Download this file ` .. literalinclude:: //home/jenkins/workspace/rst-manual-0.10-merge-simulator/rst-manual/../rst-proto/proto/stable/rst/vision/Image.proto :lines: 32-36 :language: protobuf :emphasize-lines: 2-2,3-3,4-4 .. _message-rst-vision-image-colormode: Message ColorMode ----------------- .. container:: message-rst-vision-image-colormode-multi .. container:: message-rst-vision-image-colormode-documentation .. py:class:: rst.vision.Image.ColorMode Colorspace(s) and layout of color channel(s). .. py:attribute:: COLOR_GRAYSCALE = 0 The image consists of only one channel containing intensity values. MUST be used with :py:attr:`channels ` = 1. .. py:attribute:: COLOR_RGB = 1 The image has three color channels containing the red, green and blue color components (note the order of the channels, not to be confused with :py:attr:`COLOR_BGR `). MUST be used with :py:attr:`channels ` = 3. .. py:attribute:: COLOR_BGR = 2 The image has three color channels containing the blue, green and red color components (note the order of the channels, not to be confused with :py:attr:`COLOR_RGB `). MUST be used with :py:attr:`channels ` = 3. .. py:attribute:: COLOR_YUV = 4 The image has three color channels, encoded in the YUV colorspace, and uses the YUVYUV pixel layout. MUST be used with :py:attr:`channels ` = 3. .. py:attribute:: COLOR_YUV422 = 8 The image has three color channels, encoded in the YUV colorspace, and uses the YUYV pixel layout. MUST be used with :py:attr:`channels ` = 3. .. container:: message-rst-vision-image-colormode-source :download:`Download this file ` .. literalinclude:: //home/jenkins/workspace/rst-manual-0.10-merge-simulator/rst-manual/../rst-proto/proto/stable/rst/vision/Image.proto :lines: 41-85 :language: protobuf :emphasize-lines: 9-9,18-18,27-27,35-35,43-43 .. _message-rst-vision-image-dataorder: Message DataOrder ----------------- .. container:: message-rst-vision-image-dataorder-multi .. container:: message-rst-vision-image-dataorder-documentation .. py:class:: rst.vision.Image.DataOrder Describes storage layout of pixels with respect to channels. .. py:attribute:: DATA_SEPARATE = 0 Separate planes. Example for :py:attr:`COLOR_RGB `: .. parsed-literal:: R R R ... (:py:attr:`width ` x :py:attr:`height ` times) G G G ... (:py:attr:`width ` x :py:attr:`height ` times) B B B ... (:py:attr:`width ` x :py:attr:`height ` times) .. py:attribute:: DATA_INTERLEAVED = 1 Interleaved image. Example for :py:attr:`COLOR_RGB `: .. parsed-literal:: R G B R G B R G B ... (:py:attr:`width ` x :py:attr:`height ` times) .. container:: message-rst-vision-image-dataorder-source :download:`Download this file ` .. literalinclude:: //home/jenkins/workspace/rst-manual-0.10-merge-simulator/rst-manual/../rst-proto/proto/stable/rst/vision/Image.proto :lines: 90-116 :language: protobuf :emphasize-lines: 14-14,25-25