opencv - 指纹图像中的感兴趣区域

标签 opencv fingerprint

我正在使用 OpenCV 进行指纹识别项目。目前我需要提取指纹的内部区域(图像中的椭圆),但我不知道该怎么做。

enter image description here

任何建议表示赞赏。

编辑 :

我需要检查来自传感器设备的指纹和来自身份证的另一个指纹是否匹配。传感器中的指纹如下(左),身份证中的指纹为右指纹。为了验证它们,需要分割这个指纹(椭圆外不提供有用的信息,但确实为此添加了“噪音”)。

enter image description here

谢谢你。

最佳答案

为清楚起见,@API55 的评论是正确的:

create a mask (white inside the ellipse and black outside) you can do this with ellipse function and -1 in the thickness. Then copy the image using the mask (bitwise_and for python or copyTo for c++ should do it)... you will always have a squared image, but you will have black (or the color you want) outside the ellipse



这些步骤非常到位,
  • 在图像中的正确位置创建圆形蒙版
  • 使用该掩码复制图像
  • 您的新图像包含 mask 数据和其他任何地方的黑色数据。

  • 以下是如何在代码中实现此功能的示例:

    (我亲切地从here借来的)
    Mat img = imread("small1.png", 0); // load gray
    Rect region(10,10,40,40); // example roi
    Mat roi(img, region);  // part of img
    Mat mask(Size(40,40), CV_8U, Scalar(0)); // all black
    circle(mask, Point(20,20), 20, Scalar(255), -1, LINE_AA); // filled circle
    Mat circRoi;
    bitwise_and(roi, roi, circRoi, mask); // retain only pixels inside the circle
    //
    // now you can do your intensity calculation on circRoi
    //
    imshow("circle masked", mask);
    imshow("masked roi", circRoi);
    waitKey();
    

    有用的链接
  • Why ROIs don't have to be circular but Mats do
  • Older code example, useful for learning the theory but I wouldnt recommend implementing using IPLimage
  • Creating a custom ROI of any shape or size
  • 关于opencv - 指纹图像中的感兴趣区域,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50101871/

    相关文章:

    opencv - OpenNI 文件格式 (ONI)

    android - 如何使用 JNI+OpenCV+NDK 获取原始的 android 相机传感器图像数据?

    opencv - 安装opencv AWS实例

    java - 指纹匹配算法!

    java - 如何使用 android 设备身份验证指纹扫描仪生成指纹图像/其他选项是什么?

    c++ - 使用多线程调试 DLL (/MDd) C 运行时库构建静态 Opencv 库

    eclipse - eclipse pydev 中的 anaconda opencv Unresolved 导入

    proxy - 使用代理时,停止在 TCP/IP 堆栈指纹中检测到 linux?

    fingerprint - 打算启动指纹注册屏幕

    java - Java 指纹识别器