ermig1979 / Simd

C++ image processing and machine learning library with using of SIMD: SSE, AVX, AVX-512, AMX for x86/x64, VMX(Altivec) and VSX(Power7) for PowerPC, NEON for ARM.
http://ermig1979.github.io/Simd
MIT License
2.01k stars 407 forks source link

Question about shift detector #250

Open axllou opened 1 year ago

axllou commented 1 year ago

Hello,

In the function SearchLocalMin(), there are three places which return false. I wonder at the last one. Isn't the final result which is the minimal of all stageCount still trustable?

Thank you, Park

ermig1979 commented 1 year ago

Hi, Park!

The last return of false is the case when no any shifts with local minimum of difference were found.

Sincerely Ihar.

axllou commented 1 year ago

input1 input0

Hi, I find the result of shift detector would be unstable if I adjusts the ROI. I also attach two test images, could you help verify my question please? My settings are: set input0 as background image, input1 as current image, pyramid level to 2, and search range to 32. I list 4 test cases as below:

  1. ROI (left, right, top, bottom) = (8, 28, 207, 297), the shift result (X, Y) will be (-14, 2), I think the answer is close to correct answer.
  2. ROI (left, right, top, bottom) = (8, 28, 207, 295), this will get error return from the last return in function SearchLocalMin(), as I stated previously.
  3. ROI (left, right, top, bottom) = (8, 28, 207, 287), the shift result (X, Y) will be (-14, 2).
  4. ROI (left, right, top, bottom) = (8, 28, 207, 285), the shift result (X, Y) will be (-1, 0).

Thank you. Park

ermig1979 commented 1 year ago

As I can see you try to use Shift Detector to track a person in left part of image? I think that is not good idea because: 1) Person figure has variable shape. 2) It's shape doesn'tclose to rectangle. 3) The object is small enough.

To correct work of Shift Detector the object must be: 1) Big enough. 2) Has stable form (or has stable main part) and stable texture. 3) Object shift must be not large. 4) Object form must be close to rectangle.

There examples of such objects: 1) Whole frame. 2) Car in the foreground 3) Face in the foreground These objects I tracked with using of Shift Detector.

axllou commented 1 year ago

Hi,

For variable shape, do you have suggestions of which kind of searching algorithm is suitable to detect?

Thanks, Park

ermig1979 commented 1 year ago

Hi.

If you want to detect objects of certain type then the best method is using of detectors based of neural network. There are many pretrained models to detect different objects and many frameworks to infer them. For example: OpenVINO, ONNXRuntime, Synet and so on.

If you want to detect object of arbitrary type then I would recommend to use motion detectors. For example Simd::Motion.

Ihar.