Skip to content

SEGFAULT / assertion in debug mode about out of index access #4

@GoogleCodeExporter

Description

@GoogleCodeExporter
What steps will reproduce the problem?
1. Using KITTY dataset (stereo_vo)

What is the expected output? What do you see instead?

Would like to see a pose, I get a segfault instead.

What version of the product are you using? On what operating system?

Latest as of 3rd June 2013.

Please provide any additional information below.

When building in debug mode, in initial_homography_estimation.cpp, function 
graytoeigen, this line eig_imf(ey, ex) += grayData[y * stride + x];

Fails its assertion, in my case eig_imf is of dimension row x col == 33x77, and 
the field that is being accessed is col 77, whereas eig_imf only ranges from 
0..76

This is most likely due to line:

 int cols = width >> downsampleFactor;

width in my case was 310, downsampleFactor 2 so 310 gets divided by 4, that 
equals 77.5 for cols, but is truncated to 77.

for (int x = 0; x < width; x++) {
 int ex = x >> downsampleFactor;
 ...
}

Runs from 0 to 310. At point x == 308 the shift makes ex = 308 >> 4 = 77.
Something is off here about the indices and rounding.

Original issue reported on code.google.com by crust...@gmail.com on 3 Jun 2013 at 2:38

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions