当前位置:网站首页>Halcon image rectification
Halcon image rectification
2022-07-02 03:11:00 【Weiwei became a father】
Image correction
**55 Represents the height of the maximum text
text_line_orientation (RegionTrans, InputImage, 55, rad(-30), rad(30), OrientationAngle)
rotate_image (InputImage, ImageRotate, -OrientationAngle/rad(180)*180, 'constant')
xld correct , I find this is not very clever .
get_image_size (InputImage, imageWidth, imageHeight)
binary_threshold (InputImage, Region2, 'max_separability', 'dark', UsedThreshold2)
fill_up (Region2, RegionFillUp)
erosion_circle (RegionFillUp, RegionErosion, 3.5)
gen_contour_region_xld (RegionErosion, Contours, 'border')
* Divide the profile into edges
segment_contours_xld (Contours, ContoursSplit, 'lines', 5, 30, 2)
XCoordCorners := []
YCoordCorners := []
* Get the number of edges
count_obj (ContoursSplit, Number)
* Store the starting position of each edge
for index:=1 to Number by 1
select_obj(ContoursSplit, ObjectCurrent, index)
* Fit each edge
fit_line_contour_xld (ObjectCurrent, 'tukey', -1, 0, 5, 2, RowBegin, ColBegin, RowEnd, ColEnd, Nr, Nc, Dist)
* Store the vertices of each edge x coordinate
tuple_concat (XCoordCorners, RowBegin, XCoordCorners)
* Store the vertices of each edge y coordinate
tuple_concat (YCoordCorners, ColBegin, YCoordCorners)
endfor
* The projection transformation establishes the correlation between the four feature points and the corrected coordinates
XOff:= 100
YOff:= 100*imageHeight/imageWidth
hom_vector_to_proj_hom_mat2d (XCoordCorners, YCoordCorners, [1,1,1,1], [YOff,YOff,imageHeight-YOff,imageHeight-YOff], [XOff,imageWidth-XOff,imageWidth-XOff,XOff], [1,1,1,1], 'normalized_dlt', HomMat2D)
* Projection transformation
projective_trans_image (InputImage, OuputImage, HomMat2D, 'bilinear', 'false', 'false')
* Display the correction results
dev_display (OuputImage)
return ()
Picture before correction :
Corrected picture
边栏推荐
- QT environment generates dump to solve abnormal crash
- On redis (II) -- cluster version
- 32, 64, 128 bit system
- Baohong industry | what misunderstandings should we pay attention to when diversifying investment
- C shallow copy and deep copy
- A list of job levels and salaries in common Internet companies. Those who have conditions must enter big factories. The salary is really high
- Delphi xe10.4 installing alphacontrols15.12
- Stack - es - official documents - filter search results
- GB/T-2423.xx 环境试验文件,整理包括了最新的文件里面
- spark调优
猜你喜欢
2022-2028 global wood vacuum coating machine industry research and trend analysis report
Golang configure export goprivate to pull private library code
[staff] restore mark (Introduction to the use of restore mark | example analysis of Metaphone mark and restore mark)
Actual battle of financial risk control - under Feature Engineering
SAP ui5 beginner tutorial 19 - SAP ui5 data types and complex data binding
Learn PWN from CTF wiki - ret2shellcode
MSI announced that its motherboard products will cancel all paper accessories
Verilog parallel block implementation
Soul app released the annual report on generation Z behavior: nearly 20% of young people love shopping in the vegetable market
[JS reverse series] analysis of a customs publicity platform
随机推荐
After marriage
Mongodb base de données non relationnelle
Learn PWN from CTF wiki - ret2shellcode
Go执行shell命令
Addition without addition, subtraction, multiplication and division (simple difficulty)
SAML2.0 笔记(一)
Apple added the first iPad with lightning interface to the list of retro products
halcon图像矫正
2022 hoisting machinery command examination paper and summary of hoisting machinery command examination
Systemserver service and servicemanager service analysis
MSI announced that its motherboard products will cancel all paper accessories
Render header usage of El table
自定义组件的 v-model
2022-2028 global soft capsule manufacturing machine industry research and trend analysis report
Discussion on related configuration of thread pool
2022-2028 global military computer industry research and trend analysis report
跟着CTF-wiki学pwn——ret2shellcode
在QML中加载不同字体
初出茅庐市值1亿美金的监控产品Sentry体验与架构
32, 64, 128 bit system