Giter VIP home page Giter VIP logo

pcb_measurement's Introduction

image# 电路板元器件高度检测

b765541dc4732b730289c69794252549.mp4

本程序中3D数据采集功能使用的是XEMA开源工业3D相机(开源地址:https://github.com/open3dv/xema)

本程序使用到SIFT算子,需要依赖opencv4.5以上版本

由于算法中使用的是sift特征模版匹配,要求电路板上有足够的纹理特征以得到较好的匹配效果。另一个要求是电路板必须是类平面物体,否则用2D匹配会不准确

此电路板不能认为是类平面物体,因为元器件高度太高

微信图片_20230703142455

此电路板可以认为是类平面物体

微信图片_20230703142502

如何设置模板

首先需要准备一张电路板正面拍摄的图片。图片无畸变,切电路板四条边与图片的边重合。 model

接下来编辑model.xml文件,格式如下。reference_points即电路板平面的参考点。target_points即要检测的点。 这些点的XY坐标都是模板图片内的坐标。

<?xml version="1.0"?>
<opencv_storage>
    <reference_points>
        <rp1>
            <x> 380 </x>
            <y> 60 </y>
        </rp1>
        <rp2>
            <x> 380 </x>
            <y> 235 </y>
        </rp2>
        <rp3>
            <x> 97 </x>
            <y> 144 </y>
        </rp3>
    </reference_points>
    <target_points>
        <tp1>
            <x> 336 </x>
            <y> 65 </y>
        </tp1>
        <tp2>
            <x> 340 </x>
            <y> 179 </y>
        </tp2>
        <tp3>
            <x> 332 </x>
            <y> 217 </y>
        </tp3>
        <tp4>
            <x> 335 </x>
            <y> 268 </y>
        </tp4>
    </target_points>
</opencv_storage>

算法流程图

    graph TB
    A(简历模板)
    B[拍摄工件2D图并剪裁]
    C[记录参考点坐标]
    D[记录测量点坐标]
    E[保存成XML格式]
    A-->B-->C
    B-->D
    C-->E
    D-->E

    F(测量高度)
    G[读取模板]
    H[相机拍摄3D点云]
    I[模板匹配]
    J[根据参考点建立参考平面]
    K[输出测量点相对参考平面的高度]
    F-->G-->H-->I-->J-->K-->H
Loading

pcb_measurement's People

Contributors

vic-w avatar

Watchers

 avatar

Forkers

pengguanjun

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.