Ask Your Question
0

sobel operators in simplecv-js

asked 2013-04-22 07:51:07 -0500

chaithuzz2 gravatar image

hi there, i have been working on simplecv-js . i am trying to program a canny edge detector for simplecv-js. i used the sobel operators for calculating gradients in x and y directions . i used it like this

 grayIm = @grayscale() // grayscale image to reduce calculations
 blurIm = grayIm.blur() // smoothing the image to reduce noise
 ximg   = blurIm.sobelX() // gradients in x-direction
 yimg   = blurIm.sobelY() // gradients in y-direction
 xv     = ximg.getArray() 
 yv     = yimg.getArray()

i used xv.data and yv.data to calculate the edge strengths and edge directions. and i did non maximum suppression after that and hysterisis thresholding. i got the output and strong edges are visible but there are also many unwanted edge points. and when i checked the values of xv and yv .they are all positive. there are no negative values. does the sobel operators return all positive gradient values. if this is the case , then what can i do to get negative values also, please help me.

thanks in advance

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2013-04-22 15:44:51 -0500

kscottz gravatar image

My guess is that the sobel values are actually returning the absolute value of the sobel kernel. You are aware that there is already an edges function in SimpleCV.js right?

edit flag offensive delete link more
0

answered 2013-04-22 21:45:31 -0500

chaithuzz2 gravatar image

hi kscottz, yes i know that there is already an edges method. but there was a feature request saying "add canny edge detector" so i thought i could try that.

thankyou

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2013-04-22 07:51:07 -0500

Seen: 196 times

Last updated: Apr 22 '13