Ask Your Question
0

Generating middle image using stereo image(two images)

asked 2016-07-15 02:00:20 -0600

cysatan gravatar image

updated 2016-07-15 03:09:17 -0600

Hello,

I study stereo vision.

How to generate middle position image using depth map?

(What function should I use?)

sincerely,

image description

image description

edit retag flag offensive close merge delete

Comments

this is pretty vague.

can you explain, what you mean by "middle image" ?

berak gravatar imageberak ( 2016-07-15 02:35:47 -0600 )edit

middle positon image

If left image posion is horizontal 10 cm and right posion is horizontal 16 cm, middle image position is horizontal 13cm.

cysatan gravatar imagecysatan ( 2016-07-15 03:01:05 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
2

answered 2016-07-15 07:54:33 -0600

dandur gravatar image

updated 2016-07-15 08:33:01 -0600

There's no single function solution. The final result depends on various conditions. I would do the folowing:

  1. Compute disparity map with left and right images (with using cv::StereoSGBM). Note that disparity relates to the left image.

  2. (Optional) postprocess disparity map. Fill gaps etc.

  3. Recompute disparity map to the middle view (DispM). First init middle disparity with negative (invalid values). Then reproject left disparity to middle:

    d = DispL[x,y] / 2 # divide by two because disparity for middle view less then for right view

    if x-d > 0 and DispM[x-d,y] < d: DispM[x-d,y] = d

  4. Possible postprocess DispM to fill gaps

  5. Remap left image to the middle view with cv::remap. The tables for remapping calculated with folowing:

    mapy[x,y] = y

    mapx[x,y] = x - DispM[x,y]

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2016-07-15 02:00:20 -0600

Seen: 925 times

Last updated: Jul 15 '16