Ask Your Question

Yahya's profile - activity

2016-03-15 14:08:25 -0600 received badge  Editor (source)
2016-03-15 14:07:46 -0600 asked a question ORB is not working

OpenCV version: 3.1.0

Host OS: Linux Ubuntu 14.04

Language: Python

I wish to use ORB (http://docs.opencv.org/3.1.0/d1/d89/t...) on a 28*28 grayscale image (handwritten digits), where each pixel has a number from 0 to 255.

This is the code I used:

orb = cv2.ORB_create()
image = image.reshape(28, 28))
kp = orb.detect(image, None)

But I keep getting this error:

OpenCV Error: Assertion failed (depth == CV_8U || depth == CV_16U || depth == CV_32F) in cvtColor, file /home/yahya/Documents/_other_downloaded_apps/opencv/modules/imgproc/src/color.cpp, line 7935
Traceback (most recent call last):
  File "/home/yahya/Documents/hello.py", line 118, in <module>
    kp = orb.detect(image, None)
cv2.error: /home/yahya/Documents/_other_downloaded_apps/opencv/modules/imgproc/src/color.cpp:7935: error: (-215) depth == CV_8U || depth == CV_16U || depth == CV_32F in function cvtColor

I also tried:

orb = cv2.ORB_create()
image = img_as_float(image.reshape(28, 28))
kp = orb.detect(image, None)

How can I do this and why am I getting this error?