TrickyDicky
Advanced Member level 7
it sounds like you dont quite know whats going on.
With A B and C being images, I still dont know what you're doing. The returned value will be another image D. Usually, the co-effiencient you're talking about are used in the convolution of the input, so:
Output = (Co-eff Maxtrix) x (Small part of input image.)
To do an entire convolution (ie. to get the output) you need to run the co-eff matrix over the entire image. You cannot do this with an even sized co-efficient matrix (2x2, 4x4 etc) otherwise you introduce a 0.5 pixel shift in the output. You then have to consider what you do at the edges when the co-eff matrix spills over the edge (do you zero pad or do you spread the source image?)
So, lets go back to the start. What is your origional algorithm? Do you have it defined in matlab or simulink?
With A B and C being images, I still dont know what you're doing. The returned value will be another image D. Usually, the co-effiencient you're talking about are used in the convolution of the input, so:
Output = (Co-eff Maxtrix) x (Small part of input image.)
To do an entire convolution (ie. to get the output) you need to run the co-eff matrix over the entire image. You cannot do this with an even sized co-efficient matrix (2x2, 4x4 etc) otherwise you introduce a 0.5 pixel shift in the output. You then have to consider what you do at the edges when the co-eff matrix spills over the edge (do you zero pad or do you spread the source image?)
So, lets go back to the start. What is your origional algorithm? Do you have it defined in matlab or simulink?