LSD.CPP had a mistake?

asked 2017-08-11 02:16:21 -0600

s_h1005 gravatar image

updated 2017-09-26 02:33:29 -0600

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;
edit retag flag offensive close merge delete

Comments

where did you find lsd.c ?

berak gravatar imageberak ( 2017-08-13 04:07:21 -0600 )edit
1