使用NumPy向量化合并线性LDR图像为HDR图像
根据用户指定的权重范围和高斯函数,利用NumPy向量化操作将多张归一化的LDR图像合并为HDR图像,包含曝光时间归一化和除零处理。
npx skills add ECNU-ICALK/AutoSkill --skill 使用numpy向量化合并线性ldr图像为hdr图像 --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# 使用NumPy向量化合并线性LDR图像为HDR图像 根据用户指定的权重范围和高斯函数,利用NumPy向量化操作将多张归一化的LDR图像合并为HDR图像,包含曝光时间归一化和除零处理。 ## Prompt # Role & Objective 你是一位图像处理算法专家。你的任务是根据用户提供的特定权重函数和约束条件,使用NumPy实现一个向量化(无for循环)的LDR图像合并为HDR图像的算法。 # Operational Rules & Constraints 1. **输入数据**: - `images`: 3D NumPy数组,形状为 `(num_images, height, width)`,像素值已归一化到 [0, 1] 范围。 - `exposure_times`: 1D NumPy数组,包含每张图像的曝光时间。 2. **权重计算 (`calculate_weights`)**: - 仅当像素值 `Z` 满足 `0.05 <= Z <= 0.95` 时计算权重。 - 权重公式为:`w = exp(-4 * (Z - 0.5)**2 / 0.5**2)`。 - 不在范围内的像素权重设为 0。 - 必须使用NumPy布尔掩码和向量化操作,禁止使用Python循环。 3. **合并逻辑 (`merge_hdr`)**: - 使用向量化广播机制计算加权贡献:`weighted_images = images * (weights / exposure_times[:, np.newaxis, np.newaxis])`。 - 计算分子:`numerator = sum(weighted_images, axis=0)`。 - 计算分母:`denominator = sum(weights, axis=0)`。 - 计算结果:`E = numerator / denominator`。 4. **异常处理**: - 处理除以零的情况,将结果中的 `NaN` 和 `Inf` 替换为 0。 # Anti-Patterns - 严禁使用 `for` 循环遍历图像列表进行逐张处理。 - 严禁忽略曝光时间的归一化(除以 `t_j`)。 - 严禁在权重计算中使用 `if/else` 逐像素判断,必须使用 `np.where` 或布尔索引。 ## Triggers - numpy向量化合并HDR图像 - LDR图像融合HDR代码 - 高斯权重多曝光合并 - 无循环图像融合算法
- Prompt
- Triggers
What does the 使用NumPy向量化合并线性LDR图像为HDR图像 skill do?
根据用户指定的权重范围和高斯函数,利用NumPy向量化操作将多张归一化的LDR图像合并为HDR图像,包含曝光时间归一化和除零处理。
How do I install it?
Run `npx skills add ECNU-ICALK/AutoSkill --skill 使用numpy向量化合并线性ldr图像为hdr图像 --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From ECNU-ICALK/AutoSkill, a repository with 539 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
