如何冲洗 hls::垫子
How to flush hls::Mat?
我需要将两个图像(hls::Mat(的上半部分堆叠在一起。我最终遇到了以下错误。
警告:hls::stream 'hls::stream.8' 包含剩余数据,这可能会导致 RTL 模拟挂起。
如果我冲刷剩菜
while (1){
img_in0 >> p0;
if (!p0.val[0])
break;
}
我收到以下错误
警告:Hls::stream 'hls::stream.7' 在空时读取,这可能会导致 RTL 模拟挂起。
我想知道冲洗剩菜的最佳方法是什么?
#define NO_PREFILTER
#include "stereo_top.h"
void combine2(
GRAY_IMAGE& img_in0,
GRAY_IMAGE& img_in1,
GRAY_IMAGE& img_out,
int rows,
int cols) {
hls::Scalar<1, unsigned char> p0, p1, p;
L_row: for(int row = 0; row < rows; row++) {
#pragma HLS LOOP_TRIPCOUNT min=1 max=1080
L_col: for(int col = 0; col < cols; col++) {
#pragma HLS LOOP_TRIPCOUNT min=1 max=1920
#pragma HLS pipeline rewind
if(row<(rows/2)) {
img_in0 >> p0;
p = p0;
}
else
{
img_in1 >> p1;
p = p1;
}
img_out << p;
}
}
while (1){
img_in0 >> p0;
if (!p0.val[0])
break;
}
}
void stereo_filter_lr(AXI_STREAM& imgLeft_axi, AXI_STREAM& imgRight_axi, AXI_STREAM& stereoOut, int rows, int cols)
{
#pragma HLS INTERFACE axis port=imgRight_axi
#pragma HLS INTERFACE axis port=imgLeft_axi
#pragma HLS INTERFACE ap_none port=cols
#pragma HLS INTERFACE ap_none port=rows
RGB_IMAGE imgL_0(rows, cols);
RGB_IMAGE imgR_0(rows, cols);
GRAY_IMAGE img_L(rows, cols);
GRAY_IMAGE img_R(rows, cols);
GRAY_IMAGE disp(rows, cols);
RGB_IMAGE stereo(rows, cols);
#pragma HLS dataflow
//Recieve data stream and convert to Mat format
hls::AXIvideo2Mat(imgLeft_axi, imgL_0);
hls::AXIvideo2Mat(imgRight_axi, imgR_0);
//Convert RGB Image to Gray Image
hls::CvtColor<HLS_BGR2GRAY>(imgL_0, img_L);
hls::CvtColor<HLS_BGR2GRAY>(imgR_0, img_R);
combine2(img_L, img_R, disp, rows, cols);
hls::CvtColor<HLS_GRAY2BGR>(disp, stereo);
hls::Mat2AXIvideo(stereo, stereoOut);
return;
}
我相信您可以使用以下函数来消耗剩余数据:
hls::Consume()
相关文章:
- imread() 仍然返回空垫子,尽管在 openCV 4.0.0 中寻址正确
- 如何创建透明垫子
- 选择基于另一个垫子的非零像素的cv::Mat的一部分?
- 两个垫子的 OpenCV 数据是相同的,但使用 Mat::at 检索时的值已损坏
- OpenCV C++:当垫子类型未知时无法访问垫子元素?
- 传递指针数组以在 Vivado HLS (SDSoC 2018) 中发挥作用
- OpenCV垫子的垫子
- 位图到垫子/2D 数组
- 如何将具有两个通道的垫子转换为矢量<int><矢量>?
- OpenCv 在C++中从 1 D 数组制作垫子图像的最快方法
- 如何将垫子转换为 int?(c++,gpu,OpenCV)
- 垫子对象数组太大会导致 Seg 错误
- 如何乘以垫子A * B?
- <int> 与垫子<int>相比,犰狳SpMat非常慢
- 从OpenCV中的三个单个垫子创建BGR垫
- 将帧(安卓中的垫子数据)从安卓传递到本机 c++ 并检测人脸
- 垫子声明:声明尺寸和大小()不同
- 将常量浮点*转换为垫子
- 为什么延迟太高,即使只是 RGB 到灰色转换 (Vivado HLS)?
- 如何冲洗 hls::垫子