Lucas Kanade Algorithm for Image tracking - can not find cvCalcOpticalFlowPyrLK for Android

1,215 views
Skip to first unread message

ChrisP

unread,
Aug 30, 2011, 7:15:39 AM8/30/11
to android-opencv
Hi,
I would like to develop an AR-Application for Android that should find
features from a static 2D Image in the live camera view. I am
relatively new to OpenCV and Android. My first intention was to use
the Lucas Kanade optical flow algorithm but I could not find it in the
OpenCV package for Android. Is it not part of it or did I simply not
see it? I also wonder if for my application Lucas Kanade is actually
the right choice. Might it work easier with SURF or some other
algorithm?

Kirill Kornyakov

unread,
Aug 30, 2011, 7:33:40 AM8/30/11
to android...@googlegroups.com
Hi, if you want LK, you should use this function calcOpticalFlowPyrLK. But I'm not sure that I understood your question right. OF LK is used for tracking of a set of points. You can extract them using SURF, but better to use something like FAST, goodFeaturesToTrack or even simple regular grid of points over frame.

In our implementation of AR application we used findCirclesGrid (get pattern here). It work better and faster than findChessboardCorners. Actually the performance is not realtime, but you can improve situation by parameters tuning.

Kirill

ChrisP

unread,
Aug 30, 2011, 8:22:16 AM8/30/11
to android-opencv
I'd like to do something like this:
http://www.youtube.com/watch?v=qy6z8RaKQ9g

e.g. position certain objects on the camera view of a paper map. I
have a png or jpg image of the map and can find features with FAST or
the other methods you mentioned. If I understood you right I need then
OF LK to track these features.

ChrisP

On Aug 30, 1:33 pm, Kirill Kornyakov <kirill.kornya...@itseez.com>
wrote:
> Hi, if you want LK, you should use this function
> calcOpticalFlowPyrLK<http://opencv.itseez.com/trunk/modules/video/doc/motion_analysis_and_...>.
> But
> I'm not sure that I understood your question right. OF LK is used for
> tracking of a set of points. You can extract them using SURF, but better to
> use something like FAST, goodFeaturesToTrack or even simple regular grid of
> points over frame.
>
> In our implementation of AR application we used
> findCirclesGrid<http://opencv.itseez.com/trunk/modules/calib3d/doc/camera_calibration...>
> (get
> pattern here<https://code.ros.org/trac/opencv/browser/trunk/opencv/doc/acircles_pa...>).
> It work better and faster than
> findChessboardCorners<http://opencv.itseez.com/trunk/modules/calib3d/doc/camera_calibration...>.

Kirill Kornyakov

unread,
Aug 30, 2011, 8:49:10 AM8/30/11
to android...@googlegroups.com
Ok, I see. Nice project this http://www.popcode.info. My advice is to start from implementation of the full pipeline in C++ on a desktop. First of all we should get robust pose estimation, but it is not trivial in some cases. In our experiments FAST didn't give us robust results and we switched to SURF.

On Tue, Aug 30, 2011 at 4:22 PM, ChrisP <paus...@googlemail.com> wrote:
I'd like to do something like this:

ChrisP

unread,
Aug 31, 2011, 4:54:48 AM8/31/11
to android-opencv
This looks like some good info to start from. Thank you!

On Aug 30, 2:49 pm, Kirill Kornyakov <kirill.kornya...@itseez.com>
wrote:
> Ok, I see. Nice project thishttp://www.popcode.info. My advice is to start
> from implementation of the full pipeline in C++ on a desktop. First of all
> we should get robust pose estimation, but it is not trivial in some cases.
> In our experiments FAST didn't give us robust results and we switched to
> SURF.
>
> For more information please check these tutorials:
>
>    1.
>    http://opencv.itseez.com/trunk/doc/tutorials/features2d/feature_homog...
>    2.
>    http://opencv.itseez.com/trunk/doc/tutorials/features2d/detection_of_...
>    3.http://opencv.itseez.com/trunk/doc/user_guide/ug_features2d.html
>    4. And the full page:
>    http://opencv.itseez.com/trunk/doc/tutorials/features2d/table_of_cont...
>
> Kirill
>
>
>
>
>
>
>
> On Tue, Aug 30, 2011 at 4:22 PM, ChrisP <pausch...@googlemail.com> wrote:
> > I'd like to do something like this:
> >http://www.youtube.com/watch?v=qy6z8RaKIQ9g<http://www.youtube.com/watch?v=qy6z8RaKQ9g>
Reply all
Reply to author
Forward
0 new messages