Jürgen K.
Jürgen K.

Reputation: 3487

How to check MatOfKeyPoint in java?

How to check if a MatOfKeyPoints is empty or not?

MatOfKeyPoint matOfKeyPoint = new MatOfKeyPoint();

What I need is something like

    if(matOfKeyPoint.size() != 1x0){
    //..............................
    }

The Error is as below:

Multiple markers a this line:
Syntax Error on token "x0",delete this token
Incompatible operand types size and int

Any idea how to solve this problem?

Any help would be appreciated.

Upvotes: 4

Views: 422

Answers (1)

Juvanis
Juvanis

Reputation: 25950

1x0 is not a valid hex integer in Java. matOfKeyPoint.size() has return type of Size.

You should use:

if(matOfKeyPoint.empty())

Upvotes: 2

Related Questions