I am developing commercial software for reading images and finding region of interest by passing top left corner coordinates and bottom right coordinates of rectangle then crop the image.Some client provides samples like 100 dpi, 200 dpi or 400 dpi images of same image. Because these kind of images, my coordinates lie somewhere else. How can i fix a problem to find actual area of interest for different dpi of images and find exact ROI? Give some rough idea to solve it.
first = [1025,1000]
last = [1550,1400]
image = cv2.imread("db/SGBAU/pink OMR/200.jpg")
def ROI_extract(first_corner,last_corner,image):
#croping ROI
ROI_img = image[first_corner[1]:last_corner[1],first_corner[0]:last_corner[0]]
cv2.imwrite(os.path.join('db/','ROI.png'), ROI_img)
return ROI_img