对于我的论文,我试图用图片处理一些事情,完成它的步骤之一是在图片中找到角落。经过一番冲浪,我发现它可以用 Moravec 的角点检测算法来实现。幸运的是,我发现 JFeatureLib 已经在此链接上实现了 Moravec 算法:https ://code.google.com/p/jfeaturelib/source/browse/src/main/java/de/lmu/ifi/dbs/jfeaturelib/ pointDetector/Moravec.java?r=8d96a8fa9a43a0ec7e7084b40169be56bddd6f36
(当然我在Eclipse的构建路径中导入了JFeatureLib给出的jar文件)所以我在我的项目中使用了链接处的代码,并编写了一些代码来调用它。这是我创建框架、打开图片并在该链接处调用 Moravec 算法的代码:
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
public class Compare{
public Compare(){
JFrame frame = new JFrame("Find corners in picture");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel panel = (JPanel)frame.getContentPane();
JLabel label = new JLabel();
label.setIcon(new ImageIcon("house.jpg"));
panel.add(label);
frame.setLocationRelativeTo(null);
frame.pack();
frame.setVisible(true);
}
public static void main (String[] args){
SwingUtilities.invokeLater(new Runnable(){
public void run(){
new Compare();
}
});
Moravec picture = new Moravec();
}
}
关键是它在行上返回错误
Moravec picture = new Moravec();
错误是这样的:
Exception in thread "main" java.lang.UnsupportedClassVersionError: de/lmu/ifi/dbs/jfeaturelib/pointDetector/PointDetector : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(Unknown Source)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(Unknown Source)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at Compare.main(Compare.java:32)
你能给我一些建议吗?非常感谢!