当前位置:网站首页>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知识:视图框架QGraphicsWidget详解
- 凭借32量子比特!Rigetti Computing打入英国量子计算市场
- Open classes are short videos! Tonight, I will teach you how to realize accurately!
- 惊!AMD 350亿美元收购赛灵思!
- [cloud resident co creation] in the code free era, how does software development go to everyone?
- Vous comprenez vraiment la capacité de sortie de LDO!?
- Proof and application of Chebyshev inequality
- [comprehensive written test questions] 30 Concatenate substrings of all words
- 一张图解码 OpenCloudOS 社区开放日
- RF Analyzer Demo搭建
猜你喜欢

"Dream of children's travel" in 2022, GAC Honda children's road safety charity travel entered the Northeast

汉源高科1路非压缩4K-DVI光端机4K高清非压缩DVI转光纤4K-DVI高清视频光端机

股权转让热点:重庆建科建设工程质量检测有限公司93.75%股权转让

go-zero微服务实战系列(六、缓存一致性保证)

Simulation questions and answers of the latest national fire-fighting facility operators (primary fire-fighting facility operators) in 2022

Meta称英安全法可能“扫描所有私人信息” 或侵犯隐私

QT5知识:信号和槽的一些要点

QT5知识:QT绘制图形

Mysql, how to calculate the maximum value using stored procedures

汉源高科USB3.0光端机USB工业触摸屏光端机USB3.0光纤延长器USB3.0光纤传输器
随机推荐
2022年全国最新消防设施操作员(初级消防设施操作员)模拟题及答案
爱可可AI前沿推介(6.23)
过采样系列三:量化误差与过采样率
Voice data annotation tools and platforms
【零基础微信小程序】基于百度大脑人像分割的证件照换底色小程序实战开发
你真的理解LDO的輸出電容嗎!?
How does easygbs solve the abnormal use of intercom function?
MySQL matches multiple values in one field
ESP32-C3入门教程 问题篇⑧——blufi_example.c:244: undefined reference to `esp_ble_gap_start_advertising
Oversampling Series III: quantization error and oversampling rate
[cloud native & microservice viii] source code analysis of weightedresponsetimerule of ribbon load balancing strategy (response time weighting)
@黑马粉丝,这份「高温补贴」你还没领?
Introduction to Huawei cloud maintenance and sharing exchange platform
Oversampling series I: sampling theorem and oversampling rate
PPT制作3D旋转动画从入门到进阶
Does the inductance have polarity?
Leetcode 1209. Delete all adjacent duplicates II in the string (not in the initial version)
Face the future calmly and strive to improve yourself
HMS Core 视频编辑服务开放模板能力,助力用户一键Get同款酷炫视频
“梦想童行” 2022年广汽本田儿童道路安全公益行走进东北