Skip to content
This repository has been archived by the owner on Feb 25, 2021. It is now read-only.

Fixed boundary check #284

Merged
merged 1 commit into from
Apr 13, 2020
Merged

Fixed boundary check #284

merged 1 commit into from
Apr 13, 2020

Conversation

yukatayu
Copy link
Contributor

SSIA.

As you know...
at stereo::compute_subpixel_disparity,
x is (base_x + slide_offset + window_offset)
      where {
           base_x = scaled_x_right
           slide_offset ∈ [ - slide_width, + slide_width ]
           window_offset ∈ [ - win_size, win_size ]
      }

So, x ∈ [ scaled_x_right - slide_width - win_size, scaled_x_right + slide_width + win_size + 1 ).
Thus x ∈ [ scaled_x_right - slide_width - win_size, scaled_x_right + slide_width + win_size ].

That's why

const int ini_x = scaled_x_right - slide_width - win_size;
const int end_x = scaled_x_right + slide_width + win_size;

is correct.

(since assert(!(right_image_pyramid_.at(keypt_left.octave).cols <= end_x)) means assert(end_x < right_image_pyramid_.at(keypt_left.octave).cols), [ini_x, end_x] must be closed interval.)

@shinsumicco
Copy link
Collaborator

@yukatayu
I agree to it. Thanks!

@shinsumicco shinsumicco merged commit 5a0b1a5 into xdspacelab:master Apr 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants