compute inlier count c++ code