# Feature Point Tracking

- enum FadasFPTPipeline\_e

    - Algorithm pipeline specifying what algorithm pipeline is run by subsequent calls to [FadasFPT\_Run()](https://docs.qualcomm.com/doc/80-63309-1/topic/feature-point-tracking.html#group__fpt_1gafb02b5b2b47f99c2e5a1945282d13e7e) and [FadasFPT\_RunMT()](https://docs.qualcomm.com/doc/80-63309-1/topic/feature-point-tracking.html#group__fpt_1ga4128d724dda29428399503599dff8ee9).

- Param FADAS\_FPT\_PIPELINE\_LK:

    - Track feature points from images using the Lucas-Kanade tracking.

- Param FADAS\_FPT\_PIPELINE\_LK\_PRED:

    - Track feature points from images using the Lucas-Kanade tracking just like FADAS\_FPT\_PIPELINE\_LK except that the caller of [FadasFPT\_Run()](https://docs.qualcomm.com/doc/80-63309-1/topic/feature-point-tracking.html#group__fpt_1gafb02b5b2b47f99c2e5a1945282d13e7e) and [FadasFPT\_RunMT()](https://docs.qualcomm.com/doc/80-63309-1/topic/feature-point-tracking.html#group__fpt_1ga4128d724dda29428399503599dff8ee9) fills the point locations with predicted locations for the second frame.

*Values:*

- enumerator FADAS\_FPT\_PIPELINE\_LK

    - LK tracking.

- enumerator FADAS\_FPT\_PIPELINE\_LK\_PRED

    - LK tracking (predicted locations)

- enumerator FADAS\_FPT\_PIPELINE\_MAX

    - Do not use.

- [FadasError\_e](https://docs.qualcomm.com/doc/80-63309-1/topic/enum_fadas_8h_1a280abf443019bfc722ac1158e5fe1013.html#_CPPv412FadasError_e) FadasFPT\_Init(const char \*licenseKey)

    - Initialize feature point tracking. **WARNING:** Must be called once before other FastADAS functions except [FadasVersion()](https://docs.qualcomm.com/doc/80-63309-1/topic/misc.html#group__misc_1ga55cbdff48d751f2a0227ae4ac106d746).

- Parameters:

    - **licenseKey** – Pointer to the license key string.

- Returns:

    - [FADAS\_ERROR\_NONE](https://docs.qualcomm.com/doc/80-63309-1/topic/enum_fadas_8h_1a280abf443019bfc722ac1158e5fe1013.html#fadas_8h_1a280abf443019bfc722ac1158e5fe1013aea09a4171f0866f38326d7e5323f2d12) — Success.

- [FadasError\_e](https://docs.qualcomm.com/doc/80-63309-1/topic/enum_fadas_8h_1a280abf443019bfc722ac1158e5fe1013.html#_CPPv412FadasError_e) FadasFPT\_DeInit(void)

    - Deinitialize feature point tracking. **WARNING:** Must be called once after all other FastADAS functions.

- Returns:

    - [FADAS\_ERROR\_NONE](https://docs.qualcomm.com/doc/80-63309-1/topic/enum_fadas_8h_1a280abf443019bfc722ac1158e5fe1013.html#fadas_8h_1a280abf443019bfc722ac1158e5fe1013aea09a4171f0866f38326d7e5323f2d12) — Success.

- [FadasFPT\_t](https://docs.qualcomm.com/doc/80-63309-1/topic/typedef_fadas_f_p_t_8h_1a25edfaa8ae519baa2ea9a56ec431fee5.html#_CPPv410FadasFPT_t) \*FadasFPT\_Create([FadasFPTPipeline\_e](https://docs.qualcomm.com/doc/80-63309-1/topic/enum_group__fpt_1ga3d09ede5fee2a4fa39ace5e974e793c3.html#_CPPv418FadasFPTPipeline_e) ePipeline, const [FadasImgProps\_t](https://docs.qualcomm.com/doc/80-63309-1/topic/struct_fadas_img_props__t.html#_CPPv415FadasImgProps_t) &imgProps, int32\_t srchSize, int32\_t pyrmd\_lvls)

    - Create feature point tracking object.

- Parameters:

    - - **ePipeline** – Descriptor of execution pipeline to use.
- **imgProps** – Image properties, must match properties of the srcImg parameter in [FadasFPT\_Run()](https://docs.qualcomm.com/doc/80-63309-1/topic/feature-point-tracking.html#group__fpt_1gafb02b5b2b47f99c2e5a1945282d13e7e).
- **srchSize** – Search size which equates to a srchSize x srchSize patch in algorithms using a square patch.
- **pyrmd\_lvls** – Number of pyramid levels to use in algorithms that utilize them.

- Returns:

    - Pointer to object.

- [FadasError\_e](https://docs.qualcomm.com/doc/80-63309-1/topic/enum_fadas_8h_1a280abf443019bfc722ac1158e5fe1013.html#_CPPv412FadasError_e) FadasFPT\_Destroy([FadasFPT\_t](https://docs.qualcomm.com/doc/80-63309-1/topic/typedef_fadas_f_p_t_8h_1a25edfaa8ae519baa2ea9a56ec431fee5.html#_CPPv410FadasFPT_t) \*obj)

    - Destroy feature point tracking (FPT) object.

- Parameters:

    - **obj** – Pointer to FPT object returned by [FadasFPT\_Create()](https://docs.qualcomm.com/doc/80-63309-1/topic/feature-point-tracking.html#group__fpt_1ga100fb69726a71b8dd7dfaf729d6f8820).

- Returns:

    - [FADAS\_ERROR\_NONE](https://docs.qualcomm.com/doc/80-63309-1/topic/enum_fadas_8h_1a280abf443019bfc722ac1158e5fe1013.html#fadas_8h_1a280abf443019bfc722ac1158e5fe1013aea09a4171f0866f38326d7e5323f2d12) — Success.

- [FadasError\_e](https://docs.qualcomm.com/doc/80-63309-1/topic/enum_fadas_8h_1a280abf443019bfc722ac1158e5fe1013.html#_CPPv412FadasError_e) FadasFPT\_Run([FadasFPT\_t](https://docs.qualcomm.com/doc/80-63309-1/topic/typedef_fadas_f_p_t_8h_1a25edfaa8ae519baa2ea9a56ec431fee5.html#_CPPv410FadasFPT_t) \*obj, [FadasImage\_t](https://docs.qualcomm.com/doc/80-63309-1/topic/struct_fadas_image__t.html#_CPPv412FadasImage_t) \*img0, [FadasImage\_t](https://docs.qualcomm.com/doc/80-63309-1/topic/struct_fadas_image__t.html#_CPPv412FadasImage_t) \*img1, [FadasROI\_t](https://docs.qualcomm.com/doc/80-63309-1/topic/struct_fadas_r_o_i__t.html#_CPPv410FadasROI_t) \*roi, int32\_t n\_pts, [float32\_t](https://docs.qualcomm.com/doc/80-63309-1/topic/typedef_fadas_8h_1a4611b605e45ab401f02cab15c5e38715.html#_CPPv49float32_t) \*x, [float32\_t](https://docs.qualcomm.com/doc/80-63309-1/topic/typedef_fadas_8h_1a4611b605e45ab401f02cab15c5e38715.html#_CPPv49float32_t) \*y, int32\_t \*status, int32\_t max\_iter, [float32\_t](https://docs.qualcomm.com/doc/80-63309-1/topic/typedef_fadas_8h_1a4611b605e45ab401f02cab15c5e38715.html#_CPPv49float32_t) epsilon, [float32\_t](https://docs.qualcomm.com/doc/80-63309-1/topic/typedef_fadas_8h_1a4611b605e45ab401f02cab15c5e38715.html#_CPPv49float32_t) \*x\_pred = nullptr, [float32\_t](https://docs.qualcomm.com/doc/80-63309-1/topic/typedef_fadas_8h_1a4611b605e45ab401f02cab15c5e38715.html#_CPPv49float32_t) \*y\_pred = nullptr)

    - Tracks feature points between images. Although time-based tracking is a typical use case, there is no notion of time built into the algorithm. Therefore, the second image can be from the same time but a different location to track changes in relative locations.

- Parameters:

    - - **obj** – Pointer to the FPT object returned by [FadasFPT\_Create()](https://docs.qualcomm.com/doc/80-63309-1/topic/feature-point-tracking.html#group__fpt_1ga100fb69726a71b8dd7dfaf729d6f8820).
- **img0** – Pointer to the input image frame data from time t = 0.
- **img1** – Pointer to the input image frame data from time t = 1.
- **roi** – Pointer to the specification of the ROI in which feature points should be tracked.
- **n\_pts** – Filled with the number of features to track.
- **x** – Pointer to the x values for the feature locations to track and update after the call with the new feature location if tracked successfully.
- **y** – Pointer to the y values for the feature locations to track and after the call with the new feature location if tracked successfully.
- **status** – Pointer to the status values for the locations of features found. A value of zero signifies that the feature was not successfully tracked. A value of one indicates that the feature was successfully tracked.
- **max\_iter** – An upper limit on the number of iterations to let the algorithm try in attempting to reach the targeted error.
- **epsilon** – Targeted limit to tracked pixel error.
- **x\_pred** – Optional pointer to the x values for the predicted feature locations in the second image (img1). Required for [FADAS\_FPT\_PIPELINE\_LK\_PRED](https://docs.qualcomm.com/doc/80-63309-1/topic/feature-point-tracking.html#group__fpt_1gga3d09ede5fee2a4fa39ace5e974e793c3afafb764e8ff90684a90a93566348290a).
- **y\_pred** – Optional pointer to the y values for the predicted feature locations in the second image (img1). Required for [FADAS\_FPT\_PIPELINE\_LK\_PRED](https://docs.qualcomm.com/doc/80-63309-1/topic/feature-point-tracking.html#group__fpt_1gga3d09ede5fee2a4fa39ace5e974e793c3afafb764e8ff90684a90a93566348290a).

- Returns:

    - [FADAS\_ERROR\_NONE](https://docs.qualcomm.com/doc/80-63309-1/topic/enum_fadas_8h_1a280abf443019bfc722ac1158e5fe1013.html#fadas_8h_1a280abf443019bfc722ac1158e5fe1013aea09a4171f0866f38326d7e5323f2d12) — Success.

- [FadasError\_e](https://docs.qualcomm.com/doc/80-63309-1/topic/enum_fadas_8h_1a280abf443019bfc722ac1158e5fe1013.html#_CPPv412FadasError_e) FadasFPT\_RunMT(void \*wrkrs, [FadasFPT\_t](https://docs.qualcomm.com/doc/80-63309-1/topic/typedef_fadas_f_p_t_8h_1a25edfaa8ae519baa2ea9a56ec431fee5.html#_CPPv410FadasFPT_t) \*obj, [FadasImage\_t](https://docs.qualcomm.com/doc/80-63309-1/topic/struct_fadas_image__t.html#_CPPv412FadasImage_t) \*img0, [FadasImage\_t](https://docs.qualcomm.com/doc/80-63309-1/topic/struct_fadas_image__t.html#_CPPv412FadasImage_t) \*img1, [FadasROI\_t](https://docs.qualcomm.com/doc/80-63309-1/topic/struct_fadas_r_o_i__t.html#_CPPv410FadasROI_t) \*roi, int32\_t n\_pts, [float32\_t](https://docs.qualcomm.com/doc/80-63309-1/topic/typedef_fadas_8h_1a4611b605e45ab401f02cab15c5e38715.html#_CPPv49float32_t) \*x, [float32\_t](https://docs.qualcomm.com/doc/80-63309-1/topic/typedef_fadas_8h_1a4611b605e45ab401f02cab15c5e38715.html#_CPPv49float32_t) \*y, int32\_t \*status, int32\_t max\_iter, [float32\_t](https://docs.qualcomm.com/doc/80-63309-1/topic/typedef_fadas_8h_1a4611b605e45ab401f02cab15c5e38715.html#_CPPv49float32_t) epsilon, [float32\_t](https://docs.qualcomm.com/doc/80-63309-1/topic/typedef_fadas_8h_1a4611b605e45ab401f02cab15c5e38715.html#_CPPv49float32_t) \*x\_pred = nullptr, [float32\_t](https://docs.qualcomm.com/doc/80-63309-1/topic/typedef_fadas_8h_1a4611b605e45ab401f02cab15c5e38715.html#_CPPv49float32_t) \*y\_pred = nullptr)

    - Multithreaded version of [FadasFPT\_Run()](https://docs.qualcomm.com/doc/80-63309-1/topic/feature-point-tracking.html#group__fpt_1gafb02b5b2b47f99c2e5a1945282d13e7e).

- Parameters:

    - - **wrkrs** – Worker pool created by [FadasFPT\_CreateWorkers()](https://docs.qualcomm.com/doc/80-63309-1/topic/feature-point-tracking.html#group__fpt_1ga3e4fed2bbb0562006470a230752c1817).
- **obj** – Pointer to the FPT object returned by [FadasFPT\_Create()](https://docs.qualcomm.com/doc/80-63309-1/topic/feature-point-tracking.html#group__fpt_1ga100fb69726a71b8dd7dfaf729d6f8820).
- **img0** – Pointer to the input image frame data from time t = 0.
- **img1** – Pointer to the input image frame data from time t = 1.
- **roi** – Pointer to specification of the ROI in which feature points should be tracked.
- **n\_pts** – Filled with the number of features to track.
- **x** – Pointer to the x values for the feature locations to track and update after the call with the new feature location if tracked successfully.
- **y** – Pointer to the y values for the feature locations to track and update after the call with the new feature location if tracked successfully.
- **status** – Pointer to the status values for the locations of features found. A value of zero signifies that the feature was not successfully tracked. A value of one indicates that the feature was successfully tracked.
- **max\_iter** – An upper limit on the number of iterations to let the algorithm try in attempting to reach the targeted error.
- **epsilon** – Targeted limit to tracked pixel error.
- **x\_pred** – Optional pointer to the x values for the predicted feature locations in the second image (img1). Required for [FADAS\_FPT\_PIPELINE\_LK\_PRED](https://docs.qualcomm.com/doc/80-63309-1/topic/feature-point-tracking.html#group__fpt_1gga3d09ede5fee2a4fa39ace5e974e793c3afafb764e8ff90684a90a93566348290a).
- **y\_pred** – Optional pointer to the y values for the predicted feature locations in the second image (img1). Required for [FADAS\_FPT\_PIPELINE\_LK\_PRED](https://docs.qualcomm.com/doc/80-63309-1/topic/feature-point-tracking.html#group__fpt_1gga3d09ede5fee2a4fa39ace5e974e793c3afafb764e8ff90684a90a93566348290a).

- Returns:

    - [FADAS\_ERROR\_NONE](https://docs.qualcomm.com/doc/80-63309-1/topic/enum_fadas_8h_1a280abf443019bfc722ac1158e5fe1013.html#fadas_8h_1a280abf443019bfc722ac1158e5fe1013aea09a4171f0866f38326d7e5323f2d12) — Success.

- void \*FadasFPT\_CreateWorkers(uint32\_t nThreads, int32\_t pThreadsAffinity[], [FadasFPTPipeline\_e](https://docs.qualcomm.com/doc/80-63309-1/topic/enum_group__fpt_1ga3d09ede5fee2a4fa39ace5e974e793c3.html#_CPPv418FadasFPTPipeline_e) ePipeline)

    - Creates a multithreaded worker pool for the feature point tracking feature.

- Parameters:

    - - **nThreads** – Requested number of threads; can limit to the maximum number of threads if requesting more than that limit. The maximum is the maximum number of physical or logical cores. If requesting 0 threads, use the maximum number.
- **pThreadsAffinity** – Array for setting threads affinity.
- **ePipeline** – Descriptor of execution pipeline to use.

- Returns:

    - Worker pool pointer.

- [FadasError\_e](https://docs.qualcomm.com/doc/80-63309-1/topic/enum_fadas_8h_1a280abf443019bfc722ac1158e5fe1013.html#_CPPv412FadasError_e) FadasFPT\_DestroyWorkers(void \*wrkrs)

    - Destroys a feature point tracking worker pool.

- Parameters:

    - **wrkrs** – Pointer to the worker pool created by [FadasFPT\_CreateWorkers()](https://docs.qualcomm.com/doc/80-63309-1/topic/feature-point-tracking.html#group__fpt_1ga3e4fed2bbb0562006470a230752c1817).

- Returns:

    - [FADAS\_ERROR\_NONE](https://docs.qualcomm.com/doc/80-63309-1/topic/enum_fadas_8h_1a280abf443019bfc722ac1158e5fe1013.html#fadas_8h_1a280abf443019bfc722ac1158e5fe1013aea09a4171f0866f38326d7e5323f2d12) — Success.

## Related examples

- [fpt/app.cpp](https://docs.qualcomm.com/doc/80-63309-1/topic/fpt.html)
- [fpt\_trcks/app.cpp](https://docs.qualcomm.com/doc/80-63309-1/topic/fpt-trcks.html)

Last Published: Sep 30, 2024

[Previous Topic
Feature Point Extraction](https://docs.qualcomm.com/bundle/publicresource/80-63309-1/topics/feature-point-extraction.md) [Next Topic
Histogram Of Gradients](https://docs.qualcomm.com/bundle/publicresource/80-63309-1/topics/histogram-of-gradients.md)