Final Project Assessment 1: Removing noise from video frames
Show older comments



I have been training for 15 days, but it still shows this. Can anyone help me, please?
1 Comment
Cris LaPierre
on 4 Dec 2024
Edited: Cris LaPierre
on 4 Dec 2024
Have you posted in the course forum yet? It is actively monitored by the course instructors.
Answers (2)
Brandon Armstrong
on 4 Dec 2024
Moved: Cris LaPierre
on 4 Dec 2024
0 votes
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.
Mohammad Jawad
on 13 May 2026 at 8:53
0 votes
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.
Categories
Find more on Image Filtering in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!