Search
 
SCRIPT & CODE EXAMPLE
 

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')
Comment

PREVIOUS NEXT
Code Example
Python :: reorder columns in python 
Python :: transpose 3d matrix pytorch 
Python :: delete csr python 
Python :: pandas return indices that match 
Python :: is not and != difference in python 
Python :: make a coo_matrix 
Python :: Optimize images in python using pillow 
Python :: initiate dask 
Python :: python open file partially 
Python :: how to add sum of range in python 
Python :: least square fit straight line python 
Python :: qaction hide show python 
Python :: remove punctuation in dataframe column 
Python :: how to resume request downloads 
Python :: how to sum 2 no.s in python 
Python :: python pass function as argument 
Python :: python wikipedia 
Python :: recursionerror maximum recursion depth exceeded in comparison 
Python :: re.split 
Python :: matplotlib show image black and white 
Python :: dataframe 
Python :: python call function in the same class 
Python :: how to plot using pyplot 
Python :: list comprehension python 
Python :: python range of array 
Python :: python button click code 
Python :: how to make capitalize text in python 
Python :: If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of all the multiples of 3 or 5 below 1000. 
Python :: how to create a subset of a dataframe in python 
Python :: lists in python 
ADD CONTENT
Topic
Content
Source link
Name
2+1 =