Opencv cropping python -


https://snag.gy/dodzbc.jpg

first: have image want adjust resolution of set resolution desired scale ratio around head..

currently have going

widtho, heighto = image.shape[:2] ## original width , height image = cv2.resize(image,(2170, 2894), interpolation = cv2.inter_area) new_dimensionx = heighto * 631 / ((pointofeight)  - (pointofinterestx)) new_dimensiony = widtho * 631 / ((pointofeight) - (pointofinterestx )) image = cv2.resize(image,(int(new_dimensionx), int(new_dimensiony)) 

i need head height of 631. i'd maintain 2170,2894 size on last calculation. help?

also, on note. once occurs, can calculate 3 dots. , want center image based on middle dot such nose have straight line going vertically through @ center.

this attempt:

rx = new_dimensionx / heighto ry = new_dimensiony / widtho crop_img = crop_img[0:2894,  int((pointofnose  - 2170/2) * ry):int(pointofnose  + 2170/2 * ry)] 


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -