当前位置:网站首页>Project practice four image mosaic
Project practice four image mosaic
2022-07-22 01:36:00 【Σίσυφος one thousand and nine hundred】
One 、 brief introduction
Image mosaic is a technology we often use , Personally, I once naively thought that the longest used in the project is to use halcon The kind of puzzle in the case , But it's not like this when you really do a project , This is a real case in the project .
Two 、 Project background
1、 Yes On 、 in 、 Next three pictures , And on the right of each picture is a row of calibration circles
2、 The calibration circle in the figure above can be photographed 9 A round hole , In the middle of the picture, all of the above picture and the part of the following picture are guaranteed to overlap , The following figure and the middle figure must also overlap , Here's the picture :
3、 ... and 、 Puzzle principle
As shown in the previous two steps :
First step : We need to find the calibration circle on the right side of the picture , When looking for a circle ,a、 Through the first blob Analyze and find out the contour of the desired round hole , Then fit the circle , Another method is to calculate the value of the circular hole area_center, Then use a two-dimensional measuring caliper to fit the circle
* Calculate the radius by area
Radius:=pow(mean(Area)/rad(180),0.5)
* Create caliper
create_metrology_model (MetrologyHandle)
get_image_size (ImageReduced, Width, Height)
set_metrology_model_image_size (MetrologyHandle, Width, Height)
tuple_gen_const (|Row|, Radius, Radiuses)
add_metrology_object_circle_measure (MetrologyHandle, Row, Column, Radiuses, 5, 10, 1, 30, ['num_measures','measure_transition','measure_select','min_score'], [16,'positive','all',0.1], Index_circle)
apply_metrology_model (ImageReduced, MetrologyHandle)
get_metrology_object_result (MetrologyHandle, Index_circle, 'all', 'result_type', 'all_param', Parameter_circle)
The second step : In the first step, we get the row and column coordinates of circular holes of each picture , This step is only to calculate the difference of overlapping positions , The distribution is shown in the above figure and the middle figure Of offsetx1 offsety1, And in the middle figure and the following figure offsetx2,offsety2 . There are many ways to calculate , Not here .
The third step : adopt tile_images_offset Operator to puzzle
Four 、 According to the effect
Core code :
Find a circle
* obtain 9 The radius of a circle and Row column coordinates
Albert_Carib_Circle (ImageResult, ContCircleT, 'TOP', tilParams[6], [tilParams[7],tilParams[9],tilParams[10]], [tilParams[8],1,tilParams[11]], [], ProcessObjOut, ProcessObjOut, RowT, ColumnT)
SetDictObject (ContCircleT, ProcessObjOut, ' The circle finding result in the figure above ')
* Calculate the distance between two adjacent circles
distance_pp (RowT[0:|RowT|-2], ColumnT[0:|RowT|-2], RowT[1:|RowT|-1], ColumnT[1:|RowT|-1], Distance)
a := max(Distance)-min(Distance)
Puzzle :
OffsetYX := [0,0,OffsetY11,OffsetX11,OffsetY11+OffsetY22,OffsetX11+OffsetX22]
* set_dict_tuple (DictHandle_tile, ' Calibration circle extraction ', ProcessObjOut)
* Puzzle
gen_empty_obj (TiledImageLight)
gen_empty_obj (TiledImageDark)
get_image_size (ObjectSelected, Width, Height)
tile_images_offset (ImageLights, TiledImageLight, [OffsetYX[0],OffsetYX[2],OffsetYX[4]], [OffsetYX[1],OffsetYX[3],OffsetYX[5]], [0,0,0], [0,0,0], [Height,Height,Height], [Width,Width,Width], Width, Height*3-2000)
Final effect :
边栏推荐
- (转)postMessage使用方法
- 洛谷——P1616 疯狂的采药
- [dongle vulnerability notification] Apache spark command injection vulnerability scheme
- Mysql03(关联查询)
- swift 【block】
- go gorm mysql报错:Error 1292: Incorrect datetime value: ‘XXX‘ for column ‘created_at‘ at row 1
- Industrial control software - drive framework
- 在go语言中获取当前时间,以及md5、hmac、sha1算法的简单实现
- easyexcel简单使用
- First knowledge of loop and branch statements in C language
猜你喜欢
SpaceX与芭比娃娃制造商美泰达成主题玩具产品协议
支付系统 - 对账系统
Screen sharing software --deskreen
零基础转行软件测试学习要不要报培训班学习,还是自学好?
c语言:查漏补缺(一)
Jupyterhub配置Go环境
Remember a remote debugging experience of minecraft server plug-in
【集训DAY10】Linear【数学】【思维】
七甲川染料CY7标记肽核酸PNA合成方法CY7-PNA
Framework - WindowManager (window management service) practice of WMS
随机推荐
05-1. Default member function: copy constructor, assignment operator overload
学习路之PHP--thinkphp5+windows服务器实现定时任务
氟尼辛肽核酸寡聚体复合物|规活性基团Alkyne炔烃,SH Thiol炔基修饰肽核酸
I.MX6U-ALPHA开发板(按键输入实验)
零基础转行软件测试学习要不要报培训班学习,还是自学好?
新知识经济时代,谁在生产知识?
好用的办公网优化工具OneDNS
什么是深克隆,浅克隆?(案例详解)
easyexcel简单使用
支付系统 - 对账系统
47: Chapter 4: developing file services: 8: automatic image review (Alibaba cloud content security); (don't read it if you haven't written it yet; to be written...)
Using completable future to implement asynchronous callback
Niu Ke brushes question 01 - Kiki de duplication of integers and sorting (C language)
go gorm mysql报错:Error 1292: Incorrect datetime value: ‘XXX‘ for column ‘created_at‘ at row 1
Word2vec simple summary
近红外染料CY7.5标记PNA多肽实验步骤CY7.5-PNA|188Re标记反基因肽核酸(AGPNA)
“我放弃编程,写了一本130万字的硬科幻小说”
MongoDB 中的管道操作符($group、$unwind、$sort、$limit、$skip)
UnityWebGl项目总结(未完)
Deploy server