I find line 612 to line 627 in lsd.cpp in opencv3.2 is useless, am I right?
// Sort int idx = n_bins - 1; for(;idx > 0 && !range_s[idx]; --idx); coorlist* start = range_s[idx]; coorlist* end = range_e[idx]; if(start) { while(idx > 0) { --idx; if(range_s[idx]) { end->next = range_s[idx]; end = range_e[idx]; } } }
The codes attached here aim to make the list starts by the larger bin, howerer ,it doesn't works. "list[0]" is still the first position of a image.
In lsd.c, we can see the following codes, list_p points the largest bin.
for(i=n_bins-1; i>0 && range_l_s[i]==NULL; i--);
start = range_l_s[i];
end = range_l_e[i];
if( start != NULL )
while(i>0)
{
--i;
if( range_l_s[i] != NULL )
{
end->next = range_l_s[i];
end = range_l_e[i];
}
}
*list_p = start;