Notices
Results 1 to 8 of 8

Thread: Why do we need to flip the kernel in 2D convolution?

  1. #1 Why do we need to flip the kernel in 2D convolution? 
    New Member
    Join Date
    May 2013
    Posts
    4
    Why do we need to flip the kernel in 2D convolution in the first place?
    What's the benefit of this?
    So, why can't we leave it unflipped? What kind of terrible thing can happen if you don't flip it?




    SEE:
    "First, flip the kernel, which is the shaded box, in both horizontal and vertical direction"


    songho (place-dot-here) ca/dsp/convolution/convolution2d_example.html


    Reply With Quote  
     

  2.  
     

  3. #2  
    Suspended
    Join Date
    Nov 2012
    Location
    Apocalyptic Paradise
    Posts
    6,613
    Quote Originally Posted by JonMuchnick View Post
    songho (place-dot-here) ca/dsp/convolution/convolution2d_example.html
    For the copy-pastey challenged:Example of 2D Convolution


    Reply With Quote  
     

  4. #3  
    Brassica oleracea Strange's Avatar
    Join Date
    Oct 2011
    Location
    喫茶店
    Posts
    16,538
    Follow the link that says, "The definition of 2D convolution and the method how to convolve in 2D are explained here"

    That explains why.
    Without wishing to overstate my case, everything in the observable universe definitely has its origins in Northamptonshire -- Alan Moore
    Reply With Quote  
     

  5. #4  
    New Member
    Join Date
    May 2013
    Posts
    4
    please explain in detail:

    Notice that the kernel matrix is flipped both horizontal and vertical direction before multiplying the overlapped input data, becausex[0,0] is multiplied by the last sample of impulse response,h[1,1]. And x[2,2] is multiplied by the first sample, h[-1,-1].
    Last edited by JonMuchnick; May 1st, 2013 at 08:41 PM.
    Reply With Quote  
     

  6. #5  
    Brassica oleracea Strange's Avatar
    Join Date
    Oct 2011
    Location
    喫茶店
    Posts
    16,538
    Look at the definition of the convolution function just above that and, in particular, which elements are multiplied by which as a result of that definition. ("For example, x[0, 0] is x[0, 0]δ[m, n], x[1, 2] is x[1, 2]δ[m-1, n-2], and so on.") Work through this by hand and you should see that performing that sequence of operations is equivalent to flipping the kernel.
    Without wishing to overstate my case, everything in the observable universe definitely has its origins in Northamptonshire -- Alan Moore
    Reply With Quote  
     

  7. #6  
    New Member
    Join Date
    May 2013
    Posts
    4
    Quote Originally Posted by Strange View Post
    Look at the definition of the convolution function just above that and, in particular, which elements are multiplied by which as a result of that definition. ("For example, x[0, 0] is x[0, 0]δ[m, n], x[1, 2] is x[1, 2]δ[m-1, n-2], and so on.") Work through this by hand and you should see that performing that sequence of operations is equivalent to flipping the kernel.
    Why do we use convolution for image processing in the first place? Doesn't flipping the kernel all the time, simply take more calculations and make it more complicated than not flipping the kernel each time? So, why did people decide to use convolution (so, to use the flipping by definition) for image processing?
    Reply With Quote  
     

  8. #7  
    Brassica oleracea Strange's Avatar
    Join Date
    Oct 2011
    Location
    喫茶店
    Posts
    16,538
    Quote Originally Posted by JonMuchnick View Post
    Why do we use convolution for image processing in the first place?
    Because it can be used for a large number of filtering and analysis tasks. (But you tell us: you are the one studying them! )

    Doesn't flipping the kernel all the time, simply take more calculations and make it more complicated than not flipping the kernel each time?
    It only ever has to be done once. And moving data around, or just changing the way it is indexed, costs very little compared to the thousands or billions of multiplies and adds that are performed when applying a filter to an image.
    Without wishing to overstate my case, everything in the observable universe definitely has its origins in Northamptonshire -- Alan Moore
    Reply With Quote  
     

  9. #8  
    New Member
    Join Date
    May 2013
    Posts
    4
    Oh, and btw. Didn't the flipping had something to do with the Fourier transforms and the convolution theorem?
    Reply With Quote  
     

Similar Threads

  1. Multi-thread/broken-point resume/mirror download kernel
    By xuanbingyi in forum Computer Science
    Replies: 0
    Last Post: July 1st, 2011, 02:52 AM
  2. How do I start writing a kernel?
    By micman009 in forum Computer Science
    Replies: 2
    Last Post: June 25th, 2011, 04:19 AM
  3. Transition kernel
    By p33rz in forum Mathematics
    Replies: 1
    Last Post: January 20th, 2010, 07:32 AM
  4. flip-flop
    By cdopener in forum Computer Science
    Replies: 1
    Last Post: September 13th, 2006, 01:20 PM
  5. S R Flip Flop
    By RohanSingh in forum Electrical and Electronics
    Replies: 5
    Last Post: July 26th, 2006, 04:29 AM
Bookmarks
Bookmarks
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •