Is there any convolution
method in Tensorflow to apply a Sobel filter to an image img
(tensor of type float32
and rank 2)?
sobel_x = tf.constant([[-1, 0, 1], [-2, 0, 2], [-1, 0, 1]], 'float32')
result = tf.convolution(img, sobel_x) # <== TO DO THIS
I've already seen tf.nn.conv2d
but I can't see how to use it for this operation. Is there some way to use tf.nn.conv2d
to solve my problem?