Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Halp me /prog/ramming experts

Name: Unpronounceable name !!MWEigYY65E5W1Ia 2009-05-25 11:54

So I'm working with uncompressed images in C++...
Can anyone write a piece of pseudo code to demonstrate how a horizontal Sobel filter or vertical sobel filter is supposed to work?

Name: Unpronounceable name !!MWEigYY65E5W1Ia 2009-05-25 11:55


Let me give it a try for a horizontal Sobel filter:

//for each row in the image:
//for each column in the image:
//for each channel in a pixel:
//use the
+1 +2 + 1
+0 +0 +0
-1 -2 -1 operator
//and store the result in a new image using +=
//close all for-statements

Ofcourse this doesn't give me the desired result ;_;

Name: Anonymous 2009-05-25 11:57

Try Google. I hear he knows everything, and readily answers your stupid questions without even as much as a snappy remark.

Name: Unpronounceable name !!MWEigYY65E5W1Ia 2009-05-25 12:00

I obviously already tried searching for it on the internet but the only results I get are Sobel filters using both the horizontal AND vertical line detection.

Name: Anonymous 2009-05-25 12:05

pic = import_picture(argc);
filtered = sobel(pic, "horizontal");

Vertical is left as an exercise to the reader.

Name: Unpronounceable name !!MWEigYY65E5W1Ia 2009-05-25 12:09

>>5
Thanks bro!

Now where is "Image sobel(Image &img, string str)" defined?

Any open source libraries?

Name: Anonymous 2009-05-25 12:22

for x ← 0 to width
    for y ← 0 to height
        dest[x,y] = src[x-1,y-1] + 2 * src[x,y-1] + src[x+1,y-1] - src[x-1,y+1] - 2 * src[x,y+1] - src[x+1,y+1]

Name: Unpronounceable name !!MWEigYY65E5W1Ia 2009-05-25 14:00

>>7
This is what I've been doing but I just realised I have to convert it to greyscale first.

Thanks for the help /prog/ <3 BROLOVE

Name: Anonymous 2010-11-13 21:21

Name: Anonymous 2010-11-14 18:46

Name: Anonymous 2010-12-17 1:39

Erika once told me that Xarn is a bad boyfriend

Name: Anonymous 2011-02-02 22:54

Don't change these.
Name: Email:
Entire Thread Thread List