bhunt2 / QC1.0

Design, documentation, and code for our first quadcopter
1 stars 0 forks source link

Problems Locating Header Files in Edison #23

Closed Kekahuna closed 8 years ago

Kekahuna commented 8 years ago

Hello, @spesialstyrker @bhunt2 @sabmah @hautruong36

Currently I am trying to run the attached code. I took a snapshot of the error that I am receiving. I could use some help getting this up and running. Here's also a guide that I was using to setup running a basic opencv application.

URL for guide to setting up opencv on Edison-https://software.intel.com/en-us/articles/opencv-300-ipp-tbb-enabled-on-yocto-with-intel-edison

Code for simple CameraTest to test if the header files are being linked properly `#include "iostream"

include "opencv2/opencv.hpp"

using namespace std; using namespace cv;

int main() { VideoCapture cap(0); if (!cap.isOpened()) { cout << "I'm blind..." << endl; return -1; } cout << "I can see!" << endl; return 0; }`

opencverror

ghost commented 8 years ago

When it can not find the header files that is a compilation issue not one with the linking stage; that being said this tells me that whatever is being used to build the project is not being told where those headers are on the system. Can you tell me how you are compiling this program?

Kekahuna commented 8 years ago

If you follow the URL I posted, I followed that closely. The general steps are:

  1. using WinSCP, I moved opencv-3.1.0.zip into the home/root directory.
  2. I unzipped that file by typing unzip opencv-3.1.0.zip into the command line.
  3. I then navigated to the directory that was generated at home/root/opencv-3.1.0 and typed cmake
  4. My next command was, "cmake -D WITH_IPP=ON -D WITH_TBB=ON -D BUILD_TBB=ON -D WITH_CUDA=OFF -D WITH_OPENCL=OFF -D BUILD_SHARED_LIBS=OFF -D BUILD_PERF_TESTS=OFF -D BUILD_TESTS=OFF ."
  5. With no observable error, I typed "make -j2" to build opencv.
  6. after building completed, I installed by typing "make install"
  7. After installation, i navigated to the home/root/opencv-3.1.0/samples directory and transferred my cpp file to this directory.
  8. I then typed "cmake" while in this directory.
  9. I then typed "make CameraTest" to attempt to build

Prior to all of this, I tried to install the appropriate packages and repositories. It is possible that this step did not work correctly. I had some difficulty locating the corrected opkg commands for our purposes.

ghost commented 8 years ago

The url gives me a 404 on my phone I apologize for not getting the article information. I don't recall if the default build commands use as a prefix for the linux install which may account for the headers not showing in the default include path, but regardless I will see if I have issues with building the sample projects. It still is an issue of the toolchain not knowing where the header files are in this case.

bhunt2 commented 8 years ago

I fixed the link so that you can use it now. I recommend you guys have separate users made so that you can each have your own working environment. If you don't want to do that you could at least have separate directories in the root directory to work in.

You should get Git installed so that everyone can push/pull the repo for easy development as well.

bhunt2 commented 8 years ago

@Kekahuna @spesialstyrker

Take a look at the output when you type 'cmake .' in the samples directory. This output shows that the operating system has not been told where opencv is located. Is the current Yocto build 2.1 or later?

image

Kekahuna commented 8 years ago

Sabin stated that the current Yocto build should be Yocto build 2.1. He was having issues installing Yocto 3.0.

bhunt2 commented 8 years ago

It would seem that it is not or there is something wrong with what the opencv tutorial states about it automatically setting up everything for you in 2.1. It is not stated that this functionality is perpetuated in later builds, so make sure it is the complete package as directed in the opencv tutorial and try again.

sabmah commented 8 years ago

here is the tutorial https://software.intel.com/en-us/articles/opencv-300-beta-ipp-tbb-enabled-on-yocto-with-intel-edison

bhunt2 commented 8 years ago

We already had that. Would you please verify that the image you are using is 'Release Yocto 2.1 Complete Image' as stated in the tutorial?

sabmah commented 8 years ago

Yes, it is release Yocto 2.1 downloaded from their website.

bhunt2 commented 8 years ago

cool, thanks

bhunt2 commented 8 years ago

So, I was going to work on this today, but I don't have root access and I don't know the root password you set up. I was able to do some things but not everything I wanted to try. You will need to remove the opencv directory and go through the tutorial again. After each step of the process, look at the output files. CMakeLists.txt and others have information about the builds and the outputs from them. I tried to do this, but was only able to remove some of the files and then couldn't remove the directories. That told me that I wouldn't be able to properly build so I am left to stop here.

Please provide Michael and I with sudo rights (preferred) or the root password. Thanks

bhunt2 commented 8 years ago

I got the password from Sabin and started the build process again for OpenCV. Since it takes like an hour to complete, I think that is all I will have time for. I will let you know what the results are from the build and if you can move forward from there.

bhunt2 commented 8 years ago

The build worked fine and 'cmake .' actually built and produced examples appropriately. The instructions aren't exactly clear though. The output of the builds for the examples are found in the appropriate file type folder, such as cpp and then under CMakeFiles. Each example and tutorial has its own directory. These have the make files and output files for their respective builds. The executable is located within the examples/ and named -example-. I hope that makes sense. I did a build of the smiledetect.cpp example and its output is found in examples/cpp as cpp-example-smiledetect.

The tutorial states that the easiest way to get use to how it works is to use one of the examples and just replace the code with your own. I don't necessary recommend that for the long run because that won't be an appropriate working environment, but it will work to get things going.

The issue with the examples is that many of them are setup to use the camera which may or may not be setup. They also use the imshow or similar function so they won't work because they can't show anything.

bhunt2 commented 8 years ago

@Kekahuna

Please update as to what has happened with this and if the issue is now resolved.

Kekahuna commented 8 years ago

OpenCV has successfully been installed on the Edison.

Closing this issue.