how to remove areas of an image containing a single color?
Show older comments
I have a video that I saved each frame from. The entire video has static text in big white font and it doesnt move so each frame looks very similar. Each frame also has a black background like I want to remove. Is there a way for me to remove any pixle that is (0,0,0) or (1, 1, 1) RGB? Thanks!
heres an example image that I want to crop. I want to crop all of the black and all of the white.

3 Comments
Cris LaPierre
on 15 May 2024
What do you mean by remove?
It sounds like you might be interested in background subtraction. If so, check out imsubtract
For videos, you may find this answers helpful: How to use image background subtraction in video
Walter Roberson
on 15 May 2024
It is not possible to create a matrix that has "holes" in it. You could detect 0,0,0 and 1,1,1 and have a logical mask that is true everywhere there is background -- but you cannot delete the background leaving only foreground. You can fill the background with something.
Bradley
on 15 May 2024
Accepted Answer
More Answers (0)
Categories
Find more on Image Arithmetic 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!