Skip to content

cv2.cvtColor does not work with single pixel in 4.5.4.58 #575

@froanas

Description

@froanas

Expected behaviour

cv2.cvtColor should be able to convert a single pixel's color as it does in version 4.5.3.56

Actual behaviour

Traceback (most recent call last):
  File "raw_tester.py", line 23, in <module>
    npimg = cv2.cvtColor(pixel, cv2.COLOR_RGB2BGR)
cv2.error: OpenCV(4.5.4-dev) D:\a\opencv-python\opencv-python\opencv\modules\core\src\matrix.cpp:466: error: (-215:Assertion failed) _step >= minstep in function 'cv::Mat::Mat'

Steps to reproduce

import cv2
import numpy as np

pixel = np.uint8([[[40, 50, 200]]])
new_pixel = cv2.cvtColor(pixel, cv2.COLOR_RGB2BGR)
print(new_pixel)
  • Win10 x64
  • opencv-contrib-python-headless 4.5.4.58
Issue submission checklist
  • This is not a generic OpenCV usage question (looking for help for coding, other usage questions, homework etc.)
  • I have read the README of this repository and understand that this repository provides only an automated build toolchain for OpenCV Python packages (there is no actual OpenCV code here)
  • The issue is related to the build scripts in this repository, to the pre-built binaries or is a feature request (such as "please enable this additional dependency")
  • I'm using the latest version of opencv-python

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions