基于halcon的凹痕检测

简介: 基于halcon的凹痕检测

测试图

image.png

代码

* This procedure displays text in a graphics window.
* 
* Input parameters:
* WindowHandle: The WindowHandle of the graphics window, where
*    the message should be displayed
* String: A tuple of strings containing the text message to be displayed
* CoordSystem: If set to 'window', the text position is given
*    with respect to the window coordinate system.
*    If set to 'image', image coordinates are used.
*    (This may be useful in zoomed images.)
* Row: The row coordinate of the desired text position
*    A tuple of values is allowed to display text at different
*    positions.
* Column: The column coordinate of the desired text position
*    A tuple of values is allowed to display text at different
*    positions.
* Color: defines the color of the text as string.
*    If set to [], '' or 'auto' the currently set color is used.
*    If a tuple of strings is passed, the colors are used cyclically...
*    - if |Row| == |Column| == 1: for each new textline
*    = else for each text position.
* Box: If Box[0] is set to 'true', the text is written within an orange box.
*      If set to' false', no box is displayed.
*      If set to a color string (e.g. 'white', '#FF00CC', etc.),
*        the text is written in a box of that color.
*      An optional second value for Box (Box[1]) controls if a shadow is displayed:
*        'true' -> display a shadow in a default color
*        'false' -> display no shadow
*        otherwise -> use given string as color string for the shadow color
* 
* It is possible to display multiple text strings in a single call.
* In this case, some restrictions apply:
* - Multiple text positions can be defined by specifying a tuple
*   with multiple Row and/or Column coordinates, i.e.:
*   - |Row| == n, |Column| == n
*   - |Row| == n, |Column| == 1
*   - |Row| == 1, |Column| == n
* - If |Row| == |Column| == 1,
*   each element of String is display in a new textline.
* - If multiple positions or specified, the number of Strings
*   must match the number of positions, i.e.:
*   - Either |String| == n (each string is displayed at the
*                           corresponding position),
*   - or     |String| == 1 (The string is displayed n times).
* 
* 
* Convert the parameters for disp_text.
if (Row == [] or Column == [])
    return ()
endif
if (Row == -1)
    Row := 12
endif
if (Column == -1)
    Column := 12
endif
* 
* Convert the parameter Box to generic parameters.
GenParamName := []
GenParamValue := []
if (|Box| > 0)
    if (Box[0] == 'false')
        * Display no box
        GenParamName := [GenParamName,'box']
        GenParamValue := [GenParamValue,'false']
    elseif (Box[0] != 'true')
        * Set a color other than the default.
        GenParamName := [GenParamName,'box_color']
        GenParamValue := [GenParamValue,Box[0]]
    endif
endif
if (|Box| > 1)
    if (Box[1] == 'false')
        * Display no shadow.
        GenParamName := [GenParamName,'shadow']
        GenParamValue := [GenParamValue,'false']
    elseif (Box[1] != 'true')
        * Set a shadow color other than the default.
        GenParamName := [GenParamName,'shadow_color']
        GenParamValue := [GenParamValue,Box[1]]
    endif
endif
* Restore default CoordSystem behavior.
if (CoordSystem != 'window')
    CoordSystem := 'image'
endif
* 
if (Color == '')
    * disp_text does not accept an empty string for Color.
    Color := []
endif
* 
disp_text (WindowHandle, String, CoordSystem, Row, Column, Color, GenParamName, GenParamValue)
return ()

结果

image.png

相关文章
|
计算机视觉 C++ Python
OpenCV人脸检测打卡系统
OpenCV人脸检测打卡系统
98 0
|
固态存储 计算机视觉 异构计算
一起来学MediaPipe(一)人脸及五官定位检测
一起来学MediaPipe(一)人脸及五官定位检测
3303 0
一起来学MediaPipe(一)人脸及五官定位检测
Halcon找圆系列(1)如何检测圆形
Halcon找圆系列(1)如何检测圆形
1893 0
Halcon找圆系列(1)如何检测圆形
|
7月前
|
存储 传感器 文字识别
LabVIEW开发基于图像处理的车牌检测系统
LabVIEW开发基于图像处理的车牌检测系统
52 3
|
5月前
|
机器学习/深度学习 算法 BI
基于深度学习网络的USB摄像头实时视频采集与手势检测识别matlab仿真
**摘要:** 本文介绍了使用MATLAB2022a实现的基于GoogLeNet的USB摄像头手势识别系统。系统通过摄像头捕获视频,利用深度学习的卷积神经网络进行手势检测与识别。GoogLeNet网络的Inception模块优化了计算效率,避免过拟合。手势检测涉及RPN生成候选框,送入网络进行分类。系统架构包括视频采集、手势检测与识别、以及决策反馈。通过GPU加速和模型优化保证实时性能,应用于智能家居等场景。
|
7月前
|
算法 计算机视觉
LabVIEW使用图像处理检测显微图像中的白血病
LabVIEW使用图像处理检测显微图像中的白血病
34 0
|
7月前
|
算法 计算机视觉
LabVIEW开发3D颈动脉图像边缘检测
LabVIEW开发3D颈动脉图像边缘检测
38 0
|
7月前
|
存储 编解码 算法
使用Python和OpenCV构建具有人体检测功能的摄像头录制器
使用Python和OpenCV构建具有人体检测功能的摄像头录制器
|
7月前
|
文字识别
[Halcon&识别] 车牌识别
[Halcon&识别] 车牌识别
82 0
|
算法 编译器
使用matlab机器视觉工具箱实现人脸特征的检测和定位,识别并标注眉毛,眼睛,鼻子,嘴巴
使用matlab机器视觉工具箱实现人脸特征的检测和定位,识别并标注眉毛,眼睛,鼻子,嘴巴
373 0
使用matlab机器视觉工具箱实现人脸特征的检测和定位,识别并标注眉毛,眼睛,鼻子,嘴巴