Crop image to bounding box in Tensorflow Object Detection API

前端 未结 1 598
谎友^
谎友^ 2021-02-06 04:55

How can I crop an image to the bounding box in Tensorflow? I am using the Python API.

From the documentation,

tf.image.crop_to_bounding_box(image, offset         


        
1条回答
  •  礼貌的吻别
    2021-02-06 05:12

    Since we consider x as horizontal and y as vertical, following would crop the image with specified box.

    cropped_image = tf.image.crop_to_bounding_box(image, yminn, xminn, 
                                           ymaxx - yminn, xmaxx - xminn)
    

    0 讨论(0)
提交回复
热议问题