Jame
Jame

Reputation: 3854

How to rotate image in tensorflow with mode edge?

I was used skimage package to rotate an image that has mode edge option

image_rotate = skimage.transform.rotate(image, angle,mode='edge')

mode : {‘constant’, ‘edge’, ‘symmetric’, ‘reflect’, ‘wrap’}, optional Points outside the boundaries of the input are filled according to the given mode. Modes match the behaviour of numpy.pad.

Right now, I am using tensorflow function

tf.contrib.image.rotate(
    images,
    angles,
    interpolation='NEAREST'
)

How can I use tf.contrib.image.rotate to obtain the result as mode='edge' in the skimage package? Thanks

Upvotes: 0

Views: 445

Answers (1)

Akshay Agrawal
Akshay Agrawal

Reputation: 937

tf.contrib.image.rotate does not implement padding. If you'd like to pad your image before rotating it, you'll have to do that yourself using tensorflow operations.

Upvotes: 2

Related Questions