01-19-2017 10:14 PM
I try to use hls::houghlines2 in HLS. However, when I use it all resource utilization are suddenly increase and it exceeds the available. Is it nomally here? Does houghlines2 use huge resource? Is it designed for large board only?
Thank you for your help.
01-20-2017 12:25 AM
01-20-2017 01:33 AM
The maxmum image size is1920x1080. The maximum line for hough is 10 lines.
01-20-2017 02:07 AM
Can you post the code that calls HoughLines? The most common cause of this sort of thing is that you've got a PIPELINE directive in the loop/function that calls HoughLines. PIPELINE inlines all sub-functions and unrolls all loops, so it's essentially trying to do HoughLines in a single cycle per image (rather than a single cycle per pixel).
01-20-2017 02:30 AM
void doFilter(AXI_STREAMIN& video_in, int angle[MAXLINES], int rho[MAXLINES],int rows, int cols) { //Create AXI streaming interfaces for the core #pragma HLS INTERFACE axis port=video_in bundle=INPUT_STREAM #pragma HLS INTERFACE ap_memory port=angle #pragma HLS INTERFACE ap_memory port=rho #pragma HLS INTERFACE s_axilite port=rows bundle=CONTROL_BUS offset=0x14 #pragma HLS INTERFACE s_axilite port=cols bundle=CONTROL_BUS offset=0x1C #pragma HLS INTERFACE s_axilite port=return bundle=CONTROL_BUS RGB_IMAGE img_0(rows, cols); RGB_IMAGE img_1(rows, cols); IMAGE_C1 H(rows, cols); IMAGE_C1 S(rows, cols); IMAGE_C1 V(rows, cols); IMAGE_C1 HMAX(rows, cols); IMAGE_C1 SMAX(rows, cols); IMAGE_C1 VMAX(rows, cols); IMAGE_C1 HMM(rows, cols); IMAGE_C1 SMM(rows, cols); IMAGE_C1 VMM(rows, cols); IMAGE_C1 HSMM(rows, cols); IMAGE_C1 inRange(rows, cols); #pragma HLS dataflow hls::AXIvideo2Mat(video_in, img_0); hls::CvtColor<HLS_RGB2HSV>(img_0, img_1); //hsv //In Range of color hls::Split(img_1, H, S, V); hls::Threshold(H, HMAX, maxHChar, 0, HLS_THRESH_TOZERO_INV); hls::Threshold(HMAX, HMM, minHChar, 255, HLS_THRESH_BINARY); hls::Threshold(S, SMAX, maxSChar, 0, HLS_THRESH_TOZERO_INV); hls::Threshold(SMAX, SMM, minSChar, 255, HLS_THRESH_BINARY); hls::Threshold(V, VMAX, maxVChar, 0, HLS_THRESH_TOZERO_INV); hls::Threshold(VMAX, VMM, minVChar, 255, HLS_THRESH_BINARY); hls::And(HMM, SMM, HSMM); hls::And(HSMM, VMM, inRange); hls::Polar_<int, int> lines[MAXLINES]; hls::HoughLines2<THETA, RHO>(inRange, lines, HOUGHTHRESHOLD); for(int i = 0; i < MAXLINES; i++){ angle[i] = lines[i].angle; rho[i] = lines[i].rho; } }
I tried to change size of image it help to reduce. However, only BRAM_18K that is reduced.