在java fxml上检测图像中的四个点

在java fxml上检测图像中的四个点,java,image-processing,fxml,corner-detection,marvin-framework,Java,Image Processing,Fxml,Corner Detection,Marvin Framework,我正在开发一个扫描仪程序,我必须检测图像的四个角,但由于我是java初学者,所以我无法检测到它。 我有它的马文框架,但它给了我一些其他的点,而不是实际的点 private Point[] boundaries(MarvinAttributes attr){ Point upLeft = new Point(-1,-1); Point upRight = new Point(-1,-1); Point bottomLeft = new Point(-1,-1);

我正在开发一个扫描仪程序,我必须检测图像的四个角,但由于我是java初学者,所以我无法检测到它。 我有它的马文框架,但它给了我一些其他的点,而不是实际的点

 private Point[] boundaries(MarvinAttributes attr){
    Point upLeft = new Point(-1,-1);
    Point upRight = new Point(-1,-1);
    Point bottomLeft = new Point(-1,-1);
    Point bottomRight = new Point(-1,-1);
    double ulDistance=9999,blDistance=9999,urDistance=9999,brDistance=9999;
    double tempDistance=-1;
    int[][] cornernessMap = (int[][]) attr.get("cornernessMap");
    System.out.println(cornernessMap[0].length);
    for(int x=0; x<cornernessMap.length; x++){
        for(int y=0; y<cornernessMap[0].length; y++){
            if(cornernessMap[x][y] > 0){
                if((tempDistance = Point.distance(x, y, 0, 0)) < ulDistance){
                    upLeft.x = x; upLeft.y = y;
                    ulDistance = tempDistance;
                } 
                if((tempDistance = Point.distance(x, y, cornernessMap.length, 0)) < urDistance){
                    upRight.x = x; upRight.y = y;
                    urDistance = tempDistance;
                }
                if((tempDistance = Point.distance(x, y, 0, cornernessMap[0].length)) < blDistance){
                    bottomLeft.x = x; bottomLeft.y = y;
                    blDistance = tempDistance;
                }
                if((tempDistance = Point.distance(x, y, cornernessMap.length, cornernessMap[0].length)) < brDistance){
                    bottomRight.x = x; bottomRight.y = y;
                    brDistance = tempDistance;
                }
            }
        }
    }
    return new Point[]{upLeft, upRight, bottomRight, bottomLeft};
}
 static {
    MarvinDefinitions.setImagePluginPath("D:\\marvin\\marvin\\plugins\\image\\");
}  
private Point[]边界(MarvinAttributes attr){
点Ft=新点(-1,-1);
点垂直=新点(-1,-1);
点底部左=新点(-1,-1);
右下角点=新点(-1,-1);
双ulDistance=9999,blDistance=9999,urDistance=9999,brDistance=9999;
双温度距离=-1;
int[][]角落地图=(int[][])属性获取(“角落地图”);
System.out.println(cornernessMap[0].长度);

对于(int x=0;x)任何图像的四个角是(0,0)(宽度-1,0)(0,高度-1)(宽度-1,高度-1),请阅读。您想要什么还不清楚。您可以提供指向您正在使用的图像的链接吗?这样我就可以使用相同的图像运行您的应用程序,并查看发生了什么!