当前位置:网站首页>halcon原理:一维函数function_1d类型【1】
halcon原理:一维函数function_1d类型【1】
2022-06-23 11:53:00 【无水先生】
我们知道,元组是一维的,但不是函数。一维函数是用元组专门生成的特殊数据,针对函数,有一组专门的算子进行操作。
一、如何生成
1.1 通过元组产生function_1d函数
- create_funct_1d_array:通过一个一维数组创建一个离散一维函数

- create_funct_1d_pairs:通过一双一维数组创建一个离散一维函数

注意点:自变量元组 XValue必须已排序(从小到大)。
1.2 1d函数上逆操作
1)funct_1d_to_pairs获取一维离散函数的x和y值对应元组
funct_1d_to_pairs( flow, XValues1, YValues1)
从输入的函数flow获取两个元组:XValues1, YValues1

2)get_y_value_funct_1d获取一维离散函数的y值(不再详述)
二、1d函数上的一维操作
1)abs_funct_1d 计算一维函数的绝对值
原型:abs_funct_1d( : : Function : FunctionAbsolute)

2)compose_funct_1 将两个离散的一维函数复合成一个函数
这是一个复合函数,比如: 
三、综合示例代码
明白以上各种操作,可以看懂下述代码:
* This example program shows how to use compose_funct_1d. It computes
* two functions, atan(x) and cos(x), and composes them, which results in the
* function cos(atan(x)). This function is, of course, identical to 1/sqrt(1+x*x),
* so this function is also calculated. The program displays all four functions.
* By comparing the last two plots, we can check whether compose_funct_1d
* works correctly.
dev_update_off ()
dev_close_window ()
dev_open_window (0, 0, 512, 512, 'white', WindowHandle)
set_display_font (WindowHandle, 16, 'mono', 'true', 'false')
dev_set_color ('black')
dev_set_line_width (2)
X := []
for J := -125 to 125 by 1
X := [X,J / 40.0]
endfor
stop()
create_funct_1d_pairs (X, cos(X), Cos)
X := []
for J := -100 to 100 by 1
X := [X,J / 10.0]
endfor
stop()
create_funct_1d_pairs (X, atan(X), ATan)
create_funct_1d_pairs (X, 1 / sqrt(1 + X * X), InvSqrt1pSqX)
compose_funct_1d (ATan, Cos, 'constant', CosATan)
plot_funct_1d (WindowHandle, ATan, 'x', 'atan(x)', 'red', ['axes_color','origin_x','origin_y'], ['black',0,0])
disp_continue_message (WindowHandle, 'black', 'true')
stop ()
dev_clear_window ()
plot_funct_1d (WindowHandle, Cos, 'x', 'cos(x)', 'red', ['axes_color','origin_x','origin_y'], ['black',0,0])
disp_continue_message (WindowHandle, 'black', 'true')
stop ()
dev_clear_window ()
plot_funct_1d (WindowHandle, CosATan, 'x', 'cos(atan(x))', 'red', ['axes_color','origin_x','origin_y','start_y'], ['black',0,0,0])
disp_continue_message (WindowHandle, 'black', 'true')
stop ()
dev_clear_window ()
plot_funct_1d (WindowHandle, InvSqrt1pSqX, 'x', '1/sqrt(1+x*x)', 'red', ['axes_color','origin_x','origin_y','start_y'], ['black',0,0,0])
* (未完待续)
边栏推荐
- Qt 知识:使用 QGraphicsPixmapItem类
- Comment Huawei Cloud réalise l'architecture mondiale de réseau audio - vidéo en temps réel à faible latence
- Meta said that the UK security law may "scan all private information" or infringe privacy
- I am in Foshan. Where can I open an account? Is it safe to open a mobile account?
- 10-- 根据中序遍历和后序遍历,构造二叉树
- record
- 汉源高科8路电话+1路百兆以太网RJ11电话光端机 8路PCM电话光端机
- Proof and application of Chebyshev inequality
- mysql,如何在使用存储过程计算最大值
- LinkedList 5-141. 环形链表
猜你喜欢

Qt 知识:使用 QGraphicsPixmapItem类

Redis 入门-第四篇-数据结构与对象-跳跃表

链表5 - 234. 回文链表

Meta said that the UK security law may "scan all private information" or infringe privacy

Redis 入门-第三篇-数据结构与对象-字典

想学习eTS开发?教你开发一款IQ-EQ测试应用

汉源高科USB3.0光端机USB工业触摸屏光端机USB3.0光纤延长器USB3.0光纤传输器

简单易懂的软路由刷机使用教程

Leetcode 1209. Delete all adjacent duplicates II in the string

Mysql, how to calculate the maximum value using stored procedures
随机推荐
Introduction to Huawei cloud maintenance and sharing exchange platform
手机证券开户交易?现在网上开户安全么?
MySQL在一个字段中匹配多个值
Leetcode 1209. Delete all adjacent duplicates II in the string
Introduction to redis - Chapter 1 - data structures and objects - simple dynamic string (SDS)
记录
Google Earth Engine(GEE)——GEDI L2A Vector Canopy Top Height (Ver
语音模块:pyttsx变声项目
4E1 PDH光端机19英寸机架式单纤传输20km E1接口光纤网络光端机
六维图剖析:中国建筑集团有限公司企业成长性分析
Oversampling Series II: Fourier transform and signal-to-noise ratio
得物多活架构设计之路由服务设计
Gary Marcus发文:AI研究者需要知道的三个来自语言学家的观点
Where is the safest and most formal way to open an account at present?
切比雪夫不等式证明及应用
【综合笔试题】30. 串联所有单词的子串
在工作中学习的三个方法
How does easygbs solve the abnormal use of intercom function?
你真的理解LDO的输出电容吗!?
[zero foundation wechat applet] actual development of ID photo changing background color applet based on Baidu brain portrait segmentation