question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Customized output size for cupyx.scipy.ndimage.affine_transform~

See original GitHub issue

Hi Guys, Thx for open sourced cupy, I was trying to use its builtin api to replace cv2.resize as stated above, but the execution reported ValueError: total size of new array must be unchanged, is the argument output_shape just a placeholder to keep it consistent with scipy API or there are tricks to get it work? THX!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
not522commented, Feb 5, 2019

Sorry for late reply. I think always zoom is recommended for resizing. Both are very similar but slightly different for interpolation.

a = np.asarray([[1, 3, 5, 7]], dtype=np.float32)
M = np.asarray([[0.5, 0, 0], [0, 1, 0]])
print(cv2.resize(a, dsize=(2, 1)))
print(cv2.warpAffine(a, M, dsize=(2, 1)))
[[2. 6.]]
[[1. 5.]]
1reaction
okutacommented, Dec 27, 2018

Can you send your test code or/and long exception result?

Read more comments on GitHub >

github_iconTop Results From Across the Web

cupyx.scipy.ndimage.affine_transform — CuPy 11.4.0 ...
Apply an affine transformation. Given an output image pixel index vector o , the pixel value is determined from the input image at...
Read more >
scipy.ndimage.affine_transform — SciPy v1.9.3 Manual
Apply an affine transformation. Given an output image pixel index vector o , the pixel value is determined from the input image at...
Read more >
python - Padding scipy affine_transform output to show non ...
I am already able to calculate the Affine Transformation rotation and offset matrix, which I feed to scipy.ndimage.interpolate.affine_transform ...
Read more >
Untitled
id card size in cm philippines ... The Python OpenCV library cv2 provides a cv2.resize() function to resize an image. import cv2 import...
Read more >
Untitled
warpAffine (0) 2022.02.02 [OpenCV with Python] 영상기하학적변환: 이동변환- cv2. ... palram palermo gazebo 14x14; plus size clothing warehouse. Syntax: cv2.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found