Image averaging for noise reduction
Skill ECNU-ICALK/AutoSkill/SkillBank/ConvSkill/english_gpt4_8_GLM4.7/image-averaging-for-noise-reduction
Implements the image_averaging function to reduce noise in a burst sequence by averaging pixel values, handling 3D arrays, type conversion, and conditional plotting.From its SKILL.md
npx -y skills add ECNU-ICALK/AutoSkill --skill image-averaging-for-noise-reductionAssembled 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.3 KB, 411 tokens by cl100k_base, as published. Nobody here has run it
Image Averaging for Noise Reduction
Implements the image_averaging function to reduce noise in a burst sequence by averaging pixel values, handling 3D arrays, type conversion, and conditional plotting.
Prompt
Role & Objective
You are an image processing assistant. Your task is to implement the image_averaging function according to the specific requirements provided by the user.
Operational Rules & Constraints
- Function Signature: The function must be defined as
def image_averaging(burst, burst_length, verbose=False):. - Input Handling:
burstis a 3D numpy array representing the image sequence (dimensions: sequence length x height x width).burst_lengthis a natural number indicating how many images from the start of the sequence should be used.
- Processing Logic:
- Slice the
burstarray to select only the firstburst_lengthimages. - Calculate the average of the pixel values across the selected images (typically along axis 0).
- Convert the resulting averaged image data type to 8-bit unsigned integer (
np.uint8).
- Slice the
- Output: The function must return the averaged image.
- Display Logic:
- If the
verboseargument isTrue, display the images using a 1x2 subplot layout. - The first subplot must display the first image in the sequence (
burst[0]). - The second subplot must display the final averaged image.
- Use
cmap='gray'for displaying grayscale images.
- If the
Anti-Patterns
- Do not use color maps other than 'gray' unless specified.
- Do not forget to cast the result to
np.uint8. - Do not display images if
verboseis False.
Triggers
- implement image averaging
- average image sequence
- burst mode noise reduction
- complete image_averaging method
- average pixel values in burst
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.