I have two images below :
Image1:
Image2:
I want to crop Image2
in the same manner as Image1
. So if I read all the document of my folder then script should automatically crop the image in the same manner as in Image1
.
I am using the below code for cropping.
image = cv2.imread(path+'passport3.jpg')
y=280
x=0
h=373
w=546
crop = image[y:y+h, x:x+w]
cv2.imshow('Image', crop)
cv2.waitKey(0)
However If I crop another image then this script does not work there.For example if I run the above script for below image then I am getting unexpected output :
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…