'**********************initmask() subroutine************************* ' ' purpose: initialize the masks used by sobel() giving adjacent ' pixels the appropriate "weight" ' ' input: none ' ' output: two matrices defining the weights to be used on adjacent ' pixels when finding the sobel data ' ' note: increasing the values in the masks will increase the ' sensitivity of sobel...however, for the most part this ' simply means more "noise" rather than better defined edges ' also: the numbers have to stay relatively small because of the ' sobel computations-->the bigger the multiplier in the matrix ' the higher the results are on average, meaning more pixels ' are black more often (hence the noise issue) ' '******************************************************************** Sub initmask() ' -1 0 1 ' -2 0 2 ' -1 0 1 xmask(1, 1) = -1 xmask(1, 2) = 0 xmask(1, 3) = 1 xmask(2, 1) = -2 xmask(2, 2) = 0 xmask(2, 3) = 2 xmask(3, 1) = -1 xmask(3, 2) = 0 xmask(3, 3) = 1 ' 1 2 1 ' 0 0 0 ' -1 -2 -1 ymask(1, 1) = 1 ymask(1, 2) = 2 ymask(1, 3) = 1 ymask(2, 1) = 0 ymask(2, 2) = 0 ymask(2, 3) = 0 ymask(3, 1) = -1 ymask(3, 2) = -2 ymask(3, 3) = -1 End Sub