Final Project Assessment 1: Removing noise from video frames

I have been training for 15 days, but it still shows this. Can anyone help me, please?

Answers (2)

It looks like a common error - don't copy the function definition into the online grader. The function definition is already there for you. Just copy the contents of the function into the online grader.
The function definition is there to avoid accidental typos in function names. Good luck! You're almost done.
I had the exact same issue while doing this MATLAB Grader assignment. The problem is that the grader is very strict about the output format.
Your current code has a few issues:
  • You accidentally defined enhanceImage() inside itself
  • The output image must be a 2D uint8 grayscale image
  • The grader specifically expects proper noise removal using a filtering method like a median filter
This version worked for me and passed both tests:
function img = enhanceImage(img)
% Convert RGB image to grayscale
img = rgb2gray(img);
% Remove salt-and-pepper noise
img = medfilt2(img,[3 3]);
end
A few important notes:
  • Do NOT create another function enhanceImage(img) inside the function
  • Keep only ONE function definition
  • rgb2gray() already returns a grayscale uint8 image
  • medfilt2() is the correct choice here because the noise is salt-and-pepper style noise
After replacing your code with the version above, click Run Function first and then Submit.

Products

Release

R2024b

Asked:

S K
on 4 Dec 2024

Answered:

on 13 May 2026 at 8:53

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!