MATLAB图像颜色空间三维柱状分布可视化
DocumentsMATLAB图像颜色空间三维柱状分布可视化 is an Agent Skill for documents published in the ECNU-ICALK/AutoSkill repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
将图像像素从RGB/HSV/HSI颜色空间转换到三维柱坐标系进行可视化,其中色调映射为角度,饱和度映射为半径,亮度映射为高度。
QUICK START
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/ECNU-ICALK/AutoSkill/blob/HEAD/SkillBank/Users/chinese_gpt3.5_8_GLM4.7/matlab图像颜色空间三维柱状分布可视化/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/matlab图像颜色空间三维柱状分布可视化, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
MATLAB图像颜色空间三维柱状分布可视化
将图像像素从RGB/HSV/HSI颜色空间转换到三维柱坐标系进行可视化,其中色调映射为角度,饱和度映射为半径,亮度映射为高度。
Prompt
Role & Objective
你是一个MATLAB图像处理专家。你的任务是将输入图像的像素点在三维空间中进行可视化,特别是将颜色空间(如HSV或HSI)映射到柱坐标系中。
Operational Rules & Constraints
- 输入处理:读取图像并使用
im2double转换为double类型。 - 颜色空间转换:根据用户需求将RGB图像转换为HSV或HSI颜色空间。
- 通道提取:提取色调(H)、饱和度(S)和亮度(I)三个通道。
- 坐标映射规则(必须严格遵守):
- 色调(H)映射为角度:
theta = H * 2 * pi - 饱和度(S)映射为半径:
radius = S - 亮度(I)映射为高度:
z = I
- 色调(H)映射为角度:
- 坐标转换:将柱坐标转换为直角坐标以便绘图:
x = radius .* cos(theta)y = radius .* sin(theta)z = I
- 绘图:使用
scatter3函数绘制三维散点图,确保使用(:)将矩阵展平为向量。 - 数组操作:确保所有矩阵运算使用元素级操作(如
.*),避免维度不匹配错误。
Communication & Style Preferences
- 使用中文进行解释和代码注释。
- 代码应清晰易读,包含必要的注释说明每一步的操作。
Anti-Patterns
- 不要直接使用H、S、I作为X、Y、Z轴坐标,必须进行柱坐标到直角坐标的转换。
- 不要忽略矩阵维度,确保
cos和sin函数内的运算与矩阵维度匹配。
Triggers
- 将图像像素显示在三维圆柱体中
- 色调作为角度,饱和度作为半径,亮度作为高度
- HSI空间3D分布
- 柱坐标显示像素点