Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6600105
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:34:42+00:00 2026-05-25T18:34:42+00:00

I study convolution in image processing as it is a part of the curriculum,

  • 0

I study convolution in image processing as it is a part of the curriculum, I understand the theory and the formula but I am confused about its implementation.

The formula is:


enter image description here


What I understand

The convolution kernel is flipped both horizontally and vertically then the values in the kernel are multiplied by the corresponding pixel values, the results are summed, divided by “row x column” to get the average, and then finally this result is the value of the pixel at the center of the kernel location.

Confusion in implementation

When I run the example convolution program from my course material and insert as input a 3×3 convolution kernel where:

1st row: (0, 1, 0)

2nd row: (0, 0, 0)

3rd row: (0, 0, 0)

The processed image is shifted down by one pixel, where I expected it to shift upwards by one pixel. This result indicates that no horizontal or vertical flipping is done before calculating (as if it is doing correlation).

I thought there might be a fault in the program so I looked around and found that Adobe Flex 3 and Gimp are doing this as well.

I don’t understand, is there something that I missed to notice?

Appreciate any help or feedback.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T18:34:44+00:00Added an answer on May 25, 2026 at 6:34 pm

    I guess the programs you tried implement correlation instead of convolution.

    I’ve tried your filter in Mathematica using the ImageFilter function, the result is shifted upwards as expected:

    enter image description here

    result:

    enter image description here

    I’ve also tried it in Octave (an open source Matlab clone):

    imfilter([1,1,1,1,1;
              2,2,2,2,2;
              3,3,3,3,3;
              4,4,4,4,4;
              5,5,5,5,5],
             [0,1,0;
              0,0,0;
              0,0,0],"conv")
    

    (“conv” means convolution – imfilter‘s default is correlation). Result:

       2   2   2   2   2
       3   3   3   3   3
       4   4   4   4   4
       5   5   5   5   5
       0   0   0   0   0
    

    Note that the last row is different. That’s because different implementations use different padding (by default). Mathematica uses constant padding for ImageConvolve, no padding for ListConvolve. Octave’s imfilter uses zero padding.

    Also note that (as belisarius mentioned) the result of a convolution can be smaller, same size or larger than the source image. (I’ve read the terms “valid”, “same size” and “full” convolution in the Matlab and IPPI documentation, but I’m not sure if that’s standard terminology). The idea is that the summation can either be performed

    • only over the source image pixels where the kernel is completely inside the image. In that case, the result is smaller than the source image.
    • over every source pixel. In that case, the result has the same size as the source image. This requires padding at the borders
    • over every pixel where any part of the kernel is inside the source image. In that case, the result image is larger than the source image. This also requires padding at the borders.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When you study relational theory foreign keys are mandatory. But in practice, in every
I am starting study java2me. But I have some source study about it like
I like to study languages outside my comfort zone, but I've had a hard
When I study about cloud-computing, I usually see these terms: on-premise, off-premise applications. I
I'm study about NSNotificationCenter. Here is my code Observer.m //note init method is not
I just begin to study ARM assembly language, and am not clear about how
Currently in study of spring framework. I hope i can understand it properly and
I'm up to study about creating WP Plug in and so I read this
i'm trying to study about how to access external web services. I have created
This is from my study guide. From my perspective this is almost done but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.