[英]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.