cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Observer
Observer
3,279 Views
Registered: ‎11-23-2016

HoughLine resource utilization

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?

 

houghResource.png

Thank you for your help.

0 Kudos
Reply
4 Replies
Xilinx Employee
Xilinx Employee
3,255 Views
Registered: ‎08-01-2008

Resource may be correct. what other parameter you are passing.
what is the line size and width size for your inputs
Thanks and Regards
Balkrishan
--------------------------------------------------------------------------------------------
Please mark the post as an answer "Accept as solution" in case it helped resolve your query.
Give kudos in case a post in case it guided to the solution.
0 Kudos
Reply
Observer
Observer
3,240 Views
Registered: ‎11-23-2016

The maxmum image size is1920x1080. The maximum line for hough is 10 lines.

0 Kudos
Reply
Advisor
Advisor
3,226 Views
Registered: ‎04-26-2015

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).

0 Kudos
Reply
Observer
Observer
3,220 Views
Registered: ‎11-23-2016

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.

houghResourceSmallerImage.png

0 Kudos
Reply