Author | Message |
---|---|
cbort
Posts: 95
|
Posted 11:17 Jun 02, 2011 |
Ok so yesterday I had said that I would post the cause of the black and white error.ppm that some people seemed to have... ok, soooo.... pretty much this black and white is the result of a poor int to byte conversion... a byte can only handle [-128,127] and we are feeding in an int that is outside of this range causing it to loop back around...
|
Sanaz_6101
Posts: 40
|
Posted 12:04 Jun 02, 2011 |
Thanks Corey for your help. Ill try to see if that would change my result :) |
Sanaz_6101
Posts: 40
|
Posted 12:21 Jun 02, 2011 |
I have no idea why Im getting this ? see my attachment here is my mv.txt:
Target Image Name IDB1/Walk_050.ppm |
cbort
Posts: 95
|
Posted 13:19 Jun 02, 2011 |
Hmm that is pretty strange...
it looks like the area where the moved object used to be is lighter than normal and darker where the object moved too... I haven't had anything really like that though so I cant say for certain... Were you using grayscale or YCbCR conversion on your original? is error.ppm coming from a freshly built image? what is the equation you are using to calculate the error? (it should be a simple subtraction) |
Sanaz_6101
Posts: 40
|
Posted 14:40 Jun 02, 2011 |
No Im not adding to the original image. Also I just computer Y value, should I get CbCr as well ? here is my equation : (error[i][j] -min) * (255 ) / (max - min ) -128 |
cbort
Posts: 95
|
Posted 14:46 Jun 02, 2011 |
I think you may need Cb and Cr but I am not certain... how are you calculating error[ i ] [ j ] |
Sanaz_6101
Posts: 40
|
Posted 14:53 Jun 02, 2011 |
error [i][j] is a difference between best match and target .. my mistake , Im using this equation ( error[i][j]-min) *255 ) / (max-min) and when Im using the other one Ill get something like yours (B/W) |
cbort
Posts: 95
|
Posted 15:16 Jun 02, 2011 |
the correct equation is for Y: ((error[i][j] -min) * (255 ) / (max - min )) -128
if it lookes like
than it is the problem I had mentioned to begin with I think... where is your maping being done ? it should take place for the whole image not each macro block.... |