摘要 |
The invention discloses a method for obtaining parallax by using region-based local stereo matching. The method comprises the steps of selecting a plurality of searching pixels in a second channel of viewpoint images for a current pixel of a first channel of viewpoint images; obtaining a first matching cost value and a second matching cost value between the current pixel and a certain searching pixel by respectively using a sum of absolute differences (SAD) algorithm and a Rank transformation algorithm; determining a first matching weight and a second matching weight according to numbers of edge pixels in a set region around pixels corresponding to the current pixel in binaryzation edge images of the first channel of viewpoint images; regarding the sum of the product of the first matching cost value and the first matching weight and the product of the second matching cost value and the second matching weight as a final matching cost value between the current pixel and the searching pixel; obtaining other final matching cost values and choosing the smallest matching cost value in all the final matching cost values and obtaining a vector difference which is a first parallax of the current pixel between a searching pixel which corresponds to the smallest matching cost value and the current pixel. |