I need the image to be totally blank, so the black must disappear
1 Answer
$\begingroup$
$\endgroup$
10
Remove the white lines in the S with a vertical opening
Opening[i, {{1}, {1}, {1}}]
Remove the small black lines with a closing
Closing[%, 4]
Create a mask by inverting the colors and shrinking inside the boundary of the S with a 1 pixel erosion
mask = Erosion[1 - %, 1]
Add the mask to the original image
i + mask
(* i + Erosion[1 - Closing[Opening[i, {{1}, {1}, {1}}], 4], 1] *)
-
-
3$\begingroup$ +1, That is what I though OP meant, but when I read the tittle again, op said clearly to
BLANK ALL THE IMAGE
:) I have feeling one needs to be extra psychic these days to answer questions at stackexchange. $\endgroup$– NasserCommented May 15, 2018 at 19:11 -
$\begingroup$ Sorry Nasser, my english is bad, I use translator $\endgroup$ Commented May 16, 2018 at 0:39
-
$\begingroup$ @Batracos , hello, it's just what I need, but it throws me an error, (mathematical use 10.4) dropbox.com/s/7laz7ni8zw6kcl5/error.png?dl=0 $\endgroup$ Commented May 16, 2018 at 0:56
-
1$\begingroup$ @juanmuñoz: MMA 10 didn't support arithmetic operators on images yet. You can convert the images to matrices, perform arithmetic on those, then convert back to image. So e.g. instead of
img1 + img2
useImage[ImageData[img1]+ImageData[img2]]
- or upgrade to MMA 11 $\endgroup$ Commented May 16, 2018 at 6:11
ConstantImage[1, ImageDimensions[image]]
? $\endgroup$