Skip to content
Back to skills

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

ASecurity

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

  • 611 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 11, 2026
education

Security analysis

A100/100

Scanned November 11, 2026

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

Installs into .claude/skills of the current project.

Are you the author of Matlab自定义离散点霍夫变换直线检测?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Matlab自定义离散点霍夫变换直线检测
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ecnu-icalk-matlab-89d26b14/badge)](https://www.skillsdirectory.com/skills/ecnu-icalk-matlab-89d26b14)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
id: "41d455dc-735d-4c98-b114-106754cf15c1"
name: "MATLAB自定义离散点霍夫变换直线检测"
description: "针对包含小数坐标的离散点,编写MATLAB程序实现霍夫变换以提取直线斜率和截距。要求不使用MATLAB自带的hough函数进行变换,需手动实现累加器逻辑,并解决浮点数rho值映射到整数索引的问题。"
version: "0.1.0"
tags:
  - "matlab"
  - "hough变换"
  - "直线检测"
  - "离散点"
  - "算法实现"
triggers:
  - "matlab 自定义hough变换"
  - "离散点直线检测"
  - "hough变换不要用自带函数"
  - "离散点坐标求斜率截距"
  - "matlab hough变换浮点数"
---

# 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变换浮点数

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in education →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.