当前位置:网站首页>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

边栏推荐
- Docker installs canal and MySQL for simple testing and implementation of redis and MySQL cache consistency
- V-model of custom component
- 在QML中加载不同字体
- Yyds dry goods inventory accelerating vacuum in PG
- /silicosis/geo/GSE184854_ scRNA-seq_ mouse_ lung_ ccr2/GSE184854_ RAW/GSM5598265_ matrix_ inflection_ demult
- [road of system analyst] collection of wrong topics in enterprise informatization chapter
- Après le mariage
- Analysis of FLV packaging format
- What is the difference between an intermediate human resource manager and an intermediate economist (human resources direction)?
- 命名块 verilog
猜你喜欢

Mmsegmentation series training and reasoning their own data set (3)

高并发场景下缓存处理方案
![[staff] pitch representation (treble clef | C3 60 ~ B3 71 pitch representation | C4 72 pitch representation | C5 84 pitch representation)](/img/e0/05890eafdb291c5aaff78cc241f455.jpg)
[staff] pitch representation (treble clef | C3 60 ~ B3 71 pitch representation | C4 72 pitch representation | C5 84 pitch representation)

2022-2028 global soft capsule manufacturing machine industry research and trend analysis report

命名块 verilog

About DNS

Formatting logic of SAP ui5 currency amount display

浅谈线程池相关配置

Soul app released the annual report on generation Z behavior: nearly 20% of young people love shopping in the vegetable market

Baohong industry | what misunderstandings should we pay attention to when diversifying investment
随机推荐
JS introduction < 1 >
What is the difference between an intermediate human resource manager and an intermediate economist (human resources direction)?
Possible causes of runtime error
Gradle notes
3124. Word list
2022-2028 global manual dental cleaning equipment industry research and trend analysis report
spark调优
批量检测url是否存在cdn—高准确率
What are the common proxy servers and what are the differences?
命名块 verilog
Load different fonts in QML
Verilog 过程连续赋值
Verilog 线型wire 种类
C shallow copy and deep copy
Principle of computer composition - interview questions for postgraduate entrance examination (review outline, key points and reference)
Yyds dry goods inventory accelerating vacuum in PG
[JSON] gson use and step on the pit
32, 64, 128 bit system
Special symbols in SAP ui5 data binding syntax, and detailed explanation of absolute binding and relative binding concepts
Verilog 过程赋值 区别 详解