简体   繁体   English

查找两个手签名图像OpenCv的相似性

[英]Find Similarity Of Two Hand Sign Images OpenCv

I am Working on Sign Translator Application For Handy People. 我正在为方便人员开发标志翻译器应用程序。 In My application User Will Give one sign image from camera or gallery given image will be compare with database images and show the result With Alphabetic Sign. 在“我的应用程序”中,“用户将给定一个来自摄像机或画廊的标志图像”,将给定的图像与数据库图像进行比较,并使用“字母标志”显示结果。

but my problem is i am not getting good similarity between two images Some Time result is accurate some time not. 但是我的问题是我在两个图像之间没有获得很好的相似性。 Please Refer me Some Idea Or source Code. 请参考我的一些想法或源代码。 Thanks in advance. 提前致谢。

 Scalar lowerThreshold =  new Scalar(0, 48, 80); // Blue color – lower hsv values
    Scalar upperThreshold = new Scalar(20, 255, 255); // Blue color – higher hsv values

    FeatureDetector detector = FeatureDetector.create(FeatureDetector.PYRAMID_FAST);
    DescriptorExtractor extractor = DescriptorExtractor.create(DescriptorExtractor.ORB);

    //orb orb bruteforce with filter method
    DescriptorMatcher matcher = DescriptorMatcher.create(DescriptorMatcher.BRUTEFORCE_HAMMING);
    //crash on surf flanbased


    Mat img1 = new Mat();
    Mat img2 = new Mat();


    Utils.bitmapToMat(defaultImage,img1);
    Utils.bitmapToMat(databaseImage,img2);



    Mat descriptors1 = new Mat();
    MatOfKeyPoint keypoints1 = new MatOfKeyPoint();
    detector.detect(img1, keypoints1);
    extractor.compute(img1, keypoints1, descriptors1);


    //second image

    Mat descriptors2 = new Mat();
    MatOfKeyPoint keypoints2 = new MatOfKeyPoint();
    detector.detect(img2, keypoints2);
    extractor.compute(img2, keypoints2, descriptors2);


    //matcher image descriptors
    MatOfDMatch matches = new MatOfDMatch();
    matcher.match(descriptors1,descriptors2,matches);

    //Filter matches by distance
    MatOfDMatch filtered = filterMatchesByDistance(matches);

    int total = (int) matches.size().height;
    int Match= (int) filtered.size().height;
    Log.d("LOG", "total:" + total + " Match:"+Match);

    int percent = (int)((Match * 100.0f) / total);
    if(percent>max){
        max=percent;
        maximumPercentage.setMaximum(percent);
        maximumPercentage.setImageId(id);
        imageId=id;
        Log.d("Maximum Percentage: ",String.valueOf(max)+"%");
        Log.d("MaxId: ",String.valueOf(imageId));
    }
    id++;
    Log.d("matchingOImages: ",String.valueOf(percent)+"%");

filter matching result method 过滤器匹配结果方法

 List<DMatch> matches_original = matches.toList();
    List<DMatch> matches_filtered = new ArrayList<DMatch>();

    int DIST_LIMIT = 30;
    // Check all the matches distance and if it passes add to list of filtered matches
    Log.d("DISTFILTER", "ORG SIZE:" + matches_original.size() + "");
    for (int i = 0; i < matches_original.size(); i++) {
        DMatch d = matches_original.get(i);
        if (Math.abs(d.distance) <= DIST_LIMIT) {
            matches_filtered.add(d);
        }
    }
    Log.d("DISTFILTER", "FIL SIZE:" + matches_filtered.size() + "");

    MatOfDMatch mat = new MatOfDMatch();
    mat.fromList(matches_filtered);
    return mat;

Ok well i think you just entered the modern age of neural networks. 好的,我认为您刚刚进入了神经网络的现代时代。 As it can be overwhelming how this stuff works, and often takes years of study, there are some shortcuts to get things done. 由于这种方法的工作原理可能不堪重负,并且通常需要花费多年的研究时间,因此存在一些捷径可以完成任务。

For the quickest result I think you might start here: ( Assuming you rather dont want to dive that deep into the innerworkings of a neural net, but rather would use existing software, or services ) https://cloud.google.com/automl/ 为了获得最快的结果,我认为您可以从这里开始:(假设您不想将其深入到神经网络的内部工作中,而是使用现有的软件或服务) https://cloud.google.com/automl /

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用OpenCV计算两个图像的相似度百分比 - Calculate percentage similarity of two images using OpenCV 找到java中两个图像之间的感知相似度 - find perceptual similarity between two images in java 如何使用java中的opencv的Imgproc.compareHist方法确定两个图像之间的相似度? - How to determine similarity between two images using Imgproc.compareHist method of opencv in java? 在 Android 中查找图像(位图)之间的相似性 - Find Similarity between images (Bitmap) in Android 测量Java或ImageMagick中两个图像的相似度 - Measure similarity of two images in Java or ImageMagick 计算两个“线条图”图像的图像相似度 - calculating image similarity of two “line drawing” images 在Java中使用OpenCV比较两个图像 - Comparing two images with OpenCV in Java 如何使用OpenCV访问两个图像中的每个像素并找到它们的绝对差异? (Android Studio) - How to access every pixel in two images and find their absolute difference using OpenCV? (Android Studio) 如何找到两个多行字符串之间的相似度百分比? - How do I find the percentage of similarity between two multiline Strings? OpenCV - 查找视频和图像上的黑板边缘 - OpenCV - find blackboard edges on video and images
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM