cv2.applyColorMap got different result shape between 4.x and 5.x
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 55/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- opencv, python
- Domain
- computer-vision
Research direction
Start by running the provided cv2.applyColorMap snippet with the reported opencv-python 4.x and 5.x versions, then inspect the package or upstream entry point responsible for this behavior. Compare the resulting shape against existing tests or project guidance; done means the version difference is resolved or its intended behavior is clearly documented with regression coverage.
Written by the indexing model from the issue text.
Description
import numpy as np
import cv2
colors = cv2.applyColorMap(np.array([0, 63, 127, 191, 255], dtype=np.uint8), cv2.COLORMAP_PARULA)
print('shape', colors.shape)
opencv-python 4.x got shape (5, 1, 3)
# pip list | grep -e cv -e numpy
numpy 2.4.6
opencv-python 4.13.0.92
Python version 3.11.9
opencv-python 5.x got shape (1, 5, 3)
# pip list | grep -e cv -e numpy
numpy 2.4.6
opencv-python 5.0.0.93
Python version 3.11.9
- Dominant language
- Python
- Stars
- 5.4k
- Forks
- 1k
- Avg merge
- 22h 17m
- Merged PRs (30d)
- 3
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from opencv/opencv-python
-
[DOC] README file Open
Difficulty 1/5 Under an hour Newbie friendliness 85/100
opencv/opencv-python#1217 · 3 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
opencv/opencv-python#1165 · 2 comments · 1 reaction ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
opencv/opencv-python#1273 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
opencv/opencv-python#1272 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 70/100
opencv/opencv-python#1268 · 1 comment ·
All issues in opencv/opencv-python
Similar issues
-
bug confirmed issue
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
open-webui/open-webui#30750 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
OpenwaterHealth/openmotion-bloodflow-app#604 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
good first issue
Difficulty 1/5 Under an hour Newbie friendliness 90/100