惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
T
Troy Hunt's Blog
Scott Helme
Scott Helme
T
Threat Research - Cisco Blogs
T
Tenable Blog
L
LINUX DO - 热门话题
V
Visual Studio Blog
I
Intezer
Blog — PlanetScale
Blog — PlanetScale
Cisco Talos Blog
Cisco Talos Blog
A
Arctic Wolf
C
Cyber Attacks, Cyber Crime and Cyber Security
F
Fortinet All Blogs
aimingoo的专栏
aimingoo的专栏
Know Your Adversary
Know Your Adversary
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
N
Netflix TechBlog - Medium
SecWiki News
SecWiki News
I
InfoQ
Microsoft Security Blog
Microsoft Security Blog
Project Zero
Project Zero
W
WeLiveSecurity
Microsoft Azure Blog
Microsoft Azure Blog
A
About on SuperTechFans
Recorded Future
Recorded Future
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Vercel News
Vercel News
S
Securelist
Spread Privacy
Spread Privacy
L
LangChain Blog
云风的 BLOG
云风的 BLOG
G
Google Developers Blog
MongoDB | Blog
MongoDB | Blog
Google DeepMind News
Google DeepMind News
Recent Commits to openclaw:main
Recent Commits to openclaw:main
D
Darknet – Hacking Tools, Hacker News & Cyber Security
C
CERT Recently Published Vulnerability Notes
罗磊的独立博客
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
The Last Watchdog
The Last Watchdog
Attack and Defense Labs
Attack and Defense Labs
博客园 - 司徒正美
Help Net Security
Help Net Security
L
Lohrmann on Cybersecurity
人人都是产品经理
人人都是产品经理
Forbes - Security
Forbes - Security
Hacker News - Newest:
Hacker News - Newest: "LLM"
PCI Perspectives
PCI Perspectives
博客园 - 【当耐特】
T
Tor Project blog

博客园 - 广阔之海

Halcon的三角函数 Halcon轮廓插值方法 C# 控件选项变化事件处理 深度学习执行速度不稳定的解决方法 Halcon - 深度学习 - 目标分类 Halcon 画一个时钟 Halcon 解方程(solve_matrix) C# 使用Serilog日志框架 Halcon 生成标定板 Halcon 中的形态学 Halcon的提取中心线算法 C# 消灭switch的面向映射编程 C#中Task的用法 Halcon 通过坐标轴过滤点云数据 C# 获取MySql的数据库结构信息 C# HttpClient的使用方法总结 MySql字符集导致特殊字符保存出错问题处理 Asp.Net Core 动态生成WebApi Asp.Net Core WebApi中集成Jwt认证
Halcon图像投影映射
广阔之海 · 2022-08-12 · via 博客园 - 广阔之海
*图像投影映射例程
read_image(Image, 'datacode/ecc200/ecc200_to_preprocess_001')
*取出二维码区域
binary_threshold(Image, Region, 'max_separability', 'dark', UsedThreshold)
*将区域做凸包
shape_trans(Region, RegionTrans, 'convex')
*取出边界转轮廓
gen_contour_region_xld(RegionTrans, Contours, 'border')
*分割轮廓
segment_contours_xld(Contours, ContoursSplit, 'lines', 5, 4, 2)
*去掉最短的轮廓
contour_point_num_xld(ContoursSplit, Length)
select_contours_xld(ContoursSplit, SelectedContours, 'contour_length', min(Length)+1, max(Length)+1, -0.5, 0.5)
sort_contours_xld(SelectedContours, SortedContours, 'lower_left', 'true', 'row')
*对轮廓拟合直线
LineRowBegin := []
LineColBegin := []
LineRowEnd := []
LineColEnd := []
count_obj(SortedContours, Number)
for Index:=1 to Number by 1
    select_obj(SortedContours, ObjectSelected, Index)
    fit_line_contour_xld(ObjectSelected, 'tukey', -1, 0, 5, 2, RowBegin, ColBegin, RowEnd, ColEnd, Nr, Nc, Dist)
    tuple_concat(LineRowBegin, RowBegin, LineRowBegin)
    tuple_concat(LineColBegin, ColBegin, LineColBegin)
    tuple_concat(LineRowEnd, RowEnd, LineRowEnd)
    tuple_concat(LineColEnd, ColEnd, LineColEnd)
endfor
*取4条直线的交点做成四边形
XCoordCorners := []
YCoordCorners := []
for Index:=1 to Number by 1
    if (Index == 1)
        Index1 := Number - 1
        Index2 := Index - 1
    else
        Index1 := Index - 2
        Index2 := Index - 1
    endif
    intersection_lines(LineRowBegin[Index1], LineColBegin[Index1], LineRowEnd[Index1], LineColEnd[Index1], \
                       LineRowBegin[Index2], LineColBegin[Index2], LineRowEnd[Index2], LineColEnd[Index2], \
                       Row, Col, IsOverlapping)
    tuple_concat(XCoordCorners, Row, XCoordCorners)
    tuple_concat(YCoordCorners, Col, YCoordCorners)
endfor
*将四边形的四个顶点按下图排序
*     1------2
*     |      |
*     3------4
XCoordCornersSorted := []
YCoordCornersSorted := []
tuple_sort_index(XCoordCorners, Indices)
TmpX := [XCoordCorners[Indices[0]], XCoordCorners[Indices[1]]]
TmpY := [YCoordCorners[Indices[0]], YCoordCorners[Indices[1]]]
tuple_sort_index(TmpY, Indices1)
tuple_concat(XCoordCornersSorted, [TmpX[Indices1[0]], TmpX[Indices1[1]]], XCoordCornersSorted)
tuple_concat(YCoordCornersSorted, [TmpY[Indices1[0]], TmpY[Indices1[1]]], YCoordCornersSorted)
TmpX := [XCoordCorners[Indices[2]], XCoordCorners[Indices[3]]]
TmpY := [YCoordCorners[Indices[2]], YCoordCorners[Indices[3]]]
tuple_sort_index(TmpY, Indices1)
tuple_concat(XCoordCornersSorted, [TmpX[Indices1[0]], TmpX[Indices1[1]]], XCoordCornersSorted)
tuple_concat(YCoordCornersSorted, [TmpY[Indices1[0]], TmpY[Indices1[1]]], YCoordCornersSorted)
*做投影变换
Px := XCoordCornersSorted
Py := YCoordCornersSorted
Qx := [70,70,270,270]
Qy := [100,300,100,300]
hom_vector_to_proj_hom_mat2d(Px, Py, [1,1,1,1], Qx, Qy, [1,1,1,1], 'normalized_dlt', HomMat2D)
projective_trans_image(Image, TransImage, HomMat2D, 'bilinear', 'false', 'false')