easy image filter question

Posted on 2004-11-12
Last Modified: 2010-04-15

I'm implementing the Sobel Edge Detector image filter. I don't need help with writing the actual code for the filter. The filter is supposed to multiply each pixel by two convolution masks , where do the values for these masks come from? I can't find any explanations on this online. Here is an explanation of the filter:

 If anyone is familiar with it or can look at it and tell me what the values for the masks should be that would be excellent, thanks.
Question by:Already_Googled
    LVL 22

    Expert Comment

    The masks are right there in the article!

    ( The grids with the -1, 0, +2, etc...  numbers )


    Author Comment

    Do you mean those values are the literal values to multiply by? That couldn't be it, the net result would always be zero!

    An example, pixel value = 50:

    -1 * 50 = -50;
     0 * 50 =    0;
     1 * 50 -   50;
    -2 * 50 = -100;
     0 * 50 = 0;
     2 * 50 = 100;
    -1 * 50 = -50;
     0 * 50 =    0;
     1 * 50 -   50;    +

    same for the other mask.
    LVL 22

    Accepted Solution

    No no no, you don't multiply the same pixel by all the values, you multiply the corresponding surrounding pixel by that value.


    Author Comment

    oh that's it, thanks.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    This tutorial is posted by Aaron Wojnowski, administrator at  To view more iPhone tutorials, visit This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
    Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
    The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.
    The goal of this video is to provide viewers with basic examples to understand and use switch statements in the C programming language.

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now