当前位置:网站首页>halcon图像矫正
halcon图像矫正
2022-07-02 03:08:00 【威威当爸了】
图像矫正
**55表示最大文字的高度
text_line_orientation (RegionTrans, InputImage, 55, rad(-30), rad(30), OrientationAngle)
rotate_image (InputImage, ImageRotate, -OrientationAngle/rad(180)*180, 'constant')
xld矫正,发现这个不是很灵.
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')
*将轮廓分割为边
segment_contours_xld (Contours, ContoursSplit, 'lines', 5, 30, 2)
XCoordCorners := []
YCoordCorners := []
*获取边的数量
count_obj (ContoursSplit, Number)
*存储每条边的起点位置
for index:=1 to Number by 1
select_obj(ContoursSplit, ObjectCurrent, index)
*拟合每条边
fit_line_contour_xld (ObjectCurrent, 'tukey', -1, 0, 5, 2, RowBegin, ColBegin, RowEnd, ColEnd, Nr, Nc, Dist)
*存储每条边的顶点x坐标
tuple_concat (XCoordCorners, RowBegin, XCoordCorners)
*存储每条边的顶点y坐标
tuple_concat (YCoordCorners, ColBegin, YCoordCorners)
endfor
* 投影变换给四个特征点与校正后的坐标建立关联
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)
*投影变换
projective_trans_image (InputImage, OuputImage, HomMat2D, 'bilinear', 'false', 'false')
* 显示校正结果
dev_display (OuputImage)
return ()
矫正前的图片:
矫正后的图片
边栏推荐
- Share the basic knowledge of a common Hongmeng application
- Gradle notes
- 2022-2028 global encryption software industry research and trend analysis report
- spark调优
- What is the difference between an intermediate human resource manager and an intermediate economist (human resources direction)?
- 2022-2028 global deep sea generator controller industry research and trend analysis report
- Baohong industry | four basic knowledge necessary for personal finance
- The capacity is upgraded again, and the new 256gb large capacity specification of Lexar rexa 2000x memory card is added
- STM32__05—PWM控制直流电机
- Soul app released the annual report on generation Z behavior: nearly 20% of young people love shopping in the vegetable market
猜你喜欢
MSI announced that its motherboard products will cancel all paper accessories
buu_ re_ crackMe
2022-2028 global wood vacuum coating machine industry research and trend analysis report
Common means of modeling: aggregation
[question 008: what is UV in unity?]
2022-2028 global manual dental cleaning equipment industry research and trend analysis report
Form custom verification rules
Multi threaded query, double efficiency
Cache processing scheme in high concurrency scenario
JS introduction < 1 >
随机推荐
verilog REG 寄存器、向量、整数、实数、时间寄存器
Verilog 状态机
Design details of SAP e-commerce cloud footernavigationcomponent
MongoDB非關系型數據庫
图扑软件通过 CMMI5 级认证!| 国际软件领域高权威高等级认证
Apple added the first iPad with lightning interface to the list of retro products
Systemserver service and servicemanager service analysis
QT使用sqllite
Competition and adventure burr
Après le mariage
What are the characteristics of common web proxy IP
MongoDB非关系型数据库
V-model of custom component
2022-2028 global soft capsule manufacturing machine industry research and trend analysis report
Multi threaded query, double efficiency
buu_ re_ crackMe
[staff] the direction of the symbol stem and the connecting line (the symbol stem faces | the symbol stem below the third line faces upward | the symbol stem above the third line faces downward | the
连通块模板及变式(共4题)
Actual battle of financial risk control - under Feature Engineering
QT implementation interface jump