imagefluency package is not working

Hello everyone,

I downloaded imagefluency package to analyze my images in Rstudio. I wrote code, added images to example-images file. But code is not working. I dont even get any error message from code. Can you help me about this situation?

library(imagefluency)

# Get complexity, contrast, simplicity and self similarity values of multiple images in a given folder (all images should be loaded in the "example_images" folder)

 imglist <- list("high_1.jpg", "high_2.jpg.jpg", "high_3.jpg", "high_4.jpg.jpg", "high_5.jpg.jpg", "high_6.jpg.jpg")


for (i in imglist) {

	i <- img_read(system.file("example_images", i, package = "imagefluency"))

	print(data.frame(img_complexity(i),img_contrast(i), mean(rgb2gray(i)), img_self_similarity(i)))

Best regards,
Beril

You need to contact the maintainers of the package about issues with the package. See the BugReports URL at CRAN - Package imagefluency

what steps did you take to place an image high_1.jpg in to the imagefluency's example_images folder ?
you probably shouldnt do this; as the example_images are what they are , and your own images shouldnt be a confusion around that. have your own folder, and make your code read the images from that.

I changed "example_images" as my document "high_resized" but still nothing changed. :frowning:

You are not understanding something.
the example_images provides in imagefluency are berries.jpg etc.

list.files(system.file("example_images",package = "imagefluency"))
 [1] "berries.jpg"      "bike.jpg"         "bridge.jpg"       "fireworks.jpg"   
 [5] "office.jpg"       "rails.jpg"        "romanesco.jpg"    "sky.jpg"         
 [9] "trees.jpg"        "valley_green.jpg" "valley_white.jpg"

why would you think that your own image 'high_resized' would be in the imagefluency example_images folder ? it wouldnt ...

do you know where your images are ?

Because, In my first trial, I added my images to example_images file.

In my second trial, I completely changed "example_images" name and wrote "high_resized". than thought that it will reach high resized document and find images.

I dont know if you need additional help or not.
Have you verified the location of your files of interest ?
once you have a known location, you would not use system.file()
you can list.files() on where you think your location is to verify what files are there.
you can do an img_read on them like

img_read(file.path(my_location,imglist[[1]]))

assuming that my_location is set to the actual path where your images are

my_location <- "yourpathgoeshere"

you can use your for loop, but first you need to establish where your images are (avoid using system.file)

Besides the issues with the folder already raised by nirgrahamuk, the code in your original post is missing a closing bracket for the loop.

Have you tried the proposed solution to your issue on github?

Assuming your images are in the folder high_resized, what does dir.exists("high_resized/") say? What is the result of file.exists("high_resized/high_1.jpg")?
If any of these commands are FALSE, then R cannot find your images (probably because you have to change your working directory first).

Best, Stefan (maintainer of imagefluency)

Hello again, I am grateful for your answers! The code you adviced worked well for me this time and I handled my problem. Thank you so much everyone.

Best regards, Beril

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.