Go to Post When was the last time you heard of someone on their death bed talking about a great movie they saw? I think it far more likely to hear of their accomplishments, something they did to make things better. Well that's what FIRST is all about. - DougHogg [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 21-07-2016, 22:57
David Lame David Lame is offline
Registered User
FRC #0247
 
Join Date: Feb 2015
Location: Berkley, MI
Posts: 88
David Lame is a jewel in the roughDavid Lame is a jewel in the roughDavid Lame is a jewel in the roughDavid Lame is a jewel in the rough
OpenCV on Raspberry Pi - where is CV2?

I was running OpenCV on a Raspberry Pi for some off season programming, and it was all well and good, when suddenly, it stopped working. After some troubleshooting, I determined it was actually a bad SD card. Losing data. Grrr....

No problem, though. New SD card. Format. Install OS. Install OpenCV (in a virtual environment.....good idea? ...the guy who wrote the tutorial seemed to think so...) .Run script, and it can't find CV2. Import cv2 fails in the script because it can't find cv2. It found numpy, but not cv2.

Hmmmm......what's up with that? After trying lots of ideas, it still can't find CV2. Well, I hadn't done python except on the pi, so eventually I decided to find out how import worked, and point to the right place so it can find cv2. Here's where my problem comes in.

Where is CV2? What am I looking for? I've got a directory called opencv-3.1.0 . That directory has a lot of stuff in it, but it doesn't have a file name or a directory named cv2, or cv2.py.

I've figure out some things about some environment variables and the python path and such, so that if I could find the directory where cv2 was located, I think I could import it, but I can't find it.

Does anyone know what I ought to be looking for?
Reply With Quote
  #2   Spotlight this post!  
Unread 22-07-2016, 08:37
JamesBrown JamesBrown is offline
Back after 4 years off
FRC #5279
Team Role: Engineer
 
Join Date: Nov 2004
Rookie Year: 2005
Location: Lynchburg VA
Posts: 1,281
JamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond repute
Re: OpenCV on Raspberry Pi - where is CV2?

Quote:
Originally Posted by David Lame View Post
Install OpenCV (in a virtual environment.....good idea? ...the guy who wrote the tutorial seemed to think so...)
Did you follow the tutorial on pyimagesearch.com? If thats the case I suspect you missed or had an error on Step 10 of this tutorial http://www.pyimagesearch.com/2015/02...ry-pi-2-and-b/
__________________
I'm Back


5279 (2015-Present)
3594 (2011)
3280 (2010)
1665 (2009)
1350 (2008-2009)
1493 (2007-2008)
1568 (2005-2007)
Reply With Quote
  #3   Spotlight this post!  
Unread 22-07-2016, 08:51
euhlmann's Avatar
euhlmann euhlmann is offline
CTO, Programmer
AKA: Erik Uhlmann
FRC #2877 (LigerBots)
Team Role: Leadership
 
Join Date: Dec 2015
Rookie Year: 2015
Location: United States
Posts: 374
euhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud of
Re: OpenCV on Raspberry Pi - where is CV2?

Code:
sudo apt-get install python-opencv
__________________
Creator of SmartDashboard.js, an extensible nodejs/webkit replacement for SmartDashboard


https://ligerbots.org
Reply With Quote
  #4   Spotlight this post!  
Unread 22-07-2016, 23:34
David Lame David Lame is offline
Registered User
FRC #0247
 
Join Date: Feb 2015
Location: Berkley, MI
Posts: 88
David Lame is a jewel in the roughDavid Lame is a jewel in the roughDavid Lame is a jewel in the roughDavid Lame is a jewel in the rough
Re: OpenCV on Raspberry Pi - where is CV2?

Quote:
Originally Posted by JamesBrown View Post
Did you follow the tutorial on pyimagesearch.com? If thats the case I suspect you missed or had an error on Step 10 of this tutorial http://www.pyimagesearch.com/2015/02...ry-pi-2-and-b/
Thanks. It wasn't that exact step, but it was closely related. I was doing the pi 3 installation instructions. It turns out the reason that I couldn't find the thing named cv2 was that there's a problem with the python 3 installation script which misnames the file. Adrian's instructions tell you what file to rename, but I didn't execute the step where it was called out.

Much appreciated.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 21:46.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi