fieldCount

64 views
Skip to first unread message

Martin Gejl

unread,
May 11, 2023, 6:53:11 AM5/11/23
to FIELDimageR: A R package to analyze orthomosaic images from field trials.
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

Martin Gejl

unread,
May 12, 2023, 5:41:13 AM5/12/23
to FIELDimageR: A R package to analyze orthomosaic images from field trials.
Hi
I have solved the problem.
If you experience the same error try
> test1<-aggregate(test,fact=6) #reduce image size
In stead of fact=4 use 6

regards
Martin 

Reply all
Reply to author
Forward
0 new messages