首页 > 其他分享 >基本操作之——Object差异

基本操作之——Object差异

时间:2024-03-07 10:01:29浏览次数:21  
标签:object obj 差异 Object dev window diff 基本操作 WindowHandle

obj_diff — Calculate the difference of two object tuples.  计算两个对象的差异

*region类型  获取内容差异

*image类型/XLDs类型  仅比较内存地址差异

*mixed类型(如image和xld的混合类型)  

*
* obj_diff使用
read_image (Image, 'particle')
threshold (Image, Region, 57, 255)
connection (Region, ConnectedRegions)
*
* 初始化图像显示窗口
dev_close_window ()
get_image_size (Image, Width, Height)
dev_open_window_fit_image (Image, 0, 0, Width, Height, WindowHandle)
set_display_font (WindowHandle, 16, 'mono', 'true', 'false')
dev_set_draw ('fill')
dev_set_colored (6)
*
* obj_diff calculates the difference of two object tuples,
* e.g., to extract those objects from an input tuple
* that have not yet been processed.
*obj_diff计算两个对象元组的差值,例如,从输入元组中提取尚未处理的对象。
select_shape (ConnectedRegions, LeftRegions, 'column', 'and', 0.0, 256.0)
obj_diff (ConnectedRegions, LeftRegions, RightRegions)
dev_clear_window ()
dev_display (RightRegions)
disp_message (WindowHandle, 'Difference of all regions and\nleft hand side regions:\nRight hand side regions', 'window', 12, 12, 'cyan', 'false')
disp_continue_message (WindowHandle, 'cyan', 'false')
stop ()

 


*
* An object tuple minus an empty object stays unaltered.
* 对象元组减去空对象保持不变
gen_empty_obj (EmptyObject)
obj_diff (ConnectedRegions, EmptyObject, ObjectsDiff)
dev_clear_window ()
dev_display (ObjectsDiff)
disp_message (WindowHandle, 'Difference of all regions and\nan empty object:\nAll regions', 'window', 12, 12, 'cyan', 'false')
disp_continue_message (WindowHandle, 'cyan', 'false')
stop ()

 


*
* An empty object minus any object returns an empty object.
*空对象减任何对象均为空对象
obj_diff (EmptyObject, LeftRegions, ObjectsDiff)
dev_clear_window ()
dev_display (ObjectsDiff)
disp_message (WindowHandle, 'Difference of an empty object\nand any other object:\nAn empty object', 'window', 12, 12, 'cyan', 'false')
disp_continue_message (WindowHandle, 'cyan', 'false')
stop ()

 


*
* Note that images are only compared by their position in
* the memory but not by their actual contents! Therefore,
* the following images are considered as being different
* and, as a consequence, the result is not empty.
* The same applies to XLDs.
*请注意,图像仅根据它们在内存中的位置进行比较,而不是按其实际内容进行比较!因此,以下图像被视为不同,因此,结果不为空。
* 这同样适用于XLD。
read_image (SameImage, 'particle')
obj_diff (Image, SameImage, ObjectsDiff)
dev_clear_window ()
dev_display (ObjectsDiff)
disp_message (WindowHandle, 'Difference of an image and\nthe same image reloaded:\nThe original image', 'window', 12, 12, 'cyan', 'false')
disp_continue_message (WindowHandle, 'cyan', 'false')
stop ()

 


*
* obj_diff also works for object tuples of mixed type.
*混合类型比较(图像及XLD构成混合类型对象)
gen_contour_polygon_xld (Contour, [50,150,250,250,250], [50,50,50,150,250])
concat_obj (Region, Contour, RegionAndXLD)
concat_obj (Region, Image, ImageAndRegion)
obj_diff (RegionAndXLD, ImageAndRegion, ObjectsDiff)
dev_clear_window ()
dev_display (ObjectsDiff)
disp_message (WindowHandle, 'Difference of mixed type objects', 'window', 12, 12, 'cyan', 'false')

 

标签:object,obj,差异,Object,dev,window,diff,基本操作,WindowHandle
From: https://www.cnblogs.com/echo-efun/p/18058199

相关文章

  • 基本操作之——Object插入
    insert_obj—Insertobjectsintoaniconicobjecttuple.  插入对象到图标对象数组中*以下实例展示了,在垂直两张图像中,插入一张蓝莓图像dev_update_off()dev_close_window()dev_open_window(0,0,640,480,'white',WindowHandle)set_display_font(WindowHandle,1......
  • 基本操作之——Object比较
    *此示例程序显示了运算符compare_obj的用法。*特别是,它显示了compare_obj和test_equal_obj之间的区别,compare_obj比较对象的实际内容,而test_equal_obj比较图像和XLD在内存中的位置。*compare_obj——比较实际内容是否一致*test_equal_obj——比较内存地址是否一致(当......
  • 基本操作之——tuple增删查改操作
    1.tuple增加操作——tuple_insertOriginalTuple:=[0,1,2,3,4,5]*指定索引处插入一个元素tuple_insert(OriginalTuple,3,'x',InsertSingleValueA)*HDevelop执行同样操作InsertSingleValueB:=insert(OriginalTuple,3,'x') **指定索引处插入多个元素tuple_insert(Or......
  • Mysql和Oracle在group by中的一些差异
    1.是否select字段需要全部出现?Oracle中出现在select列表中的字段或者出现在orderby后面的字段,如果不是包含在分组函数中,那么该字段必须同时在groupby子句中出现。Mysql没有此限制例:Mysql中,以下SQL语句是成立的,可见这里的GroupbySELECTp.PDTNO,p.PDTNAME,sum(a.QUAN......
  • Mysql和Oracle在order by上关于聚合函数一些不同的差异
    1.问题SELECTp.PDTNO,p.PDTNAME,sum(a.QUANTITY)ASapplySumCountFROMPRODUCTpJOINAPPLYaONp.PDTNO=a.PDTNOGROUPBYPDTNOORDERBYapplySumCountDESC;在Mysql中我们经常将select中聚合函数得到的结果起别名用于orderby但是同样的方式在Oracle中就不行,......
  • 基本操作之——tuple类型
    *此示例演示如何使用运算符tuple_type,*tuple_is_int、tuple_is_real、tuple_is_string、*tuple_is_mixed和元素运算符*tuple_type_elem、tuple_is_int_elem、tuple_is_real_elem、*和tuple_is_string_elem。*此外,此示例还演示了如何使用强制转换(例如tuple_int)优化元组以加......
  • 记录一次WPF命令参数报错,InvalidCastException: T for DelegateCommand<T> is not an
    在使用WPF的时候对int或者bool类型进行绑定出现InvalidCastException:TforDelegateCommandisnotanobjectnorNullable.<ButtonWidth="200"Height="30"Content="按钮"Command="{BindingOpenCommand}"CommandParameter="{Binding......
  • java.lang.reflect.InaccessibleObjectException
    低版本springboot应用使用高版本JDK报以下异常:Causedby:java.lang.reflect.InaccessibleObjectException:Unabletomakeprotectedfinaljava.lang.Classjava.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)throwsjava......
  • 基本操作之——正则表达式
    1.定义*允许0次或多次重复+允许1次或多次重复?允许0次或1次重复{n,m}允许n到m次重复{n}允许n次重复^ 匹配字符串开头$ 匹配字符串结尾.匹配除换行符外所有字符2.事例*正则表达式基本操作tuple_regexp_match('abba','ab*',Match......
  • 在PowerShell中下载文件是一项常见的任务,可以通过多种方法完成。下面我将介绍使用Invo
    在PowerShell中下载文件是一项常见的任务,可以通过多种方法完成。下面我将介绍使用Invoke-WebRequest、New-Object和Start-BitsTransfer命令来下载文件的方法。使用Invoke-WebRequestInvoke-WebRequest是一个非常强大的命令,用于向网页发送HTTP和HTTPS请求。你可以使用它来下载文......