To dispose entirely of the above mentioned error, it is necessary to redefine the view processing area. Dividing the image into smaller subimages enables mitigating the risk of repeating similar pixels in the processed area. With this method it is possible to receive only correct matches [12]. The sliding window mechanism is a tool enabling division of stereo pair into subimages. The obtained, splitted segments correspond to each other in the framework of the primary stereo view. The process of division utilizes a rectangular, equal-sized window, which sets the boundaries of the processed area, so that the pixels from the outside of the border are not taken into account. The window moves across the surface of the stereo pair marking out consecutive subimages. Moreover, it guarantees that every region is taken under consideration only once, without needlessly repeated calculations in the already processed fragment. It allows to save time and make the method a robust and optimalized tool.

The subimages from the corresponding sliding windows from the left and from the right view are compared utilizing the binary patterns matching algorithm to find the matches belonging to the processed area. From all matches marked out in the framework of a single subimage pair, only the best matches are chosen. Not only one match (as in the previous version of the algorithm), but several best matches are used. This means selecting a set of matches that fulfill the condition of minimum vectorial distance between the feature vectors representing the pixels of the right and left views, respectively. This modification makes it possible for more explicit image areas to have significant roles in estimating the correlation of stereo images The chosen matches are used in further steps of disparity estimation process. The solution improves the correctness of final results (Figure 4). The way of estimating the value of local vertical disparity does not differ from calculating the disparity in the case of the basic algorithm - it means marking out the displacement value in the Y coordinates of matched pixels. After all pairs of subimages are processed according to the described algorithm (Algorithm 1), the stereo pair analysis may be considered as a completed one. The mean of obtained in this way values of local disparities equals the global stereo view disparity value. Provided that the sliding window mechanism has correctly estimated parameters, the described algorithm enables elimination the problem occurring in the binary patterns matching process.

#### Algorithm 1

Pseudocode of the sliding window disparity detection algorithm

*SW*_{W} SlidingWindowWidth

*SW*_{H} SlidingWindowHeight

*V*_{L} LeftStereoscopicView, *V*_{R} RightStereoscopicView

*S*_{L} LeftSubimage, *S*_{R} RightSubimage

*K*_{L} LeftKeypoints, *K*_{R} RightKeypoints

*D*_{L} LeftDescriptors, *D*_{R} RightDescriptors

*M*_{LR} LeftToRightMatches, *M*_{RL} RightToLeftMatches

*M*_{F} FilteredMatches

*M*_{B} BestHammingMatches

*D*_{V} LocalVerticalDisparities

**for** w **in** 1:min(*V*_{L}.width,*V*_{R}.width) **step** *SW*_{W} **do**

**for** h **in** 1:min(*V*_{L}.height,*V*_{R}.height) **step** *SW*_{H} **do**

*S*_{L}:=*V*_{L}.getSubimage(*w,h,SW*_{W},SW_{H})

*S*_{R}:=*V*_{R}.getSubimage(*w,h,SW*_{W},SW_{H})

*K*_{L}:=*FAST*(*S*_{L}) [13]

*K*_{R}:=*FAST*(*S*_{R})

*D*_{L}:=*BRIEF*(*S*_{L},K_{L}) [14]

*D*_{R}:=*BRIEF*(*S*_{R},K_{R})

*M*_{LR}:=*BruteForceHamming*(*D*_{L},D_{R})

*M*_{RL}:=*BruteForceHamming*(*D*_{R},D_{L})

*M*_{F}:=*M*_{LR} ⋂ *M*_{RL}

*M*_{B}:=*getBestHammingMatches*(*M*_{F})

**for** each *b* ∈ *M*_{B} **do**

*D*_{V}.add(*b.leftPoint.y - b.rightPoint.y*)

**end for**

**end for**

**end for**

**return** *D*_{V}

## Comments (0)

General note:By using the comment function on degruyter.com you agree to our Privacy Statement. A respectful treatment of one another is important to us. Therefore we would like to draw your attention to our House Rules.