【机器视觉】 measure_projection算子
00. 目錄
文章目錄
- 00. 目錄
- 01. 概述
- 02. 簽名
- 03. 描述
- 04. 注意
- 05. 參數(shù)
- 06. 結(jié)果
- 07. 附錄
01. 概述
measure_projection - 提取垂直于矩形或圓弧的灰度值分布。
02. 簽名
measure_projection(Image : : MeasureHandle : GrayValues)
03. 描述
measure_projection提取垂直于矩形或環(huán)形弧的一維灰度值分布。 這是通過平均垂直于矩形或弧長軸的“切片”中的灰度值來完成的。 采樣是在矩形中心的整數(shù)行和列距離(在矩形的坐標系中)的圖像Image中的亞像素位置完成的。 由于這涉及到可以在多個投影中重復使用的一些計算,因此算子gen_measure_rectangle2初始化這些計算,從而顯著提高了measure_projection的速度。 由于在灰度值的亞像素計算中存在精度和速度之間的折衷,所以在gen_measure_rectangle2中可以選擇不同的插值方案(插值僅影響與圖像軸不對齊的矩形)。 用gen_measure_rectangle2生成的measure對象在MeasureHandle中傳遞。
原文描述:
measure_projection extracts a one-dimensional gray value profile perpendicular to a rectangle or annular arc. This is done by averaging the gray values in “slices” perpendicular to the major axis of the rectangle or arc. The sampling is done at subpixel positions in the image Image at integer row and column distances (in the coordinate frame of the rectangle) from the center of the rectangle. Since this involves some calculations which can be used repeatedly in several projections, the operator gen_measure_rectangle2 is used to perform these calculations only once, thus increasing the speed of measure_projection significantly. Since there is a trade-off between accuracy and speed in the subpixel calculations of the gray values, different interpolation schemes can be selected in gen_measure_rectangle2 (the interpolation only influences rectangles not aligned with the image axes). The measure object generated with gen_measure_rectangle2 is passed in MeasureHandle.
For an explanation of the concept of 1D measuring see the introduction of chapter 1D Measuring.
執(zhí)行信息
● 多線程類型:可重入(與非獨占算子并行運行)。
● 多線程范圍:全局(可以從任何線程調(diào)用)。
● 不并行處理。
04. 注意
為了效率的原因,measure_projection 會忽略Image的ROI域。 如果圖像中的特定區(qū)域應該從measurement中排除,則應該生成具有適當修改的參數(shù)的新measure對象。
05. 參數(shù)
Image (input_object) singlechannelimage → object (byte / uint2 / real)
輸入圖像。
MeasureHandle (input_control) measure_id → (integer)
measure對象句柄。
GrayValues (output_control) number-array → (real)
灰度值分布。
06. 結(jié)果
如果參數(shù)值正確,則算子measure_projection返回值2(H_MSG_TRUE)。 否則會引發(fā)異常。
HDevelop例程
measure_caliper.hdev 測量卡尺的間距線之間的距離
count_fish_sticks.hdev 魚棒的完整性檢查
check_smd_tilt.hdev 檢查SMD是否傾斜
程序示例
07. 附錄
7.1 機器視覺博客匯總
網(wǎng)址:https://dengjin.blog.csdn.net/article/details/116837497
總結(jié)
以上是生活随笔為你收集整理的【机器视觉】 measure_projection算子的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 【机器视觉】 measure_pos算子
- 下一篇: 【机器视觉】 measure_thres