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

边栏推荐
- Discussion on related configuration of thread pool
- Mmsegmentation series training and reasoning their own data set (3)
- 2022 hoisting machinery command examination paper and summary of hoisting machinery command examination
- GB/T-2423. XX environmental test documents, including the latest documents
- MMSegmentation系列之训练与推理自己的数据集(三)
- Principle of computer composition - interview questions for postgraduate entrance examination (review outline, key points and reference)
- After marriage
- Golang configure export goprivate to pull private library code
- [JSON] gson use and step on the pit
- Verilog 避免 Latch
猜你喜欢

halcon图像矫正

QT environment generates dump to solve abnormal crash

Tupu software has passed CMMI5 certification| High authority and high-level certification in the international software field

OSPF LSA message parsing (under update)

Verilog 状态机

Mongodb base de données non relationnelle

2022-2028 global wood vacuum coating machine industry research and trend analysis report
![[staff] diacritical mark (ascending sign | descending sign B | double ascending sign x | double descending sign BB)](/img/96/8c4baa1dd8e35e2cab67461e7c447b.jpg)
[staff] diacritical mark (ascending sign | descending sign B | double ascending sign x | double descending sign BB)

Detailed explanation of the difference between Verilog process assignment
![[Chongqing Guangdong education] Sichuan University concise university chemistry · material structure part introductory reference materials](/img/ae/7edbdf55795400166650c795c8bd58.jpg)
[Chongqing Guangdong education] Sichuan University concise university chemistry · material structure part introductory reference materials
随机推荐
Verilog 状态机
MSI announced that its motherboard products will cancel all paper accessories
Tupu software has passed CMMI5 certification| High authority and high-level certification in the international software field
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
JS introduction < 1 >
venn圖取交集
2022-2028 global soft capsule manufacturing machine industry research and trend analysis report
[staff] diacritical mark (ascending sign | descending sign B | double ascending sign x | double descending sign BB)
What are the characteristics of common web proxy IP
Verilog 时序控制
Use blocking or non blocking for streamline
Baohong industry | four basic knowledge necessary for personal finance
V-model of custom component
ZABBIX API creates hosts in batches according to the host information in Excel files
STM32__ 05 - PWM controlled DC motor
创业了...
Baohong industry | what misunderstandings should we pay attention to when diversifying investment
ORA-01547、ORA-01194、ORA-01110
表单自定义校验规则