Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Removing selected rows from a Mat ?

For some reasons I need to filter out rows of a Mat. (I need to filter out some descriptors of ORB)

Which way do you suggest me? I haven't find any method to remove a single row from a Mat. So I was thinking I could iteratively inserting the good rows in a new Mat.

C++ pseudocode:

Mat desc;
ORB(myImage,cv::noArray,kp,desc);
matcher->match( myPreviousDesc, desc, matches );

for(auto i=0;i<matches.size();i++) {
   if (some conditions) {
      Remove the ith row of desc:
      erase( desc.row( matches[i].queryIdx ) );
   }
}

? How would you erase a single row from a Mat after checking for some conditions ?

Removing selected rows from a Mat ?

For some reasons I need to filter out rows of a Mat. (I need to filter out some descriptors of ORB)

Which way do you suggest me? I haven't find any method to remove a single row from a Mat. So I was thinking I could iteratively inserting the good rows in a new Mat.

C++ pseudocode:

Mat desc;
ORB(myImage,cv::noArray,kp,desc);
matcher->match( myPreviousDesc, desc, matches );

for(auto i=0;i<matches.size();i++) {
   if (some conditions) {
      Remove the ith row of desc:
      erase( desc.row( matches[i].queryIdx ) );
   }
}

? How would you erase a single row from a Mat after checking for some conditions (or adding only the selected row in a new Mat) ?

Removing selected rows from a Mat ?

For some reasons I need to filter out rows of a Mat. (I need to filter out some descriptors of ORB)

Which way do you suggest me? I haven't find any method to remove a single row from a Mat. So I was thinking I could iteratively inserting the good rows in a new Mat.

C++ pseudocode:

Mat desc;
ORB(myImage,cv::noArray,kp,desc);
matcher->match( myPreviousDesc, desc, matches );

for(auto i=0;i<matches.size();i++) {
   if (some conditions) {
      Remove the ith row of desc:
      erase( desc.row( matches[i].queryIdx ) );
   }
}

? How would you erase a single row from a Mat after checking for some conditions (or adding only the selected row in a new Mat) ?

Removing selected rows from a Mat ?

For some reasons I need to filter out rows of a Mat. (I need to filter out some descriptors of ORB)

Which way do you suggest me? I haven't find any method to remove a single row from a Mat. So I was thinking I could iteratively inserting the good rows in a new Mat.

C++ pseudocode:

Mat desc;
ORB(myImage,cv::noArray,kp,desc);
matcher->match( myPreviousDesc, desc, matches );

for(auto i=0;i<matches.size();i++) {
   if (some conditions) {
      Remove the ith row of desc:
      erase( desc.row( matches[i].queryIdx ) );
   }
}

? How would you erase a single row from a Mat after checking for some conditions (or adding only the selected row in a new Mat) ?