reset password
Author Message
kknaur
Posts: 540
Posted 13:55 May 29, 2011 |

I rewatched her explanation of the homework 4 and I am confused on how to do this.  Do you wait until you are done calculating the motion vectors for each block before you create the error image, or do you create the error image after you finish with a block.  Also, what is the exact formula she presented it looked something like this:

X = a value in the range of error values

Y = a value in the range of 0 ~ 255

errorMax = the max error value in the range of error values

 

((errorMax - X ) / errorMax) = ((255 - Y) / 255)    and then you solve for Y

If you do the value mapping after each block then the range of error values could potentially change right?  as opposed to waiting until the very end and using the range of all error values for all blocks?  So which is the correct way to approach this.  If you do it after each block to me the error ranges would be different so would that create different mapped values? 

 

 


 

Last edited by kknaur at 16:11 May 31, 2011.
eykang
Posts: 95
Posted 07:51 May 30, 2011 |

Let's say EB consists of error blocks of all target blocks.

Each error block can be computed right after your calculate mv per target block.Or you can wait until you have mvs for all target blocks. It does not matter.

However, error image (error.ppm) can be generated after you have the compete EB because that's when you can get errorMin and errorMax. 

 

To calculate Y, you need errorMin as well.

 

kknaur
Posts: 540
Posted 12:32 May 30, 2011 |

I am unsure of which formula to use for range mapping then because on the video the example error range was from -10 to 50 and 50 was the only value used in the equation at least that's what it looked like on the video.  Which is the exact formula?

cbort
Posts: 95
Posted 13:45 May 30, 2011 |

Ok so you will need to know the min and max to be able to remap...

For GRAYSCALE

mapValue = (origValue - min)*255 / (max - min)


soo if your max was 20 and your min was 12 and the original value in question was 15

(15 - 8) * 255 / (20 - 12)

= ( 7 ) * 255 / (8)

= 223

 

Last edited by cbort at 14:09 May 30, 2011.
kknaur
Posts: 540
Posted 13:46 May 30, 2011 |

Ok thank you.

cbort
Posts: 95
Posted 14:22 May 30, 2011 |

for YCbCr since all values are not the same I am not sure if you have to map Cb and Cr in addition to Y but

for Y, the equation is:

 

mappedValue = (origVal - (min) ) * (127 - ( -128 ) ) / (max - min ) + (-128)

 

soo if your max was 20.0 and your min was -12.0 and the original value in question was 15.0

(15.0 - (-12.0) )  * ( 127.0 - ( - 128.0) ) / ( 20.0 - (-12.0) ) + (-128.0)

= ( 27 ) * 255 / ( 32 ) - 128.0

= 215.15 -128.0

= 87.15