Question

Hi could someone please help I am using matlab to generate a disparity map. I have performed multi-wavelet transforms on two rectified stereo pairs and have used a stereo matching algorithm to combine the corresponding babsebands from each image to produce four intial disparity maps. However, I am now stuck and completely clueless on how to use a median operator to combine the values of these four disparity maps into one. Could someone please help me?

the four of my images are equal in size. The previous code is irrelevant since it is in a different file(I have just saved the output from the previous file and now I am trying to code this in another file).

My thoughts were to: 1. Read the value of pixel p from each of the four basebands 2. Sort the values into ascending order 3. Calculate the median value of the pixel 4. Write the pixel value to a new image 5. Set p+1 and repeat steps 1-4 until last pixel is reached

Thank you

Was it helpful?

Solution

First, stack the images into a MxNx4 array:

bbstack = cat(3,bb1,bb2,bb3,bb4);  % use bb{:} if they are in a single cell array

Then apply the median operator along the third dimension:

medbb = median(bbstack,3);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top