Bilinear interpolation article referenced in another language

I’m thrilled. I’m also confused. I wrote an article on bilinear interpolation, specifically for image rotations, and it was provided as a link in a comment to this post. Thanks to vottini for referencing my article (it was used in a good light, right?)

I’ve got a problem. I don’t know what’s the language of the site! I think it’s French or Spanish, but I can’t be sure. If you know what’s the language, please let me know. Better yet, translate and summarise that article and tell me, because I only understood it as a example of how to expand an image and fill in the extra pixels. Thanks.

UPDATE: Thanks to an anonymous commentor, I finally found that the article (and site) is in Portuguese. I tried online translation tools and Portuguese-English yielded enough for me to understand what was going on. The commentor recommended the tool by Google, but I got barred with “automated request” error.

So I used the Babel Fish.

Excerpt of translated comment:

the solution, after all, was well simple. Instead of rotacionar pixels of the source, it rotacionava pixels of the destination and discovered in which place of the source would go to be. Joining with the technique of the bilinear interpolation or some most advanced one, the result is really impressive.

In the article, I suggested starting from the destination image, and find out what pixels to use from the source. This sort of assumes that both source and destination speak the same “language” (both are talking about RGB pixels).

The irony? In this incident, I don’t know anything about the source language (Portuguese), so I don’t know how to start from the destination (translated article in English).

UPDATE: Actually Christopher also commented that it’s in Portuguese (missed his comment in the diligent black hole SPAM processor…). Thanks Christopher!

And the owner of the site came to confirm that it’s in Portuguese! Wow. He (“o velho” means “old man” in Portuguese) apparently posted an English post about this, specially for me. Wow. Thanks.

  1. O Velho

    Hi Vincent!

    I’m the owner of the and I can get you in touch with the author of the post, if you want. Just drop me a message. By the way, the language is Portuguese.


    O Velho (means “old man”) 🙂

  2. Peter P. Lupo

    Here is the translation:
    # Y to X scale change coeficient:
    cm <- (m’-1)/(m-1) # vertically
    cn <- (n’-1)/(n-1) # horizontally

    from i to 0 step m-1
    from j to 0 step n-1
    # pair (i,j) mapping from Y to (i’,j’) in X
    i’ <- round(i*cm) # scale and rounding (from i to i’)
    j’ <- round(j*cn) # scale and rounding (from j to j’)
    Y(i,j) <- X(i’,j’)
    The post at Velho’s was based on this article:

  3. Vincent Tan

    Thanks for translating that, Peter. The funny thing is, I could roughly follow the code itself, but I’m totally lost on the comments… *smile* Ahhh, now it makes sense.

  4. vottini

    Hello Vincent!

    It was indeed used in a good light! I’m a student very interested on image manipulation and I was confused about the rotation of pixels, the use of sines and cosines and the float coordinates that would naturally arise from those operations. Your article explained it in a very neat way to me and I linked it to dectoplate’s entry, as I had thought on several dark ways to do that but the answer was quite simple.

    As I didn’t have done this yet, thank you very much for the explanation! =)

Comments are closed.