顶象差异点击识别验证算法

顶象差异点击识别验证算法

文章只提供学习,如有侵权请立即联系我。

在这里插入图片描述
对于这种 差异点击验证 可以通过算法进行 识别

还原图片之后
在这里插入图片描述

识别图片之后

在这里插入图片描述
说一下思路哈

思路懒得说了 反正 你通过深度学习能够获取更为准确的识别结果

但是我不想标数据集呀 只好写一个直接可以解决的代码进行解决了

下面我就贴一下我的代码了

唯一的确定就是 颜色 不同的 识别准确性不行 因为我做二值化处理了
所以 。。。。。。。。。。。。。。

好了 不多说了 上代码

public class IConUtil {
   

    static {
   
        try {
   
            if (SystemUtils.IS_OS_WINDOWS) {
   
               //要用到 opencv 
                String path = IConUtil.class.getResource("/win/x64/opencv_java3412.dll").getPath();
                System.load(path);
            } else if (SystemUtils.IS_OS_LINUX) {
   
                System.out.println("linux");
                System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
            }
        } catch (Exception e) {
   
            e.printStackTrace();
        }
    }



    public static void main(String[] args) {
   
    	//传入图片路径 返回图片的坐标
        String s = predict10("C:\\dx\\notun\\1639375094033bj.png");
        System.out.println(s);
    }

    /**
     * 识别图标
     *
     * @param originPath
     * @param iconPaths
     * @param totalPath
     */
    public static String predict(String originPath, String[] iconPaths, String totalPath) {
   
        Mat afterMat = Imgcodecs.imread(totalPath);
        String aferterPoint = "";
        for (int i = 0; i < iconPaths.length; i++) {
   
            double[] predict = predict(originPath, iconPaths[i]);
            if (predict.length > 0) {
   
                Imgproc.rectangle(afterMat, new Point(predict[0], predict[1]), new Point(predict[2], predict[3]), new Scalar(0, 0, 225));
            } else {
   
                return "";
            }
            int x = (int) (predict[0] + (predict[2] - predict[0]) / 2);
            int y = (int) (predict[1] + (predict[3] - predict[1]) / 2);
            aferterPoint += x + "," + y + "|";

            Imgproc.putText(afterMat, i + "", new Point(x, y), Imgproc.FONT_HERSHEY_COMPLEX, 1, new Scalar(0, 255, 0));

        }
        Imgcodecs
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值