Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Algorithms
  4. HELP WITH BILINEAR INTERPOLATION???

HELP WITH BILINEAR INTERPOLATION???

Scheduled Pinned Locked Moved Algorithms
algorithmshelptutorialquestion
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    rainasu
    wrote on last edited by
    #1

    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.

    L 1 Reply Last reply
    0
    • R rainasu

      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.

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #2

      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!


      R 1 Reply Last reply
      0
      • L Luc Pattyn

        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!


        R Offline
        R Offline
        rainasu
        wrote on last edited by
        #3

        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).

        L T 2 Replies Last reply
        0
        • R rainasu

          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).

          L Offline
          L Offline
          Luc Pattyn
          wrote on last edited by
          #4

          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!


          1 Reply Last reply
          0
          • R rainasu

            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).

            T Offline
            T Offline
            thebeekeeper
            wrote on last edited by
            #5

            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.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups