Extended Line Description in Halcon and OpenCV

2024-08-31 00:52

本文主要是介绍Extended Line Description in Halcon and OpenCV,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

In HALCON, the term XLD refers to “Extended Line Description.” XLDs are used to represent precise geometrical features, such as lines, contours, ellipses, and polygons, at a subpixel level for high-precision tasks. XLDs are especially useful in industrial applications where precision is key (e.g., metrology, pattern matching).

In comparison, OpenCV doesn’t have a direct equivalent to HALCON’s XLD but provides its own set of tools for edge detection, contour finding, and shape analysis, though generally at a pixel-level precision. Below are some comparisons between XLD in HALCON and relevant OpenCV features:

  1. Subpixel Precision
    HALCON (XLD): XLD offers subpixel-accurate representation and processing of edges, contours, and geometric shapes. This is essential for applications where even small inaccuracies can affect the result, such as quality control in manufacturing.
    OpenCV: OpenCV primarily works at pixel-level precision but does have some methods to refine contours or corners to subpixel precision, such as cv::cornerSubPix() for corner refinement and methods for refining edges using Hough Transforms.
  2. Contour Representation
    HALCON (XLD): XLD contours are highly flexible, and they allow for more detailed representations of object edges, with options for smooth interpolation between points and precise control over features.
    OpenCV: OpenCV offers cv::findContours() to detect and represent object boundaries. However, these contours are pixel-based, and while OpenCV supports some approximation methods (like chain approximation), they don’t reach the subpixel precision of HALCON’s XLD.
  3. Line Detection and Fitting
    HALCON (XLD): XLD includes advanced line and shape fitting tools that work with subpixel precision. For example, you can fit lines, circles, and ellipses using XLD objects, and these fits can be refined to subpixel accuracy.
    OpenCV: OpenCV provides functions like cv::fitLine() for line fitting and cv::HoughLines() for line detection. While these methods are powerful, they operate at pixel-level resolution, and fitting accuracy may not match the subpixel precision of HALCON’s XLD algorithms.
  4. Edge Detection and Subpixel Contour Processing
    HALCON (XLD): HALCON’s XLD includes edge detection at subpixel accuracy, allowing the creation of XLD contours directly from gradient-based edge operators. These contours can be used for further geometric analysis.
    OpenCV: OpenCV offers edge detection methods like cv::Canny(), but this detection is based on pixel-level gradients. For subpixel-level processing, OpenCV lacks the precision seen in HALCON’s XLD, though some refinement can be achieved via interpolation or corner refinement.
  5. Geometric and Shape Analysis
    HALCON (XLD): XLD enables precise measurement of geometrical features (e.g., angles, distances, and shapes) with subpixel accuracy. XLD contours are designed for fine-tuned shape analysis.
    OpenCV: OpenCV provides shape descriptors (e.g., Hu Moments, contour area, and bounding boxes), but the analysis is less accurate than HALCON’s XLD due to OpenCV’s pixel-based approach.
  6. Ellipse and Circle Fitting
    HALCON (XLD): HALCON provides highly accurate tools for fitting ellipses and circles to XLD contours, which can be used for tasks like object detection or metrology with subpixel precision.
    OpenCV: OpenCV provides cv::fitEllipse() and cv::minEnclosingCircle() for fitting ellipses and circles. These functions work well for many use cases, but they lack the precision and flexibility of HALCON’s XLD, especially when dealing with noisy or partial data.
  7. XLD Operators
    HALCON (XLD): XLD has a range of operators for processing contours, such as smoothing, extracting segments, and geometric transformations (scaling, rotation). These operators maintain subpixel precision.
    OpenCV: OpenCV offers geometric transformations (e.g., scaling, rotation) using functions like cv::warpAffine() and cv::getRotationMatrix2D(), but these are not tailored for subpixel contour refinement or precision.
    Summary
    XLD in HALCON provides subpixel precision for contour detection, line fitting, shape analysis, and edge detection, making it a powerful tool for high-precision applications like industrial inspection. OpenCV, on the other hand, offers robust pixel-based tools for these tasks but lacks the subpixel accuracy and specialized operators HALCON offers through XLD.

这篇关于Extended Line Description in Halcon and OpenCV的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/1122422

相关文章

使用opencv优化图片(画面变清晰)

文章目录 需求影响照片清晰度的因素 实现降噪测试代码 锐化空间锐化Unsharp Masking频率域锐化对比测试 对比度增强常用算法对比测试 需求 对图像进行优化,使其看起来更清晰,同时保持尺寸不变,通常涉及到图像处理技术如锐化、降噪、对比度增强等 影响照片清晰度的因素 影响照片清晰度的因素有很多,主要可以从以下几个方面来分析 1. 拍摄设备 相机传感器:相机传

科研绘图系列:R语言扩展物种堆积图(Extended Stacked Barplot)

介绍 R语言的扩展物种堆积图是一种数据可视化工具,它不仅展示了物种的堆积结果,还整合了不同样本分组之间的差异性分析结果。这种图形表示方法能够直观地比较不同物种在各个分组中的显著性差异,为研究者提供了一种有效的数据解读方式。 加载R包 knitr::opts_chunk$set(warning = F, message = F)library(tidyverse)library(phyl

opencv 滚动条

参数介绍:createTrackbar( trackbarname , "hello" , &alpha_slider ,alpha_max ,  on_trackbar )  ;在标签中显示的文字(提示滑动条的用途) TrackbarName创建的滑动条要放置窗体的名字 “hello”滑动条的取值范围从 0 到 alpha_max (最小值只能为 zero).滑动后的值存放在

android-opencv-jni

//------------------start opencv--------------------@Override public void onResume(){ super.onResume(); //通过OpenCV引擎服务加载并初始化OpenCV类库,所谓OpenCV引擎服务即是 //OpenCV_2.4.3.2_Manager_2.4_*.apk程序包,存

OpenCV结构分析与形状描述符(11)椭圆拟合函数fitEllipse()的使用

操作系统:ubuntu22.04 OpenCV版本:OpenCV4.9 IDE:Visual Studio Code 编程语言:C++11 算法描述 围绕一组2D点拟合一个椭圆。 该函数计算出一个椭圆,该椭圆在最小二乘意义上最好地拟合一组2D点。它返回一个内切椭圆的旋转矩形。使用了由[90]描述的第一个算法。开发者应该注意,由于数据点靠近包含的 Mat 元素的边界,返回的椭圆/旋转矩形数据

树莓派5_opencv笔记27:Opencv录制视频(无声音)

今日继续学习树莓派5 8G:(Raspberry Pi,简称RPi或RasPi)  本人所用树莓派5 装载的系统与版本如下:  版本可用命令 (lsb_release -a) 查询: Opencv 与 python 版本如下: 今天就水一篇文章,用树莓派摄像头,Opencv录制一段视频保存在指定目录... 文章提供测试代码讲解,整体代码贴出、测试效果图 目录 阶段一:录制一段

Verybot之OpenCV应用三:色标跟踪

下面的这个应用主要完成的是Verybot跟踪色标的功能,识别部分还是居于OpenCV编写,色标跟踪一般需要将图像的颜色模式进行转换,将RGB转换为HSV,因为对HSV格式下的图像进行识别时受光线的影响比较小,但是也有采用RGB模式来进行识别的情况,这种情况一般光线条件比较固定,背景跟识别物在颜色上很容易区分出来。         下面这个程序的流程大致是这样的:

Verybot之OpenCV应用二:霍夫变换查找圆

其实我是想通过这个程序来测试一下,OpenCV在Verybot上跑得怎么样,霍夫变换的原理就不多说了,下面是程序: #include "cv.h"#include "highgui.h"#include "stdio.h"int main(int argc, char** argv){cvNamedWindow("vedio",0);CvCapture* capture;i

Verybot之OpenCV应用一:安装与图像采集测试

在Verybot上安装OpenCV是很简单的,只需要执行:         sudo apt-get update         sudo apt-get install libopencv-dev         sudo apt-get install python-opencv         下面就对安装好的OpenCV进行一下测试,编写一个通过USB摄像头采

虚拟机ubuntu配置opencv和opencv_contrib

前期准备  1.下载opencv和opencv_contrib源码 opencv-4.6.0:https://opencv.org/releases/ opencv_contrib-4.6.0:https://github.com/opencv/opencv_contrib 在ubuntu直接下载或者在window上下好传到虚拟机里都可以 自己找个地方把他们解压,个人习惯在home下新建一