我的代码运行良好,但是当它提取关键点时,它与两个图像匹配得很差.在这里你可以找到我的代码,但我不知道如何绘制好的匹配JAVA Android
descriptors = new Mat();
keypoints = new MatOfKeyPoint();
detector = FeatureDetector.create(FeatureDetector.ORB);
detector.detect(img1, keypoints);
descriptor = DescriptorExtractor.create(DescriptorExtractor.ORB);
descriptor.compute(img1, keypoints, descriptors);
matcher = DescriptorMatcher.create(DescriptorMatcher.BRUTEFORCE_HAMMING);
ColorDetection.cvt_YUVtoRGBtoHSV(mYuv,mGraySubmat);
MatOfKeyPoint mKeyPoints = new MatOfKeyPoint();
MatOfDMatch matches = new MatOfDMatch();
detector.detect(mGraySubmat, mKeyPoints);
descriptor.compute(mGraySubmat, mKeyPoints, mIntermediateMat);
matcher.match(mIntermediateMat,descriptors,matches);
mIntermediateMat2.create(resultSize, CvType.CV_8UC1);
Features2d.drawMatches(img1, keypoints, mGraySubmat, mKeyPoints, matches,
mIntermediateMat2,GREEN, RED, MATCH_MASK, Features2d.NOT_DRAW_SINGLE_POINTS);
Imgproc.resize(mIntermediateMat2, mIntermediateMat2, mRgba.size());
Imgproc.cvtColor(mIntermediateMat2, mRgba, Imgproc.COLOR_RGBA2BGRA, 4);
Utils.matToBitmap(mRgba, bmp);
DMatch dm[] = matches.toArray();
List<Point> lp1 = new ArrayList<Point>(dm.length);
List<Point> lp2 = new ArrayList<Point>(dm.length);
KeyPoint tkp[] = keypoints.toArray(); …Run Code Online (Sandbox Code Playgroud) 我有一个很大的 json 文件,大小约为 40Gb。当我尝试将此对象数组文件转换为 java 对象列表时,它崩溃了。我已经使用了最大堆的所有大小xmx,但没有任何效果!
public Set<Interlocutor> readJsonInterlocutorsToPersist() {
String userHome = System.getProperty(USER_HOME);
log.debug("Read file interlocutors "+userHome);
try {
ObjectMapper mapper = new ObjectMapper();
// JSON file to Java object
Set<Interlocutor> interlocutorDeEntities = mapper.readValue(
new File(userHome + INTERLOCUTORS_TO_PERSIST),
new TypeReference<Set<Interlocutor>>() {
});
return interlocutorDeEntities;
} catch (Exception e) {
log.error("Exception while Reading InterlocutorsToPersist file.",
e.getMessage());
return null;
}
}
Run Code Online (Sandbox Code Playgroud)
有没有办法使用读取此文件BufferedReader,然后逐个对象推送?
我已将我的操作系统从12.04更新到ubuntu 14.04,当我尝试重新加载我的Symfony2项目时,我收到此错误:
You don't have permission to access /app_dev.php/ on this server.
Run Code Online (Sandbox Code Playgroud)
这是我的apache2文件:
<VirtualHost *:80>
ServerName s**a
ServerAlias d**n
# Indexes + Directory Root.
DirectoryIndex index.html index.php
DocumentRoot /home/****/
<Directory />
Options -Indexes +FollowSymLinks
Require all granted
</Directory>
<DirectoryMatch .*\.svn/.*>
Deny From All
</DirectoryMatch>
# Logfiles
</VirtualHost>
PS : it works well before the update !
Run Code Online (Sandbox Code Playgroud)