follow是什么意思low在线翻译读音例句-午夜巴塞罗那原声
2023年4月4日发(作者:疯狂主妇第二季)
sort_contours_xld算⼦的⼏种排序⽅式研究
算⼦sort_contours_xld算⼦有5种排序⽅式,即:
\'upper_left\':
Thepositionisdeterminedbytheupperleftcornerofthesurroundingrectangle.
\'upper_right\':
Thepositionisdeterminedbytheupperrightcornerofthesurround简短小诗歌 ingrectangle.
\'lower_left\':
Thepositionisdeterminedbythelowerleftcornerofthesurroundingrectangle.
\'lower_right\':
Thepositionisd莫言代表作品有哪些 eterminedbythelowerrightcornerofthesurroundingrectangle.
\'character\':
Theporastto\'upper_left\',thecontoursarealsosorted
accordingtotheremainingcoordinate,iftheyoverlapinthedirec李清照诗词朗诵视频 tionofthecoordinatewhichisspecifiedbytheparameterRowOrCol.
其中\'character\'排序⽅式不太好理解,不过从英⽂说明可知,它跟\'upper_left\'排序⽅式很像,我想⼀般来说,前⾯的四种排序⽅式⼀般够⽤
了。
以\'upper_left\'排序⽅式为例,它的英⽂说明的翻译是:位置由环绕矩形的左上⾓决定。
于是我猜测它的意思是这样的:对于⼀组xld来说,画出每⼀个xld的最⼩平⾏矩形(gen_rectangle1),然后根据这些矩形的左上⾓坐标来
对这些xld进⾏排序。
先看算⼦签名:
sort_contours_xld(Contours:SortedContours:SortMode,Order,RowOrCol:)
Order可以取\'true\'或者\'false\',\'true\'是升序排列,\'false\'是降序排列。
RowOrCol可以取\'row\'或者\'column\'。
下⾯以如下⽅式排列试试:(根据最⼩外接矩形的左上⾓的⾏坐标来升序排列)
sort_contours_xld(SelectedXLD,SortedContours,\'upper_left\',\'true\',\'row\')
1read_大灰狼拔牙的故事 image(Image,\'C:/Us满江红原文秋瑾 ers/happyxia/Desktop/\')
2threshold_sub_pix(Image,Border,90)
3select_shape_xld(Border,SelectedXLD,\'contlength\',\'and\',100,99999)
4sort_contours_xld(SelectedXLD,SortedContours,\'upper_left\',\'true\',\'row\')
5dev_set_draw(\'margin\')
6dev_display(Image)
7count_obj(SortedContours,Number)
8gen_empty_obj(EmptyO宋诗精选60首 bject)
9*注释:这⾥Number=29
10forIndex:=1toNumberby1
11select_obj(SortedContours,ObjectSelected,Index)
12smallest_rectangle1_xld(O缄默 bjectSelected,Row1,Column1,Row2,Column2)
13gen_rectangle1(Rectangle,Row1,Column1,Row2,Column2)
14concat_obj(EmptyObject,ObjectSelected,EmptyObject)
1冯延巳鹊踏枝梅落繁枝千万片 5endfor
16
17dev_display(Image)
18select_obj(SortedContours,ObjectSelected1,11)
19sort_contours_xld(SelectedXLD,SortedContours2,\'upper_left\',\'false\',\'row\')
20select_obj(SortedContours2,ObjectSelected2,Number-11+1)
程序中变量ObjectSelected出现的顺序依次如下:(可以观察ObjectSelected的外接矩形的row坐标,看是否符合之前总结的规律)
对于排序后的xld元组SortedContours,我们可以发现它的升序排列第11项和降序排列第(29-11+1)项是同⼀个对象,都是字母W。
有⼀个问题值得讨论⼀下:\'upper_right\',\'true\',\'r人之初性本善全文朗诵 ow\'和\'upper_left\',\'true\',\'row\'有何区别?
我反复试了⼀下,结论是:没有区别。因为根据⾏(row)排列时,矩形的左上⾓和右上⾓的row值是⼀样的。
如果是根据row升序排列,如果row⼀样,那么再根据column升序排列;如果是根据row降序排一望无际的近义词 列,如果row⼀样,那么再根据column降序排
列。
⾄于其他⼏种排序⽅式,规律是⼀样的,⽆需赘⾔。
不知道看到这⾥的⽹友们懂了没有,反正我⾃⼰是搞懂了,要想彻底搞懂,很简单,⽤我提供的图和程序,反复变换排序的⽅式,跑⼀跑程
序便知。
更多推荐
XID是什么意思在线翻译读音例句
发布评论