Ask Your Question

miash's profile - activity

2015-07-22 20:18:57 -0600 commented question Fail to import smbus in OpenCV??

Sorry to ask again....where should I post this question? Clearly it's related to the working environment of Opencv....

2015-07-22 01:16:21 -0600 commented question Fail to import smbus in OpenCV??

Would you kindly guide me how to import smbus for Adafruit_I2C in openCV environment? I can run my code written for Adafruit and opencv seperately, but I failed to import smbus for Adafruit in CV environment.... A little help would be really appreciated!

2015-07-22 00:00:35 -0600 asked a question Fail to import smbus in OpenCV??

I am a newbie working on a project which requires the use of a PWM driver board (Adafruit PCA9685) and control it through data obtained from openCV. I'm using raspberry pi 2 and OpenCV 2.7 as my platform. Initially, I tested my PWM driver board with the official example code provided by Adafruit, and it worked perfectly. However, when I implant my code into OpenCV, error messages keep popping up.

Traceback (most recent call last):
  File "HSV_servo.py", line 3, in <module>
    from Adafruit_PWM_Servo_Driver import PWM
  File "/home/pi/test/PWM_Servo/Adafruit_PWM_Servo_Driver.py", line 5, in <module>
    from Adafruit_I2C import Adafruit_I2C
  File "/home/pi/Adafruit-Raspberry-Pi-Python-Code/Adafruit_PWM_Servo_Driver/Adafruit_I2C.py", line 3, in <module>
    import smbus
ImportError: No module named smbus

It seems that openCV failed to recognize python-smbus, is there any solution??

My code for reference (not yet complete):

#!/usr/bin/python
from Adafruit_PWM_Servo_Driver import PWM
import time

#import necessary packages
from picamera.array import PiRGBArray
from picamera import PiCamera
import cv2
import numpy as np
import argparse