Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

crop image using opencv with height and width

import cv2
import numpy as np
try:
    from PIL import Image
except ImportError:
    import Image

img_file = '/home/test_crop.jpg'

im = Image.open(img_file).convert('L')
im = im.crop((55, 563, 1603, 975))
im.save('_0defects.jpg')
 
PREVIOUS NEXT
Tagged: #crop #image #opencv #height #width
ADD COMMENT
Topic
Name
3+5 =