class ov::op::v8::I420toBGR


Color conversion operation from I420 to BGR format. Input : More…

#include <i420_to_bgr.hpp>

class I420toBGR: public ov::op::util::ConvertColorI420Base
    // construction

    I420toBGR(, , );

    // methods

    "I420toBGR""opset8"util::ConvertColorI420Base OPENVINO_OP(, , );
    virtual std::shared_ptr<Node>const OutputVector& clone_with_new_inputs() const;

Inherited Members

    // typedefs

    typedef DiscreteTypeInfo type_info_t;
    typedef std::map<std::string, Any> RTMap;

    // enums

    enum ColorConversion;

    // methods

    virtual void validate_and_infer_types();
    void constructor_validate_and_infer_types();
    virtual boolAttributeVisitor& visit_attributes();
    virtual const ov::op::AutoBroadcastSpec& get_autob() const;
    virtual bool has_evaluate() const;
    virtual boolconst ov::HostTensorVector&const ov::HostTensorVector& evaluate(, ) const;

    virtual boolconst ov::HostTensorVector&const ov::HostTensorVector&const EvaluationContext& evaluate(

        ) const;

    virtual boolov::TensorVector&const ov::TensorVector& evaluate(, ) const;

    virtual boolov::TensorVector&const ov::TensorVector&const ov::EvaluationContext& evaluate(

        ) const;

    virtual boolov::TensorVector& evaluate_lower() const;
    virtual boolov::TensorVector& evaluate_upper() const;
    virtual boolTensorLabelVector& evaluate_label() const;
    virtual boolOutputVector&const OutputVector& constant_fold(, );
    virtual OutputVector decompose_op() const;
    virtual const type_info_t& get_type_info() const = 0;
    const char \* get_type_name() const;
    voidconst NodeVector& set_arguments();
    voidconst OutputVector& set_arguments();
    voidsize_tconst Output<Node>& set_argument(, );
    voidsize_tconst element::Type&const PartialShape& set_output_type(, , );
    voidsize_t set_output_size();
    void invalidate_values();
    virtual void revalidate_and_infer_types();
    virtual std::string description() const;
    const std::string& get_name() const;
    voidconst std::string& set_friendly_name();
    const std::string& get_friendly_name() const;
    virtual bool is_dynamic() const;
    size_t get_instance_id() const;
    virtual std::ostream&std::ostream&uint32_t write_description(, ) const;
    const std::vector<std::shared_ptr<Node>>& get_control_dependencies() const;
    const std::vector<Node \*>& get_control_dependents() const;
    voidstd::shared_ptr<Node> add_control_dependency();
    voidstd::shared_ptr<Node> remove_control_dependency();
    void clear_control_dependencies();
    void clear_control_dependents();
    voidconst std::shared_ptr<const Node>& add_node_control_dependencies();
    voidconst std::shared_ptr<const Node>& add_node_control_dependents();
    voidstd::shared_ptr<Node> transfer_control_dependents();
    size_t get_output_size() const;
    const element::Type&size_t get_output_element_type() const;
    const element::Type& get_element_type() const;
    const Shape&size_t get_output_shape() const;
    const PartialShape&size_t get_output_partial_shape() const;
    Output<const Node> get_default_output() const;
    Output<Node> get_default_output();
    virtual size_t get_default_output_index() const;
    size_t no_default_index() const;
    const Shape& get_shape() const;
    descriptor::Tensor&size_t get_output_tensor() const;
    descriptor::Tensor&size_t get_input_tensor() const;
    std::set<Input<Node>>size_t get_output_target_inputs() const;
    size_t get_input_size() const;
    const element::Type&size_t get_input_element_type() const;
    const Shape&size_t get_input_shape() const;
    const PartialShape&size_t get_input_partial_shape() const;
    Node \*size_t get_input_node_ptr() const;
    std::shared_ptr<Node>size_t get_input_node_shared_ptr() const;
    Output<Node>size_t get_input_source_output() const;
    virtual std::shared_ptr<Node>const OutputVector& clone_with_new_inputs() const = 0;
    std::shared_ptr<Node>const OutputVector& copy_with_new_inputs() const;

    std::shared_ptr<Node>const OutputVector&const std::vector<std::shared_ptr<Node>>& copy_with_new_inputs(

        ) const;

    boolstd::shared_ptr<const Node> has_same_type() const;
    RTMap& get_rt_info();
    const RTMap& get_rt_info() const;
    NodeVectorbool get_users() const;
    boolconst Node& operator < () const;
    std::vector<Input<Node>> inputs();
    std::vector<Input<const Node>> inputs() const;
    std::vector<Output<Node>> input_values() const;
    std::vector<Output<Node>> outputs();
    std::vector<Output<const Node>> outputs() const;
    Input<Node>size_t input();
    Input<const Node>size_t input() const;
    Output<Node>size_t input_value() const;
    Output<Node>size_t output();
    Output<const Node>size_t output() const;

    virtual boolov::pass::pattern::Matcher \*const Output<Node>&const Output<Node>& match_value(


    virtual boolov::pass::pattern::Matcher \*const Output<Node>& match_node(, );
    static _OPENVINO_HIDDEN_METHODconst ::ov::Node::type_info_t& get_type_info_static();
    virtual const ::ov::Node::type_info_t& get_type_info() const;
    "ConvertColorI420Base""util" OPENVINO_OP(, );
    virtual void validate_and_infer_types();
    virtual boolAttributeVisitor& visit_attributes();

Detailed Documentation

Color conversion operation from I420 to BGR format. Input :

  • Input NV12 image can be represented in two ways: a) Single plane (as it is in the file): I420 height dimension is 1.5x bigger than image height. ‘C’ dimension shall be 1. b) Three separate planes (used this way in many physical video sources): Y, U and V. In this case b1) Y plane has height same as image height. ‘C’ dimension equals to 1 b2) U plane has dimensions: ‘H’ = image_h / 2; ‘W’ = image_w / 2; ‘C’ = 1. b3) V plane has dimensions: ‘H’ = image_h / 2; ‘W’ = image_w / 2; ‘C’ = 1.

  • Supported element types: u8 or any supported floating-point type. Output :

  • Output node will have NHWC layout and shape HxW same as image spatial dimensions.

  • Number of output channels ‘C’ will be 3, as per interleaved BGR format, first channel is B, last is R

    Conversion of each pixel from I420 (YUV) to RGB space is represented by following formulas: R = 1.164 * (Y - 16) + 1.596 * (V - 128) G = 1.164 * (Y - 16) - 0.813 * (V - 128) - 0.391 * (U - 128) B = 1.164 * (Y - 16) + 2.018 * (U - 128) Then R, G, B values are clipped to range (0, 255)



Constructs a conversion operation from input image in I420 format As per I420 format definition, node height dimension shall be 1.5 times bigger than image height so that image (w=640, h=480) is represented by NHWC shape {N,720,640,1} (height*1.5 x width)



Node that produces the input tensor. Input tensor represents image in NV12 format (YUV).

I420toBGR(, , )

Constructs a conversion operation from 2-plane input image in NV12 format In general case Y channel of image can be separated from UV channel which means that operation needs two nodes for Y and UV planes respectively. Y plane has one channel, and UV has 2 channels, both expect ‘NHWC’ layout.



Node that produces the input tensor for Y plane (NHWC layout). Shall have WxH dimensions equal to image dimensions. ‘C’ dimension equals to 1.


Node that produces the input tensor for U plane (NHWC layout). ‘H’ is half of image height, ‘W’ is half of image width, ‘C’ dimension equals to 1.


Node that produces the input tensor for V plane (NHWC layout). ‘H’ is half of image height, ‘W’ is half of image width, ‘C’ dimension equals to 1.