# NOT RUN {
# Get a matrix from your image. Here examples provided by bwimage package.
# I) Calculate vegetation denseness
bush<-system.file("extdata/bush.JPG",package ="bwimage")
bush_imagematrix<-threshold_color(bush, "jpeg", "proportional",compress_rate = 0.1)
denseness_total(bush_imagematrix)
# II) Calculate canopy openness
# Convert image into binary matrix
canopy<-system.file("extdata/canopy.JPG",package ="bwimage")
canopy_matrix<-threshold_color(canopy,"jpeg", compress_method="proportional",compress_rate=0.1)
1-denseness_total(canopy_matrix) # canopy openness
# }
Run the code above in your browser using DataLab