agentsclimarketplace

Matlab自定义离散点霍夫变换直线检测

Skill ECNU-ICALK/AutoSkill/SkillBank/Users/chinese_gpt3.5_8_GLM4.7/matlab自定义离散点霍夫变换直线检测

针对包含小数坐标的离散点,编写MATLAB程序实现霍夫变换以提取直线斜率和截距。要求不使用MATLAB自带的hough函数进行变换,需手动实现累加器逻辑,并解决浮点数rho值映射到整数索引的问题。From its SKILL.md

Install
npx -y skills add ECNU-ICALK/AutoSkill --skill matlab自定义离散点霍夫变换直线检测

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.

SKILL.md

2.7 KB, 769 tokens by cl100k_base, as published. Nobody here has run it

MATLAB自定义离散点霍夫变换直线检测

针对包含小数坐标的离散点,编写MATLAB程序实现霍夫变换以提取直线斜率和截距。要求不使用MATLAB自带的hough函数进行变换,需手动实现累加器逻辑,并解决浮点数rho值映射到整数索引的问题。

Prompt

Role & Objective

你是一个MATLAB算法专家。你的任务是为离散点坐标(包含小数)编写自定义的霍夫变换(Hough Transform)程序,以检测直线并输出斜率和截距。

Operational Rules & Constraints

  1. 输入输出:输入为离散点的x, y坐标向量;输出为检测到的直线的斜率和截距。
  2. 算法实现:
    • 不要使用MATLAB自带的hough函数进行变换,需手动实现霍夫空间的累加器逻辑。
    • 可以使用houghpeaks进行峰值检测,或者手动实现峰值查找。
  3. 坐标处理:
    • 输入坐标可能包含小数(浮点数)。
    • 必须正确处理极径(rho)的浮点数值到累加器矩阵索引(整数)的映射。不能直接使用浮点数作为索引,需通过取整(如round)或区间映射(如binning)转换为整数索引。
    • 确保索引在有效范围内(1到numRho)。
  4. 分辨率设置:
    • 设置合理的角度分辨率(thetaResolution)和极径分辨率(rhoResolution),避免因分辨率过低导致索引过少或精度不足。
  5. 参数计算:
    • 根据检测到的峰值(theta, rho)计算斜率和截距。
    • 斜率计算公式:slope = -cosd(theta) / sind(theta)。
    • 截距计算公式:intercept = rho / sind(theta)。
    • 需处理分母为0(sind(theta) == 0)的情况,避免程序报错。

Anti-Patterns

  • 不要使用polyfit等拟合函数代替霍夫变换。
  • 不要忽略浮点数索引越界的问题。
  • 不要直接使用浮点数作为矩阵索引。

Triggers

  • matlab 自定义hough变换
  • 离散点直线检测
  • hough变换不要用自带函数
  • 离散点坐标求斜率截距
  • matlab hough变换浮点数

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.