LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Gx and Gy value of Sobel Filter

Hi,
 
I'm having problem in producing the Gx and Gy value of the Sobel filter. Attached is my block diagram. I'm applying the Gx and Gy separately to the image and I'm trying to display the edges of a block diagram. From what i know, the Gx should display the vertical lines of the image and Gy should display the horizontal line of the image. I just get the east line and the north line instead of both east and west vertical lines (for Gx) and both north and south horizontal lines for Gy.
 
I also attached the result of the same image using the Sobel vi in the Labview. The result shows all vertical and horizontal edges of the image. I need to find the gradient of the image, hence I can't to use the Sobel vi provided in the LAbview.
 
Can someone please help me, as my program could not function properly if the gx and gy couldn't show all the vertical and horizontal edges.
 
Thank you very much.
 
0 Kudos
Message 1 of 2
(3,993 Views)

First, i have to apologize because this answer may not be complete since I am not familiar with the functions/subVIs you use. Are they part of IMAQ or IVision? If not, where are they located?

I think the problem your'e having is your not looking at the absolute values of Gx and Gy. The Sobel.vi (again, I don't know where this VI is, if you would let me know I would appreciate it!) is showing the magnitude of the gradient vector. Ususally this is approximated by |G| = |Gx| + |Gy|. Basically, the edge that you are not seeing is a negative value (-255). When viewing it, Labview apparently sets that pixel to the lowest number, 0, which corresponds to the black. By making it absolute values, these will show up as white.

Michael

0 Kudos
Message 2 of 2
(3,925 Views)