HELP WITH BILINEAR INTERPOLATION???
-
I am trying to Write a MATLAB code to scale the input image of 256x256 to a smaller image of 160x160 using the bilinear interpolation, the idea behind it is to compare it with the image resulted from the function imresize, Can anybody give me a detailed algorithm(preferably a pseudo code) on how to approach that. I already have some links but they are so poorly commented that I get easily lost. Any Help will be highly appreciated.
-
I am trying to Write a MATLAB code to scale the input image of 256x256 to a smaller image of 160x160 using the bilinear interpolation, the idea behind it is to compare it with the image resulted from the function imresize, Can anybody give me a detailed algorithm(preferably a pseudo code) on how to approach that. I already have some links but they are so poorly commented that I get easily lost. Any Help will be highly appreciated.
Hi, this[^] seems pretty straightforward. What is the problem? For all kinds of transformations, walk the new coordinate system, find the location in the old coordinate system, and apply the transformation, hence:
foreach yy in new coordinates
calculate y in old coordinates
round to neighbours y1 and y2
foreach xx in new coordinates
calculate x in old coordinates
round to neighbours x1 and x2
apply bilinear formulas
store result at (xx,yy)
next
next:)
Luc Pattyn
Local announcement (Antwerp region): Lange Wapper? Neen!
-
Hi, this[^] seems pretty straightforward. What is the problem? For all kinds of transformations, walk the new coordinate system, find the location in the old coordinate system, and apply the transformation, hence:
foreach yy in new coordinates
calculate y in old coordinates
round to neighbours y1 and y2
foreach xx in new coordinates
calculate x in old coordinates
round to neighbours x1 and x2
apply bilinear formulas
store result at (xx,yy)
next
next:)
Luc Pattyn
Local announcement (Antwerp region): Lange Wapper? Neen!
Do you have an idea how to do it in matlab, I am pretty new at that language and I need to program it in matlab, also I don't think it's that simple, the purpose is for image resizing, so basically it will be applied on a Matrix(not that it changes anything).
-
Do you have an idea how to do it in matlab, I am pretty new at that language and I need to program it in matlab, also I don't think it's that simple, the purpose is for image resizing, so basically it will be applied on a Matrix(not that it changes anything).
I gave you the pseudo-code you asked for. For Matlab, see its documentation, and/or Google. :)
Luc Pattyn
Local announcement (Antwerp region): Lange Wapper? Neen!
-
Do you have an idea how to do it in matlab, I am pretty new at that language and I need to program it in matlab, also I don't think it's that simple, the purpose is for image resizing, so basically it will be applied on a Matrix(not that it changes anything).
Something I usually will do when using matlab is to first implement my algorithm to be computed sequentially, like I would in C and then move to the matrix form. It executes far more slowly, but with the data sizes you're talking about it won't matter.