Entering edit mode
Arnaud Duranel
▴
60
@arnaud-duranel-5720
Last seen 10.3 years ago
Hello
None of the EBImage filtering functions seems to work when there are
NAs
in the image:
library(EBImage)
lenac = readImage(system.file("images", "lena-color.png",
package="EBImage"))
lenag<-channel(lenac, 'gray')
lenag[1:50, ]<-NA
flo = makeBrush(21, shape='disc', step=FALSE)^2
flo = flo/sum(flo)
lenaflo = filter2(lenag, flo)
display(lenaflo)
any(!is.na(lenaflo))
Is there a way to process an image that includes NAs, with some kind
of
na.rm=TRUE?
I am working with pictures of irregularly-shaped objects, and the
pixels
between the picture margins and the object were set to NA using a
mask.
I want to apply filters to the object itself, not to the whole image.
Is
there another way to do this?
Many thanks for your help.
Best regards
A. Duranel, UCL Department of Geography