1

What is the equivalent of "ismember" of matlab in opencv?

I am trying to convert a matlab code to opencv ( C/CPP ). For this I need to convert the below step to Opencv. Can some one please guide me in this regard?

[Lia Locb1] = ismember(tl(:,1),ind3);

  where Mat tl = Mat::ones(106, 3, CV_8U); and
        ind3 = find(Sm(:,1) >= xm & Sm(:,1) <= xM & Sm(:,2) >= ym & Sm(:,2) <= yM);
2vision2
  • 4,933
  • 16
  • 83
  • 164

1 Answers1

1

It's not really equivalent, but if a is a scalar ismember(a,b) can be replaced by any(a==b).

Not sure if this helps you in OpenCv, otherwise you can ofcourse always replace ismember by a simple loop to check equality of a with all elements in b.

Dennis Jaheruddin
  • 21,208
  • 8
  • 66
  • 122