我正在开发一款Android应用程序,用于计算使用OpenCV for Android的图片中所显示的多米诺骨牌片的所有点数的总和.

问题是,我找不到一种方法来过滤其他轮廓并只计算我在多米诺骨牌中看到的点,我试图使用Canny边缘找到然后使用HoughCircles,但没有结果,因为我没有绝对的顶部岩石和HoughCircles的视图只检测完美的圆圈:)
这是我的代码:
public Mat onCameraFrame(Mat inputFrame) {
inputFrame.copyTo(mRgba);
Mat grey = new Mat();
// Make it greyscale
Imgproc.cvtColor(mRgba, grey, Imgproc.COLOR_RGBA2GRAY);
// init contours arraylist
List<MatOfPoint> contours = new ArrayList<MatOfPoint>(200);
//blur
Imgproc.GaussianBlur(grey, grey, new Size(9,9), 10);
Imgproc.threshold(grey, grey, 80, 150, Imgproc.THRESH_BINARY);
// because findContours modifies the image I back it up
Mat greyCopy = new Mat();
grey.copyTo(greyCopy);
Imgproc.findContours(greyCopy, contours, new Mat(), Imgproc.RETR_TREE, Imgproc.CHAIN_APPROX_NONE);
// Now I have my controus pefectly
MatOfPoint2f mMOP2f1 = new MatOfPoint2f();
//a list for …Run Code Online (Sandbox Code Playgroud) 我是CV领域的新手,我的任务相对简单,我想分析多米诺骨牌的价值观.
我使用了blob分析方法,因为我使用的是纯Java代码,它往往比原生C慢.后台数据因为它可能有blob而导致我出现问题.
经过太多的阅读后,我通过'模板匹配'方法听起来对我来说是最好的,因为它的资源需求和旋转/缩放容差很小,我可以轻松保存每一块多米诺骨牌的模板,然后在即将到来的时候匹配它图像用于分析和计数.
现在我想要的只是你对可以帮助我实现模板匹配的库/方法的指导,我更喜欢纯java,但如果没有找到选择,可以使用本机C库.
PS:如果您发现我选择的算法有误,请向我提供您的建议.