Go to Post If enough students "get it," the team will begin to. And if enough students "get it," the smart ones will seek out all the extra help they can get. That's how I found Chiefdelphi... - Joe G. [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

 
Closed Thread
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 29-11-2013, 22:52
yash101 yash101 is offline
Curiosity | I have too much of it!
AKA: null
no team
 
Join Date: Oct 2012
Rookie Year: 2012
Location: devnull
Posts: 1,191
yash101 is an unknown quantity at this point
Installing OpenCV

I have been having quite some trouble in getting OpenCV installed. After doing a quick search, "installing opencv," I got no good results. I have tried many of the installation techniques listed in various websites, found by searching, installing opencv. <<Hopefully, no one finds that offensive . Does anyone have a link to some good documentation on how to quickly install OpenCV? I am interested in compiling it, because I can use Git and get the latest code!
  #2   Spotlight this post!  
Unread 29-11-2013, 23:13
ad1217 ad1217 is offline
Registered User
FRC #1786 (The Robotics Team)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2007
Location: New Hampshire
Posts: 7
ad1217 is an unknown quantity at this point
Re: Installing OpenCV

Question that will definitely help troubleshoot: What OS are you running?
  #3   Spotlight this post!  
Unread 29-11-2013, 23:28
yash101 yash101 is offline
Curiosity | I have too much of it!
AKA: null
no team
 
Join Date: Oct 2012
Rookie Year: 2012
Location: devnull
Posts: 1,191
yash101 is an unknown quantity at this point
Wink Re: Installing OpenCV

Currently Debian, however, I will switch to Ubuntu whenever possible. Ubuntu is basically Debian, with tons of add-ons!
  #4   Spotlight this post!  
Unread 29-11-2013, 23:58
billbo911's Avatar
billbo911 billbo911 is offline
I prefer you give a perfect effort.
AKA: That's "Mr. Bill"
FRC #2073 (EagleForce)
Team Role: Mentor
 
Join Date: Mar 2005
Rookie Year: 2005
Location: Elk Grove, Ca.
Posts: 2,384
billbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond reputebillbo911 has a reputation beyond repute
Re: Installing OpenCV

Quote:
Originally Posted by yash101 View Post
I have been having quite some trouble in getting OpenCV installed. After doing a quick search, "installing opencv," I got no good results. I have tried many of the installation techniques listed in various websites, found by searching, installing opencv. <<Hopefully, no one finds that offensive . Does anyone have a link to some good documentation on how to quickly install OpenCV? I am interested in compiling it, because I can use Git and get the latest code!
If you used the install directions in the link you provided, you undoubtedly made it to this page.

Was there an issue with following those steps? I know it is written for Linux, but I followed it for Ubuntu and was successful. I believe it "should" work as well for Debien, as long as you compensate for any minor differences.
__________________
CalGames 2009 Autonomous Champion Award winner
Sacramento 2010 Creativity in Design winner, Sacramento 2010 Quarter finalist
2011 Sacramento Finalist, 2011 Madtown Engineering Inspiration Award.
2012 Sacramento Semi-Finals, 2012 Sacramento Innovation in Control Award, 2012 SVR Judges Award.
2012 CalGames Autonomous Challenge Award winner ($$$).
2014 2X Rockwell Automation: Innovation in Control Award (CVR and SAC). Curie Division Gracious Professionalism Award.
2014 Capital City Classic Winner AND Runner Up. Madtown Throwdown: Runner up.
2015 Innovation in Control Award, Sacramento.
2016 Chezy Champs Finalist, 2016 MTTD Finalist
  #5   Spotlight this post!  
Unread 30-11-2013, 01:16
yash101 yash101 is offline
Curiosity | I have too much of it!
AKA: null
no team
 
Join Date: Oct 2012
Rookie Year: 2012
Location: devnull
Posts: 1,191
yash101 is an unknown quantity at this point
Re: Installing OpenCV

Yes. That is the first link that I clicked on. However, it does not include a comprehensive list of resources required by OpenCV. I want to have maximum compatibility, so I will make sure to get everything, even if I have to compile it myself! Also, that says,
cmake [<some optional parameters>] <path to the OpenCV source directory>

I do not know the optional parameters. I haven't messed around with CMAKE that much, so I do not know how to get the list of parameters.

Right now, I am following a tutorial on ozbots:
http://www.ozbotz.org/opencv-installation-2-3-1/http://www.ozbotz.org/opencv-installation-2-3-1/

Since that is for OpenCV 2.3.1, could that cause any faults?

Thanks!
  #6   Spotlight this post!  
Unread 30-11-2013, 11:30
otherguy's Avatar
otherguy otherguy is offline
sparkE
AKA: James
FRC #2168 (The Aluminum Falcons)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: CT
Posts: 443
otherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to beholdotherguy is a splendid one to behold
Re: Installing OpenCV

This page, with instructions for opencv installation on debian, explains the cmake "optional parameters" a bit more.
__________________
http://team2168.org
  #7   Spotlight this post!  
Unread 30-11-2013, 12:03
hzheng_449 hzheng_449 is offline
Registered User
AKA: Harrison Zheng
FRC #0449 (Blair Robot Project)
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Rockville, MD
Posts: 36
hzheng_449 will become famous soon enough
Re: Installing OpenCV

Also in Ubuntu 12.04 (which by the way is the LTS, so if you're gonna switch switch to 12.04) you can just apt-get the libraries (and of course it will also list out and allow you to install all the dependencies). This is what ended up doing since it's the easiest option...

link to apt-get installing opencv (the package may be slightly out of date)

On a slight tangent, I'm not really a fan of cmake, and if you aren't either, it's worth the time to google how to compile openCV projects with g++.
  #8   Spotlight this post!  
Unread 30-11-2013, 12:56
yash101 yash101 is offline
Curiosity | I have too much of it!
AKA: null
no team
 
Join Date: Oct 2012
Rookie Year: 2012
Location: devnull
Posts: 1,191
yash101 is an unknown quantity at this point
Smile Re: Installing OpenCV

That helps quite a bit. That article describes a little more on how to configure CMAKE. Right now, I am stuck on installing FFMPEG, because Apt won't download the current version of YASM (I have already run apt-get update). Currently, I am performing a distribution upgrade of Ubuntu, because I am running 12.04. Hopefully that will help! What webcam do you guys suggest for powerful vision tracking? I was thinking of a camera with a high shutter speed, low ISO, and high aperture. That would allow me to set up a spotlight of light, to be retroreflected to the camera. The camera would only be able to capture that bright light!

Quote:
Originally Posted by hzheng_449 View Post
Also in Ubuntu 12.04 (which by the way is the LTS, so if you're gonna switch switch to 12.04) you can just apt-get the libraries (and of course it will also list out and allow you to install all the dependencies). This is what ended up doing since it's the easiest option...

link to apt-get installing opencv (the package may be slightly out of date)

On a slight tangent, I'm not really a fan of cmake, and if you aren't either, it's worth the time to google how to compile openCV projects with g++.
I agree. I am not a fan of CMAKE either. I was just going to use an IDE like Netbeans! That would get rid of all the confusion, caused by setting up! I will google about how to compile OpenCV projects using g++. I believe it uses PKG-CONFIG, so it shouldn't be rocket science!




PHP Code:
While compiling OpenCVat 20%, I got this error:
20%] Building CXX object modules/highgui/CMakeFiles/opencv_highgui.dir/src/bitstrm.cpp.o
20%] Building CXX object modules/highgui/CMakeFiles/opencv_highgui.dir/src/rgbe.cpp.o
Linking CXX shared library 
../../lib/libopencv_highgui.so
/usr/bin/ld: /usr/local/lib/libavcodec.a(avpacket.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libavcodec.a: could not read symbols: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [lib/libopencv_highgui.so.3.0.0] Error 1
make[1]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/all] Error 2
make: *** [all] Error 2 
Does anyone know what it could be?

Last edited by yash101 : 30-11-2013 at 17:40.
  #9   Spotlight this post!  
Unread 30-11-2013, 21:51
brennonbrimhall brennonbrimhall is offline
Free Agent
AKA: Brennon Brimhall
no team
Team Role: Alumni
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Clifton Park, NY
Posts: 222
brennonbrimhall is a name known to allbrennonbrimhall is a name known to allbrennonbrimhall is a name known to allbrennonbrimhall is a name known to allbrennonbrimhall is a name known to allbrennonbrimhall is a name known to all
Re: Installing OpenCV

Quote:
Originally Posted by yash101 View Post
I agree. I am not a fan of CMAKE either. I was just going to use an IDE like Netbeans! That would get rid of all the confusion, caused by setting up! I will google about how to compile OpenCV projects using g++. I believe it uses PKG-CONFIG, so it shouldn't be rocket science!
While no build system is perfect, CMake does a good job of managing cross-platform building. I wouldn't dismiss it too readily. But we digress.

Quote:
Originally Posted by yash101 View Post
PHP Code:
While compiling OpenCVat 20%, I got this error:
20%] Building CXX object modules/highgui/CMakeFiles/opencv_highgui.dir/src/bitstrm.cpp.o
20%] Building CXX object modules/highgui/CMakeFiles/opencv_highgui.dir/src/rgbe.cpp.o
Linking CXX shared library 
../../lib/libopencv_highgui.so
/usr/bin/ld: /usr/local/lib/libavcodec.a(avpacket.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libavcodec.a: could not read symbols: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [lib/libopencv_highgui.so.3.0.0] Error 1
make[1]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/all] Error 2
make: *** [all] Error 2 
Does anyone know what it could be?
Based on what I'm reading here, I'm inclined to think that OpenCV is having issues on the AV codec for it's internal HighGUI library.

Are you using parallel builds with make? That might explain it -- this step could be dependent on another step that has not been completed yet.
__________________
Team 20, 2012-2014: 4 blue banners, 5 medals, and 9 team awards.
Church of Jesus Christ of Latter-day Saints, 2014-2016: Missionary, Colorado Denver South Mission.
  #10   Spotlight this post!  
Unread 30-11-2013, 23:39
hzheng_449 hzheng_449 is offline
Registered User
AKA: Harrison Zheng
FRC #0449 (Blair Robot Project)
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Rockville, MD
Posts: 36
hzheng_449 will become famous soon enough
Re: Installing OpenCV

Quote:
Originally Posted by yash101 View Post

PHP Code:
While compiling OpenCVat 20%, I got this error:
20%] Building CXX object modules/highgui/CMakeFiles/opencv_highgui.dir/src/bitstrm.cpp.o
20%] Building CXX object modules/highgui/CMakeFiles/opencv_highgui.dir/src/rgbe.cpp.o
Linking CXX shared library 
../../lib/libopencv_highgui.so
/usr/bin/ld: /usr/local/lib/libavcodec.a(avpacket.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libavcodec.a: could not read symbols: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [lib/libopencv_highgui.so.3.0.0] Error 1
make[1]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/all] Error 2
make: *** [all] Error 2 
Does anyone know what it could be?
I'm pretty sure I got a similar build error when I was installing openCV(which was around September). Hopefully Brennon's suggestion works, if not try building an older version of openCV or do the "lazy" thing and apt-get the library (which is what I ended up doing).
  #11   Spotlight this post!  
Unread 01-12-2013, 00:16
faust1706's Avatar
faust1706 faust1706 is offline
Registered User
FRC #1706 (Ratchet Rockers)
Team Role: College Student
 
Join Date: Apr 2012
Rookie Year: 2011
Location: St Louis
Posts: 498
faust1706 is infamous around these partsfaust1706 is infamous around these parts
Re: Installing OpenCV

Since you said you were going to switch to ubuntu...here is the "master list" a mentor and I came up with 2 years ago:

sudo apt-get install synaptic

sudo apt-get update

*sudo apt-get install qt4-dev-tools libqt4-dev libqt4-core libqt4-gui

*sudo apt-get install qtcreator

sudo su

sudo apt-get install build-essential

sudo apt-get install libavformat-dev

sudo apt-get install ffmpeg

sudo apt-get install libcv2.3 libcvaux2.3 libhighgui2.3 python-opencv opencv-doc libcv-dev libcvaux-dev libhighgui-dev

**apt-get install freenect

*install qt creator, an IDE (integrated development platform)
**for kinect

we used these exact steps for our O-Droid XUs we got 2 weeks ago and all are running vision programs without any problems.
__________________
"You're a gentleman," they used to say to him. "You shouldn't have gone murdering people with a hatchet; that's no occupation for a gentleman."
  #12   Spotlight this post!  
Unread 01-12-2013, 13:09
yash101 yash101 is offline
Curiosity | I have too much of it!
AKA: null
no team
 
Join Date: Oct 2012
Rookie Year: 2012
Location: devnull
Posts: 1,191
yash101 is an unknown quantity at this point
Re: Installing OpenCV

I did try to build many of the things like x264 and ffmpeg, and whatever I couldn't find in the apt repository, myself, from the git code! I think that I may be using too current of a code! That could be why I am having many of these problems!

I think it would be wise for someone (maybe me), to create an install script, to install every package from Apt, and then download source from git to build!

Last edited by yash101 : 01-12-2013 at 13:15.
  #13   Spotlight this post!  
Unread 01-12-2013, 13:21
brennonbrimhall brennonbrimhall is offline
Free Agent
AKA: Brennon Brimhall
no team
Team Role: Alumni
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Clifton Park, NY
Posts: 222
brennonbrimhall is a name known to allbrennonbrimhall is a name known to allbrennonbrimhall is a name known to allbrennonbrimhall is a name known to allbrennonbrimhall is a name known to allbrennonbrimhall is a name known to all
Re: Installing OpenCV

Quote:
Originally Posted by yash101 View Post
I did try to build many of the things like x264 and ffmpeg, and whatever I couldn't find in the apt repository, myself, from the git code! I think that I may be using too current of a code!
Might be a bit late, but this is the official documentation from OpenCV with regards to building on Linux. Unless you plan on working on OpenCV itself, I'd stick with version 2.4.7, which is the latest stable version.

EDIT: As of 11/11/13, the latest version of OpenCV is 2.4.7.
__________________
Team 20, 2012-2014: 4 blue banners, 5 medals, and 9 team awards.
Church of Jesus Christ of Latter-day Saints, 2014-2016: Missionary, Colorado Denver South Mission.

Last edited by brennonbrimhall : 01-12-2013 at 15:48. Reason: Corrected latest version of OpenCV
  #14   Spotlight this post!  
Unread 01-12-2013, 13:26
yash101 yash101 is offline
Curiosity | I have too much of it!
AKA: null
no team
 
Join Date: Oct 2012
Rookie Year: 2012
Location: devnull
Posts: 1,191
yash101 is an unknown quantity at this point
Re: Installing OpenCV

It's not too late. I just need to redownload OpenCV and reconfigure it. Just a half hour, maybe. I have succeeded at building OpenCV from git before, but I do not know what is different this time. Let me make sure that I have properly installed LibAVCodec!

BTW, Brennon Brimhall, Thanks for the quick reply!



EDIT:
I just booted Ubuntu and checked the libavcodec installation status and found out that it wasn't properly installed. I forgot libavcodec-dev, but installed libavcodec-53! Now, let me retry the build, and hopefully I won't encounter any problems!


The build is still failing continuously. What do I do? I have uploaded a txt file with the output, created by make | tee dev_build.txt
I have tried re-installing libavcodec-dev libavcodec53 libavcodec-extra-53 but the problem persists. Should I compile it myself, or should I get a different mirror, update my system, or am I downloading a completely wrong package?


UPDATE:
I am compiling the code in the fashion that Brennon suggested, downloading the latest stable build from SourceForge. Currently it is compiling. I will include a build log, build_log.txt.

Thanks for your help
Attached Files
File Type: txt dev_build.txt (30.5 KB, 8 views)
File Type: txt build_log.txt (25.5 KB, 4 views)

Last edited by yash101 : 01-12-2013 at 16:51.
  #15   Spotlight this post!  
Unread 01-12-2013, 18:05
yash101 yash101 is offline
Curiosity | I have too much of it!
AKA: null
no team
 
Join Date: Oct 2012
Rookie Year: 2012
Location: devnull
Posts: 1,191
yash101 is an unknown quantity at this point
Re: Installing OpenCV

It seems as though maybe the libavcodec package may be broken . That is what is stopping me from having a complete build!
Closed Thread


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 03:26.

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