Community
cancel
Showing results for 
Search instead for 
Did you mean: 
idata
Community Manager
2,297 Views

OpenCV additional modules

Hi guys we need OpenCV additional modules installed so that we can use createEigenFaceRecognizer and model.save()/load() etc for a fallback demo. I have managed to get a lot of the required packages installed via either OPKG or source but am struggling with the following below. In addition after an OPKG update and upgrade I am now getting the XDK errors every time I attempt and OPKG install. I have actually installed gstreamer using OPKG but it is still saying not found, in addition HDF5 is installed as we have installed Caffe, protobuf was already installed so unsure why it downloaded it again. I am hoping to not have to update python.

If anyone knows a way to get around all of this lot would be a great help.

Thanks in advance.

cmake -D INSTALL_PYTHON_EXAMPLES=OFF -DBUILD_opencv_legacy=OFF -DBUILD_opencv_java=OFF -DBUILD_opencv_python=OFF -BUILD_SHARED_LIBS=OFF -DBUILD_TIFF=ON -DBUILD_opencv_java=OFF -DWITH_CUDA=OFF -DENABLE_AVX=ON -DWITH_OPENGL=ON -DWITH_OPENCL=ON -DWITH_IPP=ON -DWITH_TBB=ON -DWITH_EIGEN=ON -DWITH_V4L=ON -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF -DCMAKE_BUILD_TYPE=RELEASE -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF -DWITH_VTK=OFF -DOPENCV_EXTRA_MODULES_PATH=/home/root/opencv-3.1.0/opencv_contrib/modules /home/root/opencv-3.1.0/

-- Detected version of GNU GCC: 49 (409)

-- sizeof(void) = 4 on x86 / x86_64 processor. Assume 32-bit compilation mode (X86=1)

-- Found ZLIB: /usr/lib/libz.so (found suitable version "1.2.8", minimum required is "1.2.3")

-- Found ZLIB: /usr/lib/libz.so (found version "1.2.8")

-- Checking for module 'gtk+-3.0'

-- No package 'gtk+-3.0' found

-- Checking for module 'gtk+-2.0'

-- No package 'gtk+-2.0' found

-- Checking for module 'gtkglext-1.0'

-- No package 'gtkglext-1.0' found

-- Checking for module 'gstreamer-base-1.0'

-- No package 'gstreamer-base-1.0' found

-- Checking for module 'gstreamer-video-1.0'

-- No package 'gstreamer-video-1.0' found

-- Checking for module 'gstreamer-app-1.0'

-- No package 'gstreamer-app-1.0' found

-- Checking for module 'gstreamer-riff-1.0'

-- No package 'gstreamer-riff-1.0' found

-- Checking for module 'gstreamer-pbutils-1.0'

-- No package 'gstreamer-pbutils-1.0' found

-- Checking for module 'gstreamer-base-0.10'

-- No package 'gstreamer-base-0.10' found

-- Checking for module 'gstreamer-video-0.10'

-- No package 'gstreamer-video-0.10' found

-- Checking for module 'gstreamer-app-0.10'

-- No package 'gstreamer-app-0.10' found

-- Checking for module 'gstreamer-riff-0.10'

-- No package 'gstreamer-riff-0.10' found

-- Checking for module 'gstreamer-pbutils-0.10'

-- No package 'gstreamer-pbutils-0.10' found

-- Checking for module 'libdc1394-2'

-- No package 'libdc1394-2' found

-- Checking for module 'libdc1394'

-- No package 'libdc1394' found

-- Checking for module 'libv4l1'

-- No package 'libv4l1' found

-- Checking for module 'libv4l2'

-- No package 'libv4l2' found

-- Looking for linux/videodev.h

-- Looking for linux/videodev.h - not found

-- Looking for linux/videodev2.h

-- Looking for linux/videodev2.h - found

-- Looking for sys/videoio.h

-- Looking for sys/videoio.h - not found

-- Checking for module 'libavcodec'

-- No package 'libavcodec' found

-- Checking for module 'libavformat'

-- No package 'libavformat' found

-- Checking for module 'libavutil'

-- No package 'libavutil' found

-- Checking for module 'libswscale'

-- No package 'libswscale' found

-- Checking for module 'libavresample'

-- No package 'libavresample' found

-- Looking for libavformat/avformat.h

-- Looking for libavformat/avformat.h - not found

-- Looking for ffmpeg/avformat.h

-- Looking for ffmpeg/avformat.h - not found

-- Checking for module 'libgphoto2'

-- No package 'libgphoto2' found

<...
35 Replies
idata
Community Manager
117 Views

Ok I seemed to have solved this using ccmake . it is running without issues face.hpp included, will have to test to confirm and will update this post if it is 100% confirmed. I

idata
Community Manager
117 Views

Hi Adam,

 

 

Thanks for contacting us!

 

 

I'm happy to know that you have solved this issue, and I'll be waiting for your confirmation or if you have any questions, don't hesitate to contact us back.

 

 

Regards,

 

-Yermi

 

idata
Community Manager
117 Views

Hi YermiA_Intel thanks OK so we got the rest of the code in place and used the feature we need which begins with this line of code:

cv::Ptr<<span class="s1">cv::face::FaceRecognizer> model = cv::face::createEigenFaceRecognizer();

cout << <span class="s2">"HERE " << <span class="s3">endl;

Original we were using this:

Ptr<</span>FaceRecognizer> model = createEigenFaceRecognizer();

cout << <span class="s2">"HERE " << <span class="s3">endl;

However we are experiencing the error Illegal Instruction, the code never makes it to HERE. We found the following forum post on OpenCV and implemented the suggested fix but it did not work.

 

http://answers.opencv.org/question/18001/illegal-instruction-when-running-any-compiled-opencv-demo-b... "Illegal instruction" when running any compiled opencv demo binary & sse3 flag - OpenCV Q&A Forum

I have also opened my own issue on their forum:

http://answers.opencv.org/question/117247/illegal-instruction-on-createeigenfacerecognizer/?comment=... comment-117308 Illegal Instruction on createEigenFaceRecognizer - OpenCV Q&A Forum

And they have suggested disabling compilers in ccmake but said it is a hit miss and this could probably take us quite a long time to work out, could you suggest anything that would solve this issue?

OPKG issues are still there by the way also.

idata
Community Manager
117 Views

Hi Adam,

 

 

I have been looking for information regarding the error you are getting, and I found in the following link: https://marylou.byu.edu/wiki/index.php?page=I+keep+getting+Illegal+Instruction+errors.+What+do+I+do%... https://marylou.byu.edu/wiki/index.php?page=I+keep+getting+Illegal+Instruction+errors.+What+do+I+do%..., that "Illegal Instruction errors occur when you try to run a program that was compiled with some processor-specific optimizations, and is then running on a processor that fails to meet those requirements" Maybe, looking at the "What do I do about it?" section could help you. However let me investigate if I can find something else.

 

 

Regarding the OPKG issue I believe that the error could be related to the path where the installation file is looking for, it might be looking the package in a different path, so you could check that.

 

 

Hope this information helps.

 

 

Regards,

 

-Yermi

 

idata
Community Manager
117 Views

We have switched to a Raspberry for now, it seems to be an issue with the Edison as far as we can tell we have tried a few solutions.

Re the OPKG it has been replicated on a fresh docker container I believe it is a bug.

zhong4
Beginner
117 Views

Hi Adam,

i have meet the same question with you.could you tell me how to solve this problem? Any answer would be appreciated !

thanks.

Sincerely yours

idata
Community Manager
117 Views

I havent at the moment yet but we will keep trying to resolve it, for now we have switched to an RPI which handles it fine.

zhong4
Beginner
117 Views

thanks for your replies! i wil stick to solving it !

idata
Community Manager
117 Views

Cool keep me informed we will do but have a demo due next week so do not have the luxury, we did disable SSE so in our case this was not the answer to our issue.

idata
Community Manager
117 Views

Hi Adam,

 

 

Could you please give us more details regarding the bug you have mentioned, this is in order to forward it to the proper team so they can review it and be aware for future possible updates.

 

 

Regards,

 

-Yermi
idata
Community Manager
117 Views

RE OPKG

For that error on 2 x docker containers after OPKG update / upgrade I get the following:

  1. Failed to get D-Bus connection: Unknown error -1
  2. Collected errors:
  3. * pkg_run_script: package "xdk-daemon" postinst script returned status 1.
  4. * opkg_configure: xdk-daemon.postinst returned 1.

After attempting to install anything with OPKG, I dont have the error that popped up on update / upgrade but it was similar to above.

idata
Community Manager
117 Views

Hi Adam,

 

 

Thanks for your reply. It is a shame that you had to change the board to continue with your project, however that information will help us to improve our products, we will forward this information to the proper team so they can review it.

 

 

Regards,

 

-Yermi

 

idata
Community Manager
117 Views

Hi it was only for an immediate solution as we have a demo soon and I had already built this on an RPI, but we will be spending more time on it after the demo, just to confirm the only existing issue related to OpenCV and the Edison is the Illegal Instruction error. The OPKG issue was just an observation but have done an OPKG update since on an actual Edison and not in Docker and it did not do the same. If you do find anything out that would help re the Illegal Instruction error please do let me know.

idata
Community Manager
117 Views

Hi Adam,

 

 

Thanks for your comments, if I can find something helpful for you I'll let you know.

 

 

Regards,

 

-Yermi

 

idata
Community Manager
117 Views

Hi Adam,

 

 

I have found some threads regarding users that have gotten "illegal instructions" errors using OpenCV, however they are from Intel® Galileo but I believe there you can find useful information:
  • /thread/48204 OpenCV projects ?
  • /message/269787# 269787 Opencv2 with Python on iot-devkit image
  • /message/266750# 266750 'opkg install python-opencv' says, Unknown package 'python-opencv'.

 

Additionally, I'd suggest you to follow this guide to install OpenCV on Edison https://software.intel.com/en-us/articles/opencv-300-ipp-tbb-enabled-on-yocto-with-intel-edison https://software.intel.com/en-us/articles/opencv-300-ipp-tbb-enabled-on-yocto-with-intel-edison.

 

 

If you continue getting this error, I'd recommend to contact OpenCV support or follow their suggestions due to this issue seems to be with OpenCV rather than the Edison.

 

 

Hope the information above helps.

 

 

Regards,

 

-Yermi

 

idata
Community Manager
117 Views

Hi thanks those are fairly outdated now, the issue is not with installing OpenCV it is with the additional modules. I have OpenCV installed and working with both C++ and Python but it is the additional modules such as face etc that are causing the issue, only on the Edison as far as we have found, I did open a topic on their forum it was linked in my early replies here, I have played around more but am still unsuccessful so far, also have issues with installing Tensorflow which these are the main libraries we use in our project. Will continue to work on it, we have moved now from Caffe to Tensorflow so ultimately I am looking at OpenCV Python.

I got quite far on building from source but ran out of space will continue tomorrow on an SD card and see if I can resolve it that way.

idata
Community Manager
117 Views

Hi guys,

After:

- Sorting out booting from SD (Our tutorial here: https://github.com/TechBubbleTechnologies/IoT-JumpWay-Intel-Examples/blob/master/Intel-Edison/_DOCS/... (IoT-JumpWay-Intel-Examples/1-Booting-From-SD-Linux.md at master · TechBubbleTechnologies/IoT-JumpWay-Intel-Examples · Gi… )

- Building OpenCV & Python Modules from source with the extra modules required included (After installation extra modules did not work )

- Installing OpenCv from OPKG (Does not include the extra modules required )

- Installing OpenCv from pip (Does not include the extra modules required )

- Installing Python3 and installing OpenCv from pip3 ( Does not work )

We are pretty much out of options, seems pretty strange that all of the above and the C++ attempts we have made do not enable us to do a simple eigenface identification, for now we are at a hold on this project version for Intel Edison, I am going to attempt to recover my initial version on the Intel Galileo but I do not think I used the external modules in that case, lets see.

 

Will keep you updated, hoping to get this solved as we need it for one of our tutorials.

idata
Community Manager
117 Views

Hi how are you I have been continuing to try and get this sorted, there is literally no tutorials that include the additional modules, the module I need is cv2.face for the eigenfaces model, this is for a tutorial, it is not actually part of our main project as we home an AI on a local server now and the main project is good enough with just the standard open cv to send the frames through for detection.

I have built from source, upon doing so I was still getting no module cv2, I executed this, and it removed the error:

$ echo "/usr/local/lib" >> /etc/ld.so.conf

$ ldconfig

But still get the error:

no module face

Although the extra modules have 100% been built, so I am guessing it is a paths thing, any suggestions on resolving this ?

idata
Community Manager
117 Views

Hi Adam,

 

 

We would like to let you that it is out of our support scope, however, we could try to help you with this, could you please share all the steps you have followed to build OpenCV with the extra modules in order to check if there is something that we can do?

 

 

Regards,

 

-Yermi A.

 

idata
Community Manager
19 Views

Yes definitely! I will upload the process taken so far tomorrow. The reason why I am determined in completing this task is I have been able to produce a successful prototype on an RPI with a tutorial on Hackster I made (https://www.hackster.io/AdamMiltonBarker/facial-recognition-identification-on-raspberry-pi-1c7495 Facial Recognition & Identification on Raspberry Pi - Hackster.io ), I would like to have the same tutorial for Intel Edison, but have not been able as of yet. The link to the full project is here: https://devmesh.intel.com/projects/tass-network TASS Network

Reply