Hello everyone,
I am new to R and have been trying to eliminate blurred/snow covered images from camera trap data. I have decided to import all these images and check the pixel variance for each of them, I want to then eliminate all the images with very low pixel variance and keep rest of them.
My code is a bit of mess right now, and I can't seem to figure out how to move forward with it.
Any kind of help would be appreciated.
install.packages("jpeg")
install.packages("ReadImages")
install.packages("Readbitmap")
install.packages ("Imager")
install.packages("magick")
install.packages("EBImage")
library(magick)
library(purrr)
library("jpeg")
library(EBImage)
library(dplyr)
setwd(".....")
Folder <- "....."
images <- list.files(path = Folder, pattern = "*.JPG", full.names = TRUE)
images
image_variance <- function(x) {
x %>%
as.raster() %>%
as.vector() %>%
map(col2rgb) %>%