当前位置:网站首页>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])
* (未完待续)
边栏推荐
猜你喜欢

链表5 - 234. 回文链表

Open classes are short videos! Tonight, I will teach you how to realize accurately!

汉源高科USB2.0光端机USB2.0光纤延长器USB2.0光纤传输器USB2.0接口转光纤

1路百兆光纤收发器1百兆光1百兆电桌面式以太网光纤收发器内置电源

2022年全国最新消防设施操作员(初级消防设施操作员)模拟题及答案

PPT制作3D旋转动画从入门到进阶

蓝桥杯单片机(一)——关闭外设及熄灭LED

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

Ppt makes 3D rotation animation from beginner to advanced

全国进入主汛期,交通运输部:不具备安全运行条件的线路坚决停运!
随机推荐
32路电话+2路千兆以太网32路PCM电话光端机支持FXO口FXS语音电话转光纤
想学习eTS开发?教你开发一款IQ-EQ测试应用
Face the future calmly and strive to improve yourself
QT5知识:DNS查询
Gary Marcus发文:AI研究者需要知道的三个来自语言学家的观点
4E1 PDH光端机19英寸机架式单纤传输20km E1接口光纤网络光端机
On the structure of annotation platform
Where is the safest and most formal way to open an account at present?
【云原生&微服务八】Ribbon负载均衡策略之WeightedResponseTimeRule源码剖析(响应时间加权)
简单易懂的软路由刷机使用教程
开源之夏中选名单已公示,基础软件领域成为今年的热门申请
[cloud based co creation] overview of the IOT of Huawei cloud HCIA IOT v2.5 training series
Introduction to Huawei cloud maintenance and sharing exchange platform
Meta称英安全法可能“扫描所有私人信息” 或侵犯隐私
【无标题】2022年压力管道巡检维护试题及在线模拟考试
广播级E1转AES-EBU音频编解码器 E1转立体声音频卡侬头(XLR)编解码器
ESP32-C3入门教程 问题篇⑧——blufi_example.c:244: undefined reference to `esp_ble_gap_start_advertising
Halcon知识:binocular_disparity 知识
@黑马粉丝,这份「高温补贴」你还没领?
How does easygbs solve the abnormal use of intercom function?