agentsclimarketplace

使用numpy向量化合并线性ldr图像为hdr图像

Skill ECNU-ICALK/AutoSkill/SkillBank/ConvSkill/chinese_gpt4_8/使用numpy向量化合并线性ldr图像为hdr图像

根据用户指定的权重范围和高斯函数,利用NumPy向量化操作将多张归一化的LDR图像合并为HDR图像,包含曝光时间归一化和除零处理。From its SKILL.md

Install
npx -y skills add ECNU-ICALK/AutoSkill --skill 使用numpy向量化合并线性ldr图像为hdr图像

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.4 KB, 681 tokens by cl100k_base, as published. Nobody here has run it

使用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. 异常处理

    • 处理除以零的情况,将结果中的 NaNInf 替换为 0。

Anti-Patterns

  • 严禁使用 for 循环遍历图像列表进行逐张处理。
  • 严禁忽略曝光时间的归一化(除以 t_j)。
  • 严禁在权重计算中使用 if/else 逐像素判断,必须使用 np.where 或布尔索引。

Triggers

  • numpy向量化合并HDR图像
  • LDR图像融合HDR代码
  • 高斯权重多曝光合并
  • 无循环图像融合算法

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.