Pollen count error

42 views
Skip to first unread message

Ahasanul Hoque

unread,
Jun 9, 2024, 8:04:32 AM6/9/24
to FIELDimageR: A R package to analyze orthomosaic images from field trials.
Hi,
I am using fieldimageR for pollen count but getting below mentioned error message (red colored, bold, image attached):

library(FIELDimageR) 
library(FIELDimageR.Extra) 
library(raster) 
library(terra) 
library(mapview) 
library(sf) 
library(stars)
 # Uploading image 
EX.P<-rast("P4.jpg") 
# Reducing image resolution (fast analysis) 
EX.P<-aggregate(EX.P,fact=4) 
plotRGB(EX.P, r = 1, g = 2, b = 3) 
# Using index "BIM" to remove background (above 19) 
EX.P<-imgLAB(EX.P)
EX.P.R1<- fieldMask(mosaic = EX.P,index = "BIM", cropValue = 19, cropAbove = T) [1] "3 layers available" 
fieldView(EX.P.R1$newMosaic) [1] "Starting analysis ..." [1] "End!" 
# Counting all pollens area>1000 (all sample) 
EX.P.Total<-fieldCount(mosaic = EX.P.R1$mask, plot=T)

Error in (function (classes, fdef, mtable) : unable to find an inherited method for function ‘width’ for signature ‘"SpatVector"’

Need help to solve this.

Screenshot 2024-06-09 065922.png
Reply all
Reply to author
Forward
0 new messages