Ask Your Question

idkvince's profile - activity

2016-12-02 18:36:39 -0600 asked a question How to convert Mono Image to HSV?

Hello everyone I am getting frame captures from a Point Grey Chameleon a monochromatic camera. Everything is done in python. I am getting a video capture using cap = cv2.VideoCapture(0) [This only works after I installed libdc1394 drivers as it is a 1394 camera].

Anyways when I do print cap.shape it only returns a matrix of two elements, i.e. [480, 640] however when I do hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV) it errors out and gives me

 " OpenCV Error: Assertion failed ((scn == 3 || scn == 4) && (depth == CV_8U || depth == CV_32F)) in cvtColor, file /home/pi/opencv-3.1.0/modules/imgproc/src/color.cpp, line 8141
Traceback (most recent call last):
  File "NormCapt.py", line 14, in <module>
    hsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV)
cv2.error: /home/pi/opencv-3.1.0/modules/imgproc/src/color.cpp:8141: error: (-215) (scn == 3 || scn == 4) && (depth == CV_8U || depth == CV_32F) in function cvtColor"

From what I understand this is because the cvtColor function expects an image with a matrices of 3 elements instead of my 2 element matrix. How can I fix this problem as I would like to take my mono image and get an HSV image out of it so I can perform better object detection? Thanks

2016-11-22 22:46:48 -0600 commented question Using 1394 (Point Grey) Camera w/ Python

Thanks this worked!

2016-11-22 01:04:22 -0600 asked a question Using 1394 (Point Grey) Camera w/ Python

Hi everyone,

I have a Point Grey Chameleon Camera and have it working on my Raspberry Pi with OpenCV. To get a videocapture working with OpenCV I installed libdc1394 and had to compile OpenCV with 1394 flag enabled. I have gotten OpenCV and the camera to get a video stream by calling, Videocapture cap(CV_CAP_FIREWIRE + 0) using c++ code.

However I want to do my programming in python and I don't know how to call it in python. I have been using the command cv2.videocapture(CV_CAP_FIREWIRE + 0) and it does not produce a video capture. How can I access my camera that is using libdc1394 in python? Thanks