opencv / opencv/opencv-python

Alternative to cv2.warpPerspective

Aperta
#549 8 commenti 0 reazioni 1 assegnatario Vedi su GitHub

@AleksandrPanov ci sta già lavorando.

Dal 8/10/2021.

Lingua principale
Python
Stelle
5.4k
Fork
1k
Merge medio
22h 17m
PR unite (30g)
3

Descrizione

Expected behaviour

I use OpenCV to register bio-medical images, but these images are really big.

I'm able to extract features and compute the homography H, and then I use cv2.warpPerspective to compute the final image.

warped_img = cv2.warpPerspective(image, H, (width, height), borderMode=cv2.BORDER_CONSTANT, borderValue=0)
Actual behaviour

But when width or height is bigger than 32767, then I get the following error.

cv2.error: OpenCV(4.5.1) /tmp/pip-req-build-s8zh4qlk/opencv/modules/imgproc/src/imgwarp.cpp:1724: error: (-215:Assertion failed) dst.cols < SHRT_MAX && dst.rows < SHRT_MAX && src.cols < SHRT_MAX && src.rows < SHRT_MAX in function 'remap'

I took a look online, and I found out that is a hard limitation because of the short encoding used to improve warpPerspective .

Is there a workaround to lift such limitation?
If no, is there a solution using another library to replace cv2.warpPerspective?

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.