writing my own sobel filter convolution - something is wrong


Posted on 16th Feb 2014 07:03 pm by admin

I am trying to keep it very simple, I cant see anything wrong with my logic, could anybody help point me to the right direction?!!


Did you know?Explore Trending and Topic pages for more stories like this.
Code: { int Shorizontal[] = {-1, 0, 1, -2, 0, 2, -1, 0, 1}; int Svertical[] = {1, 2, 1, 0, 0, 0, -1, -2, -1}; for (int x = 0; x < image.dimx(); x++) for (int y = 0; y < image.dimy(); y++) for (int c = 0; c < 3; c++) // loop through colour channels { int counter = 0; float tempH = 0; float tempV = 0; for (int a = -1; a <= 1; a++) for (int b = -1; b <= 1; b++) if (x + a >= 0 && x + a <= image.dimx() && y + b >= 0 && y + b <= image.dimy()) { tempH += image(x + a,y + b,0, c) * Shorizontal[counter]; tempV += image(x + a,y + b,0, c) * Svertical[counter]; counter++; } image(x,y,0,c) = sqrt(pow(tempH,2) + pow(tempV,2)); } }
No comments posted yet

Your Answer:

Login to answer
291 Like 22 Dislike
Previous forums Next forums
Other forums

Schedule editor
Hi,

I have a question related to Schedule editor.
If we schedule a BLS for every 30

How to know if online site made with PHP
Hello,
I see some sites that does not display extensions at all , for example:

www.site.co

Port scanner problem
Hai
recently i developed one app through which u can check the opened and closed ports under an

1,000 select boxes with 100 options?!
I have 1 drop down select box with 1,000 options.


In some case, there will be 100+ of the

Xacute search within SQL results
I have a query that is pulling data, and I want to return a specific value from the results of that

Firefox displaying PHP source code??
Currently testing a site thats almost built, am going to be including php on a sidebar on all pages

Why is my row count 0?
Here's the MySQL query i'm running. It basically pulls data from 2 tables based on some data passed.

help finding hacking loopholes
i was attacked by a redirect php injection

my pc is clean of viruses

so i figure that

UPLOAD IMAGES NOT WORKING!
Hi there i have a upload script in which it uploads the picture to a folder than creates two thumbna

Had a simple form script that suddenly stopped working
It was made about a year ago and had been working fine. Last time it was known to work for sure was

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash