Forums - Writing new machine vision+OpenCV application

7 posts / 0 new
Last post
Writing new machine vision+OpenCV application
sdyavarasetti
Join Date: 6 Jan 17
Posts: 22
Posted: Mon, 2018-03-05 05:13

Hi,

I am using snapdragon flight board ( APQ8074). I would like to write simple application that writes VISLAM data as output file(using Machine vision  SDK) and face detection ( using OpenCV ) .

But I am not able to compile any program on vehicle. Can you please provide simple steps to compile and execute Machine Vision based program.

Thanks in advance.

Krishna

  • Up0
  • Down0
gmcgrath
Join Date: 21 Aug 13
Posts: 59
Posted: Mon, 2018-03-05 13:43

As outlined in the Machine Vision Quick Start Guide (https://developer.qualcomm.com/download/machine-vision/machine-vision-qsg.pdf), MV installs sample application code into /usr/share/mv on target.  However, testing has revealed that some file permissions are wrong when installed on the OS version 3.1.3.1 (or older).  The next release of MV will fix these or the next OS release might also do so.  Until then, the following commands will fix permissions:

sudo chmod 777 /usr/share/mv/1.1.8/app/mvGateway/components/
sudo chmod 777 /usr/share/mv/1.1.8/app/mvGateway/platform/
sudo chmod a+r /usr/share/mv/1.1.8/app/mvGateway/*/*
sudo chmod 777 /usr/share/mv/1.1.8/app/mvVMPlayback/data/
sudo chmod 777 /usr/share/mv/1.1.8/app/mvVMPlayback/data/depth
sudo chmod a+r /usr/share/mv/1.1.8/app/mvVMPlayback/data/*
sudo chmod a+r /usr/share/mv/1.1.8/app/mvVMPlayback/data/depth/*

 

It is best to make a local copy in your user space:

cp -r /usr/share/mv/1.1.8/app/ .

 

It is easiest to start with one of the playback applications:

cd app/mvVMPlayback
g++ -std=c++11 main.cpp -I /usr/include/mv -lmv1
./a.out

The standard output should end with:
Collision for box -0.0940224 -0.0991988 -0.0962258 - 0.105978 0.100801 0.1037740 at -0.45671 0 0


A more relevant example, might be the VISLAM playback application:
cd ../mvVISLAMPlayback
g++ -std=c++11 main.cpp -I /usr/include/mv -lmv1


However, no sample data was provided to run with immediately but must instead be generated using mvCapture or another way.  Also, note that some applications expect OpenCV to be installed first.  Since you are planning to do that anyway, it should not be a problem.

 

  • Up0
  • Down0
sdyavarasetti
Join Date: 6 Jan 17
Posts: 22
Posted: Tue, 2018-03-06 01:18

Thanks for your quick reply.

But while trying for mvVMPlayBack, getting below errors

/usr/include/mv/mvVM.h: In member function 'void MV::OccupancyMap::getOrigin(float32_t*)':
/usr/include/mv/mvVM.h:715:58: error: 'memcpy' was not declared in this scope
       memcpy( origin, newOrigin, 3 * sizeof( float32_t ) );
                                                          ^
In file included from /usr/include/arm-linux-gnueabihf/sys/select.h:45:0,
                 from /usr/include/arm-linux-gnueabihf/sys/types.h:219,
                 from /usr/include/stdlib.h:314,
                 from main.cpp:13:
/usr/include/arm-linux-gnueabihf/bits/time.h: At global scope:
/usr/include/arm-linux-gnueabihf/bits/time.h:30:8: error: redefinition of 'struct timeval'
 struct timeval

While trying to compile mvCapture, giving error for missing "CameraManager.h".

Note : I tried using serial cable, adb and ssh. No use.

Thanks in-advance.

Sai krishna

  • Up0
  • Down0
gmcgrath
Join Date: 21 Aug 13
Posts: 59
Posted: Tue, 2018-03-06 09:33

Something seems very wrong about your output.  memcpy() is defined in string.h which you can see is included in mvVM.h itself.  Also, you should be able to verify the system header is where it should be:

 ls /usr/include/string.h

 

Please update your board to the latest OS (v3.1.3.1) if you have not done so already.  Please also install and use the latest MV (v1.1.8) so that we are using the same versions.

 

You should not have to compile mvCapture either since a compiled version is already availible in /usr/bin.  Instructions for mvCapture are availble in the aforementioned Quick Start Guide.

  • Up0
  • Down0
sdyavarasetti
Join Date: 6 Jan 17
Posts: 22
Posted: Wed, 2018-03-07 02:25

Thank you.

I got resolved compilation problem. Able to compile and execute all MachineVision programs.

is there any clue to implement FollowMe using MachineVision SDK and some other SDK?

--Sai Krishna

  • Up0
  • Down0
an.rahhou
Join Date: 25 Apr 18
Posts: 4
Posted: Wed, 2018-04-25 06:22

hi,

Can you tell me if OpenCV is available with Snapdragon??

if there is a tutorial that show us how to do it??

thank you.

  • Up0
  • Down0
gmcgrath
Join Date: 21 Aug 13
Posts: 59
Posted: Thu, 2018-04-26 09:38

The Machine Vision SDK is very easy to use.  Platform questions should be directed to the appropriate platform.

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.