ARM-software / ComputeLibrary

The Compute Library is a set of computer vision and machine learning functions optimised for both Arm CPUs and GPUs using SIMD technologies.
2.87k stars 783 forks source link

[Question] In optFlow newPoints array descriptors are always empty #689

Closed vswdigitall closed 5 years ago

vswdigitall commented 5 years ago

Hi ACL,

ACL 19.02, built for CL, aarch64, FriendlyArm nanopi NEO4.

Why in optFlow new points descriptors always empty (only x,y, status computed ) such as error, orintation..?

pyramidInfo.init( 1, arm_compute::SCALE_PYRAMID_HALF, arm_compute::TensorShape( image.cols, image.rows ), arm_compute::Format::U8 );
            prevPyramid.init( pyramidInfo );
            pyramid.init( pyramidInfo );
            prevPts = arm_compute::CLKeyPointArray{ optFlowMaxPoints };
            pts = arm_compute::CLKeyPointArray{ optFlowMaxPoints };
            estimatedPts = arm_compute::CLKeyPointArray{ optFlowMaxPoints };
            prevPts.resize( optFlowMaxPoints );
            estimatedPts.resize( optFlowMaxPoints );
prevGausPyramid.configure( & clPrevRect, & prevPyramid, arm_compute::BorderMode::UNDEFINED, 0 );
            gausPyramid.configure( & clRect, & pyramid, arm_compute::BorderMode::UNDEFINED, 0 );
            optFlow.configure( & prevPyramid, & pyramid, & prevPts, & estimatedPts, & pts,
                               arm_compute::Termination::TERM_CRITERIA_BOTH, optFlowEps, optFlowIters, optFlowWinSize, false, arm_compute::BorderMode::UNDEFINED );
arm_compute::KeyPoint kpt{};
            kpt.x = pt.x;
            kpt.y = pt.y;
            kpt.tracking_status = 1;

How can i use estimated array?

Best regards, Viktor.

morgolock commented 5 years ago

Hi @vswdigitall

Could you please try using at least 3 levels for the pyramid? pyramidInfo.init( 3, arm_compute::SCALE_PYRAMID_HALF, arm_compute::TensorShape( image.cols, image.rows ), arm_compute::Format::U8 );

vswdigitall commented 5 years ago

Have tried 3 levels, but still zeros.

morgolock commented 5 years ago

Hi @vswdigitall

Would you please confirm that the problem you describe is that you get the output keypoints but the fields strength, scale, orientation, status and error are empty?

vswdigitall commented 5 years ago

Yes, it is. I have checked many times.

morgolock commented 5 years ago

Hi @vswdigitall

The struct Keypoint used in optical flow is also used by other functions, in particular by the corner detectors harris corners and fast corners. Not all the members are used in some functions, optical flow would only output the new point coordinates and the status.

ACL's vision functions are based on the OpenVX spec, please take a look at the documentation of the keypoint struct for more details: https://www.khronos.org/registry/OpenVX/specs/1.0/html/d4/dae/group__group__basic__features.html#d6/db0/structvx__keypoint__t

vswdigitall commented 5 years ago

Ok. Thanks. Closed.