StarkEffects.com

Concise Articles on Science, Math & Technology

Welcome to the Sobel Operator page at StarkEffects.com!

If you have ever wondered how to easily get an outline from an image, such as a photograph or even a live camera feed, this article describes a simple process using the Sobel operator. With this method you can take a photo and quickly draw just the outlines of the objects in the photo. This is a commonly used image processing operation that allows machines to find information that your brain automatically picks out, or sometimes the machine can even cut through clutter that your brain won't.

Google
 
Web www.starkeffects.com
Articles by Subject Category

Enter your email address to subscribe to the StarkEffects NewsLetter.


Troy Stark's Science & Society Opinion Blog


My Linked In Profile -


Physics Consulting Services: Advance your business or product development with these Experienced, professional physicists, engineers & entrepreneurs.

My new consulting firm- Rock West Solutions, where I join some of the best problem solvers in the world!


Apple Store

Now you can put a face with the name. This is the guy that runs this website. All the errors are his fault.


$18M in Clickbank Secrets -Click Here $18M in Affiliate Secrets!

Become a content Contributor to the StarkEffects website! Improve the quality of content on the web. Contribute puzzles, articles, humor, diagrams or photos.
TELL ME MORE Free 2nd Day Shipping

Buy a Tiny Wireless Video Camera & get a FREE Bonus

Get a Robot to do your work for you!
Click Here! to get all your Google ads for free!



Learning to Speed Read shouldn't take all day! This 16 minute speed reading course is effective and efficient. Double your reading speed and improve your comprehension in 16 minutes. Click Here!


If you want to buy me a gift, this is what I want! Amazon's Kindle: 200 books in a package smaller than a laptop. Buy the books online and pay less than $10. Save Money and Shelf Space! For Amazon's Kindle, click here!
If you are serious about home safety, or you just want to know what is going on in your lab- this is the solution: Click Here for affordable home surveillance and control systems




MidiWav Recorder converts MIDI files to Wave, MP3 and WMA files. You can record to Wave, do MIDI playback only or mix it with Microphone input. Midi2Wav self-adjusts sound card mixer. You can even convert multiple files in batch mode. Midi2Wav is also a full-feature MIDI and Wave player.
Click Here! for the easiest way to make wav files from your midi compositions!


Music Composer, music recognition software. Composer recognizes polyphonic music from a microphone or other Wave input or file and converts it into Midi sequences. You can sing, whistle or play guitar, piano, flute and so on with your microphone, Composer will automatically recognize and score your music and create standard Midi sequences. No Midi keyboard or musical experience required.
Click Here! to compose music with just your microphone!


AKoff Guitar Assistant designed to assist in visual tuning a guitar with microphone or an electrical guitar connected to PCs sound card. It analyzes in real time a stream of audio signals from WAVE input of your sound card and calculates the main frequency. This frequency is shown by a pointer on graphic guitar signature stamp (frets), comparing it to the proper frequency. Tuning a string now simply means centering the pointer on the appropriate graphic fret.
Click Here! for graphical assistance tuning your guitar/violin/viola/cello/etc.... on your computer!


affiliate_link

The Sobel Operator used in image processing


The image above is the result of using the edge finding operator on the black and white image below. This happens to be sunset at El Capitan beach which is right on my way home from work every day. Unfortunately, I can't take credit for getting the photo, since I stole it from a web search for sunsets.


Below is the original image in color:


Here is how this edge finding operator works. Essentially, the operator is a discrete differentiation operator which means that if images were completely continuous, as we imagine them to be in nature, you would be finding the edges in an image by taking a derivative in two dimensions, or the gradient as it is called, which gives you the rate of change of intensity in the image and the direction of greatest change. Anywhere that a discontinuity occurred in the image, you would get a large signal in the derivative. Since the images that we normally work with on a computer are stored in discrete pieces called pixels we have to use a discrete form of the derivative.

We begin by looking at our image as a matrix. To simplify things a bit we will assume our image is black and white -or rather, shades of grey- which we can get for any image by averaging the three different values of intensity, each one representing the intensity of a component color, to get a simple two dimensional matrix where each value in the matrix represents the grey-scale intensity for one pixel in the image.

Now, if we take this 2-D matrix where each value in the matrix represents an intensity (usually a number from 0 which is black, to a maximum of 255 which is white) and we display it we get a typical black and white image like:


M =

If we call our matrix M, then each pixel can be indicated by 2 indices representing the number of pixels from the top left corner with the first index representing how many pixels in the vertical direction down from that corner and the second index representing how many pixels to the right from that corner. We will use the indices, j and i with j giving us our vertical index and i giving us our horizontal index. In our case we have the horizontal values, i, running from 1 to 500 with our vertical values running from 1 to 375. So, any intensity value is indicated by the number assigned to a matrix value.

The Sobel operator consists of two more 2-D matrices, each one is only a 3 ˣ 3 matrix:

  and  

Finding the gradient in our image can be done for every point in the image as long as it has all eight neighbors. The gradient values form a new matrix which is the convolution of these two 3 ˣ 3 matrices with the image so that the matrix representing the gradient values is given by:

  where     and  

And the matrix representing the direction of the gradient (Which I don't actually use in this article) is given by:

To show you a little more specifically the way I do the convolution and get the gradient values in a form that I can display showing the outlines, I'll write down the same information as above only using the index notation that I normally work with when telling the computer what to do.

  and  
  and  

So that I get the value for each element of my gradient matrix from:

Now I have the magnitude of the gradient corresponding to each point (pixel) in my image. In order to display this set of values, which turns out to dramtically show the outlines of objects in the image, I have to scale this gradient matrix to fit a grey scale image. To do this I just multiply each value by the maximum grey scale (254 is what I usually use) and divide by the maximum value in the gradient matrix. This way, I get a very high value for places in the image where the intensity was changing rapidly as you find at an edge of an object.

This is a fun operator to apply to pictures of your friends. It is almost as much fun as applying fourier optics transforms and filters, which I'll have to show you in another article.

Comments from Our Readers

Comment Box Free
Comments, Suggestions, Criticisms and Complaints Welcome: Webmaster at Stark Effects
Related Info & Products

Get this wonderful home study course on human anatomy in 3-D on your computer before the price goes up!.

Phases of the Moon. Sophisticated Software for calculating the phases of the moon and a host of other lunar info.


Click Here! for Great Science Fair Project Ideas.



StarkEffects, Only The Best!
Google
 
Web www.starkeffects.com
© Copyright 2006  StarkEffects, All Rights Reserved
The SiteMap   Privacy Policy   Contact Us