修改时间 11-30-2020 01:58 PM
定义类型 typedef hls::stream<xf::cv::ap_axiu<PIXEL_IN_WIDTH,1,1,1> > AXI_STREAM_IN; typedef hls::stream<xf::cv::ap_axiu<PIXEL_OUT_WIDTH,1,1,1> > AXI_STREAM_OUT_12BIT; typedef hls::stream<xf::cv::ap_axiu<32,1,1,1> > AXI_STREAM_OUT_20BIT; typedef xf::cv::Mat<XF_32SC1, IMG_HEIGHT_MAX, IMG_WIDTH_MAX, XF_NPPC1> IMAGE_IN; typedef xf::cv::Mat<XF_12UC1, IMG_HEIGHT_MAX, IMG_WIDTH_MAX, XF_NPPC1> IMAGE_OUT_12BIT; typedef xf::cv::Mat<XF_32SC1, IMG_HEIGHT_MAX, IMG_WIDTH_MAX, XF_NPPC1> IMAGE_OUT_20BIT; typedef xf::cv::Scalar<1, ap_uint<PIXEL_IN_WIDTH> > PIXEL; typedef xf::cv::Scalar<1, ap_uint<PIXEL_OUT_WIDTH> > PIXEL_OUT_12BIT; typedef xf::cv::Scalar<1, ap_uint<32> > PIXEL_OUT_20BIT; IMAGE_IN img_in(inputPort.IMG_H, inputPort.IMG_W); IMAGE_OUT_12BIT img_out_12bit(inputPort.IMG_H, inputPort.IMG_W); IMAGE_OUT_20BIT img_out_20bit(inputPort.IMG_H, inputPort.IMG_W); xf::cv::AXIvideo2xfMat(input, img_in); // stream to matrix stream PIXEL pixelIn; // pixel in PIXEL_OUT_12BIT pixelOut_12Bit; // pixel out PIXEL_OUT_20BIT pixelOut_20Bit; // pixel out LINEBUF lbuf; // line buffer WINDOW window; // window buffer img_in >> pixelIn;//报错的位置 img_out_12bit << pixelOut_12Bit;//报错的位置 img_out_20bit << pixelOut_20Bit;//报错的位置
输入图像数据时,我把Stream类型的数据转换为Scalar类型的进行图像处理,处理完后再将Scalar类型的数据转换为Stream类型(Vivado HLS中是这样处理的),到Vitis HLS中之后就出现以下错误,Vitis HLS中应该怎么表示这两个类型数据之间的转换?
ERROR: [HLS 207-3719] invalid operands to binary expression ('IMAGE_IN' (aka 'Mat<XF_32SC1, 1080, 1920, XF_NPPC1>') and 'PIXEL' (aka 'Scalar<1, ap_uint<32> >')): HLS_TM_CORE/TM_CORE.cpp:175:12
ERROR: [HLS 207-3719] invalid operands to binary expression ('IMAGE_OUT_12BIT' (aka 'Mat<XF_12UC1, 1080, 1920, XF_NPPC1>') and 'PIXEL_OUT_12BIT' (aka 'Scalar<1, ap_uint<12> >')): HLS_TM_CORE/TM_CORE.cpp:438:19
ERROR: [HLS 207-3719] invalid operands to binary expression ('IMAGE_OUT_20BIT' (aka 'Mat<XF_32SC1, 1080, 1920, XF_NPPC1>') and 'PIXEL_OUT_20BIT' (aka 'Scalar<1, ap_uint<32> >')): HLS_TM_CORE/TM_CORE.cpp:439:19
12-02-2020 06:23 PM - 编辑日期 12-02-2020 06:23 PM
看一下以下表格,了解一下xf::cv::Mat 格式的更新,报错位置的<< 符号已经在Vitis vision 中不支持了
Member Function | hls::Mat (HLS Video lib) | xf::cv::Mat (Vitis vision lib) |
---|---|---|
channels() | Returns the number of channels | Returns the number of channels |
type() | Returns the enum value of pixel type | Returns the enum value of pixel type |
depth() | Returns the enum value of pixel type | Returns the depth of pixel including channels |
read() | Readout a value and return it as a scalar from stream | Readout a value from a given location and return it as a packed (for multi-pixel/clock) value. |
operator >> | Similar to read() | Not available in Vitis vision |
operator << | Similar to write() | Not available in Vitis vision |
Write() | Write a scalar value into the stream | Writes a packed (for multi-pixel/clock) value into the given location. |
12-02-2020 06:23 PM - 编辑日期 12-02-2020 06:23 PM
看一下以下表格,了解一下xf::cv::Mat 格式的更新,报错位置的<< 符号已经在Vitis vision 中不支持了
Member Function | hls::Mat (HLS Video lib) | xf::cv::Mat (Vitis vision lib) |
---|---|---|
channels() | Returns the number of channels | Returns the number of channels |
type() | Returns the enum value of pixel type | Returns the enum value of pixel type |
depth() | Returns the enum value of pixel type | Returns the depth of pixel including channels |
read() | Readout a value and return it as a scalar from stream | Readout a value from a given location and return it as a packed (for multi-pixel/clock) value. |
operator >> | Similar to read() | Not available in Vitis vision |
operator << | Similar to write() | Not available in Vitis vision |
Write() | Write a scalar value into the stream | Writes a packed (for multi-pixel/clock) value into the given location. |