Hi
I am working on counting field germination in cereals from .jpg pictures.
It is working on one picture but not another picture. can someone help me with understanding the error message. I have copied the consol message. As you can see in the code, first picture goes good, second picture error message : Error in distmap(mask) : 'x' shouldn't contain any NAs
can anyone tels me whats going wrong
> test1<-aggregate(test,fact=4) #reduce image size
Warning messages:
1: [rast] unknown extent
2: [rast] unknown extent
3: [rast] unknown extent
> plotRGB(test1, r = 1, g = 2, b = 3)
> test1.shapeFile<-fieldPolygon(test1,extent = T)# Shapefile using the entire image (extent = T)
[1] "3 layers available"
> test1.Remsoil.NGRDI<- fieldMask(mosaic = test1,index = "NGRDI", cropValue = 0.02, cropAbove = F)# Using index "NGRDI" to remove background (above 0,02)
[1] "3 layers available"
> test1.count<-fieldCount(mosaic = test1.Remsoil.NGRDI$mask, fieldShape = test1.shapeFile$fieldShape, minSize = 0.015)
[1] "Identifying objects... "
[1] "You can speed up this step using n.core=16 or less."
[1] "Number of objects: 129"
> test<-stack("20230509_120111.jpg")
Warning message:
[rast] unknown extent
> test1<-aggregate(test,fact=4) #reduce image size
Warning messages:
1: [rast] unknown extent
2: [rast] unknown extent
3: [rast] unknown extent
> plotRGB(test1, r = 1, g = 2, b = 3)
> test1.shapeFile<-fieldPolygon(test1,extent = T)# Shapefile using the entire image (extent = T)
[1] "3 layers available"
> test1.Remsoil.NGRDI<- fieldMask(mosaic = test1,index = "NGRDI", cropValue = 0.02, cropAbove = F)# Using index "NGRDI" to remove background (above 0,02)
[1] "3 layers available"
> test1.count<-fieldCount(mosaic = test1.Remsoil.NGRDI$mask, fieldShape = test1.shapeFile$fieldShape, minSize = 0.015, n.core=16)
[1] "Identifying objects... "
[1] "You can speed up this step using n.core=16 or less."
Error in distmap(mask) : 'x' shouldn't contain any NAs