Coder Social home page Coder Social logo

imager's Introduction

CRAN Version LGPL licensed

Imager is an image/video processing package for R, based on CImg, a C++ library by David Tschumperlé. CImg provides an easy-to-use and consistent API for image processing, which imager largely replicates. CImg supports images in up to four dimensions, which makes it suitable for applications like video processing/hyperspectral imaging/MRI.

Installing the package

Imager is on CRAN, so

install.packages("imager")

should do the trick. You may also want to install ImageMagick and ffmpeg, see "External Dependencies" below.

The version of CRAN will often lag the one on github. If you'd like to install the latest version, you'll have to build the package from source.

Install the devtools package if you haven't already. Run:

devtools::install_github("asgr/imager")

If that doesn't work then you're probably missing a build environment or a library, see below.

OS X

Install XQuartz if you haven't already (it's required for the interactive functions). You'll need Xcode (OS X's development environment) to compile source packages. The FFTW library is needed, and the easiest way to install it is via Homebrew. Install Homebrew, then run:

brew install fftw

Optionally, install libtiff for better support of TIFF files.

Windows

Building R packages on Windows is a bit of a pain so you're probably better off with the binary package (which may not be up-to-date). If you need the latest version of imager, you'll have to:

  • Install Rtools
  • Install additional libraries for Rtools. You want the package that's called "local tree". Put those libraries somewhere gcc can find them.

Linux

To build imager from source under Linux, make sure you have the headers for libfftw3, libx11 (if not using Wayland), and optionally libtiff installed. To determine a complete list of all required system dependencies (incl. transitive ones), you can query the SystemRequirements database via the R package sysreqs.

Example R code to determine all required system dependencies for Ubuntu Linux:
# install necessary R packages
if (!("remotes" %in% rownames(installed.packages()))) {
    install.packages(pkgs = "remotes",
                     repos = "https://cloud.r-project.org/")
}
remotes::install_github(repo = "r-hub/sysreqs",
                        quiet = TRUE)

# download imager's DESCRIPTION file (to parse it for system requirements later on)
tmp <- tempfile(pattern = "DESCRIPTION")
download.file(url = "https://github.com/asgr/imager/raw/master/DESCRIPTION",
              destfile = tmp)

# print system package names
sysreqs::sysreqs(desc = tmp,
                 # set platform identifier (here we use the one for Ubuntu Linux)
                 # supported platforms are listed here: https://github.com/r-hub/sysreqsdb/tree/master/platforms
                 platform = "linux-x86_64-ubuntu-gcc",
                 soft = FALSE) |>
    cat()
#> libfftw3-dev libtiff-dev libxml2-dev libicu-dev libgmp-dev libpng-dev libglpk-dev

Created on 2023-04-13 with reprex v2.0.2

The last line above indicates the required system packages.

On Ubuntu (or Debian) Linux you would install them via

sudo apt install libfftw3-dev libtiff-dev libxml2-dev libicu-dev libgmp-dev libpng-dev libglpk-dev

External dependencies

OS X users need XQuartz. On its own imager supports JPEG, PNG, TIFF and BMP formats. If you need support for other file types install ImageMagick. To load and save videos you'll need ffmpeg, no file formats are supported natively.

Getting started

Here's a small demo that actually demonstrates an interesting property of colour perception:

library(imager)
library(purrr)
parrots <- load.example("parrots")
plot(parrots)
#Define a function that converts to YUV, blurs a specific channel, and converts back
bchan <- function(im,ind,sigma=5) { 
	im <- RGBtoYUV(im)
	channel(im,ind) <- isoblur(channel(im,ind),sigma); 
	YUVtoRGB(im)
}
#Run the function on all three channels and collect the results as a list
blurred <- map_il(1:3,~ bchan(parrots,.))
names(blurred) <- c("Luminance blur (Y)","Chrominance blur (U)","Chrominance blur (V)")
plot(blurred)

We're much more sensitive to luminance edges than we are to colour edges.

Documentation is available here. To get a list of all package functions, run:

ls(pos = "package:imager")

Important warning on memory usage

All images are stored as standard R numeric vectors (i.e., double-precision), meaning that they take up a lot of memory. It's easy to underestimate how much storage you need for videos, because they take up so little space in a compressed format. Before you can work on it in R a video has to be fully decompressed and stored as double-precision floats. To get a sense of the size, consider a low-resolution (400x300), colour video lasting 120 sec. The video might take up a few MBs when compressed. To store it in memory, you'll need: (400x300) x (25x120) x 3 values, corresponding to (space)x(time)x(colour). In addition, each value costs 8 bytes of storage, for a grand total of 8GB of memory.

For out-of-memory processing of videos, see the experimental package imagerstreams.

Current status

Imager is fully functional but still young, so the API might change. Open an issue on Github or email me if you've found a bug or would like to suggest a feature.

Contributing to imager

If you want to add features or fix a bug, just fork this repository and send me a pull request (they're welcome). Consider contributing documentation too: imager has got quite large over time, and it's in need of more how-to's and tutorials!

Contributors

The package's author is Simon Barthelmé (Gipsa-lab, CNRS). The following people have gracefully contributed code, bug fixes or testing:

  • Stefan Roediger
  • Aaron Robotham
  • Martin Roth
  • Jan Wijffels
  • Hong Ooi

Let me know if you're missing from the list!

Test pictures

Imager ships with four test pictures and a video. Two (parrots and boats) come from the Kodak set. Another is a sketch of birds by Leonardo, from Wikimedia. Also from Wikimedia: the Hubble Deep field. The test video comes from xiph.org's collection.

imager's People

Contributors

dahtah avatar shotaochi avatar asgr avatar rtobar avatar devsjr avatar sebastien-jalgos avatar bisaloo avatar salim-b avatar kalibera avatar karldw avatar velaco avatar arfon avatar uribo avatar

Stargazers

Yinan He avatar ChenXing avatar  avatar  avatar  avatar Filip Wästberg avatar Ethan Bass avatar Gumeo avatar Victor Tan avatar Chris Toney avatar jonmun avatar  avatar  avatar  avatar

Watchers

 avatar James Cloos avatar  avatar  avatar

imager's Issues

checking whether package ‘imager’ can be installed ... WARNING Found the following significant warnings: ../inst/include/CImg.h:29015:48: warning: ‘%s’ directive argument is null [-Wformat-overflow=] ../inst/include/CImg.h:58256:45: warning: ‘%s’ directive argument is null [-Wformat-truncation=]

Hello,

I am using the package ‘imager’ for my package that came across some issues in the installation related to ‘imager’.

There are some warnings found during the installation of the package ‘imager’:

using R Under development (unstable) (2024-05-07 r86527)
using platform: x86_64-pc-linux-gnu
R was compiled by
gcc-13 (Debian 13.2.0-24) 13.2.0
GNU Fortran (Debian 13.2.0-24) 13.2.0
running under: Debian GNU/Linux trixie/sid
using session charset: UTF-8
checking for file ‘imager/DESCRIPTION’ ... OK
checking extension type ... Package
this is package ‘imager’ version ‘1.0.1’
package encoding: UTF-8
checking package namespace information ... OK
checking package dependencies ... OK
checking if this is a source package ... OK
checking if there is a namespace ... OK
checking for executable files ... OK
checking for hidden files and directories ... OK
checking for portable file names ... OK
checking for sufficient/correct file permissions ... OK
checking whether package ‘imager’ can be installed ... WARNING
Found the following significant warnings:
../inst/include/CImg.h:29015:48: warning: ‘%s’ directive argument is null [-Wformat-overflow=]
../inst/include/CImg.h:58256:45: warning: ‘%s’ directive argument is null [-Wformat-truncation=]

using R Under development (unstable) (2024-05-07 r86527)
using platform: x86_64-pc-linux-gnu
R was compiled by
gcc-14 (GCC) 14.1.0
GNU Fortran (GCC) 14.1.0
running under: Fedora Linux 36 (Workstation Edition)
using session charset: UTF-8
using option ‘--no-stop-on-test-error’
checking for file ‘imager/DESCRIPTION’ ... OK
checking extension type ... Package
this is package ‘imager’ version ‘1.0.1’
package encoding: UTF-8
checking package namespace information ... OK
checking package dependencies ... OK
checking if this is a source package ... OK
checking if there is a namespace ... OK
checking for executable files ... OK
checking for hidden files and directories ... OK
checking for portable file names ... OK
checking for sufficient/correct file permissions ... OK
checking whether package ‘imager’ can be installed ... [24m/19m] WARNING
Found the following significant warnings:
../inst/include/CImg.h:29015:48: warning: '%s' directive argument is null [-Wformat-overflow=]
../inst/include/CImg.h:29246:55: warning: '%d' directive output may be truncated writing between 1 and 10 bytes into a region of size 6 [-Wformat-truncation=]
../inst/include/CImg.h:29245:69: warning: '%d' directive output may be truncated writing between 1 and 10 bytes into a region of size 6 [-Wformat-truncation=]

using R version 4.3.3 (2024-02-29 ucrt)
using platform: x86_64-w64-mingw32 (64-bit)
R was compiled by
gcc.exe (GCC) 12.3.0
GNU Fortran (GCC) 12.3.0
running under: Windows Server 2022 x64 (build 20348)
using session charset: UTF-8
checking for file 'imager/DESCRIPTION' ... OK
checking extension type ... Package
this is package 'imager' version '1.0.1'
package encoding: UTF-8
checking package namespace information ... OK
checking package dependencies ... OK
checking if this is a source package ... OK
checking if there is a namespace ... OK
checking for hidden files and directories ... OK
checking for portable file names ... OK
checking whether package 'imager' can be installed ... WARNING
Found the following significant warnings:
D:/rtools43/usr/lib/mxe/usr/x86_64-w64-mingw32.static.posix/include/winnt.h:8404:37: warning: ISO C++ forbids flexible array member 'Elements' [-Wpedantic]
D:/rtools43/usr/lib/mxe/usr/x86_64-w64-mingw32.static.posix/include/winnt.h:8667:22: warning: ISO C++ forbids flexible array member 'pEventLogRecords' [-Wpedantic]
D:/rtools43/usr/lib/mxe/usr/x86_64-w64-mingw32.static.posix/include/winnt.h:8673:13: warning: ISO C++ forbids flexible array member 'ulOffsets' [-Wpedantic]
D:/rtools43/usr/lib/mxe/usr/x86_64-w64-mingw32.static.posix/include/rpcndr.h:447:19: warning: ISO C++ forbids flexible array member 'Format' [-Wpedantic]
D:/rtools43/usr/lib/mxe/usr/x86_64-w64-mingw32.static.posix/include/oaidl.h:548:37: warning: ISO C++ prohibits anonymous structs [-Wpedantic]
D:/rtools43/usr/lib/mxe/usr/x86_64-w64-mingw32.static.posix/include/oaidl.h:499:29: warning: ISO C++ prohibits anonymous structs [-Wpedantic]
See the install log for details.

Can these issues be fixed? Thank you.

All the best
Bill

Compilation error when trying to upgrade to imager v.0.45.8

Hi,

I have imager v.0.45.2 installed on my R v.4.3.1 and everything works fine.
However, BiocManager is now pinging me to upgrade to v.0.45.8, but the installation fails, with tons of errors:

trying URL 'https://stat.ethz.ch/CRAN/src/contrib/imager_0.45.8.tar.gz'
Content type 'application/x-gzip' length 4476718 bytes (4.3 MB)
==================================================
downloaded 4.3 MB

* installing *source* package ‘imager’ ...
** package ‘imager’ successfully unpacked and MD5 sums checked
** using staged installation
checking for pkg-config... /bin/pkg-config
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ -std=gnu++17 accepts -g... yes
checking how to run the C++ preprocessor... g++ -std=gnu++17 -E
checking for X... libraries , headers
checking for XOpenDisplay in -lX11... yes
X11 library found.
configure: Checking if FFTW3 library is available using pkg-config
checking for pkg-config... /bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for FFTW... yes
FFTW3 found!
checking whether pkg-config knows about libtiff-4... yes
checking for configurable backends... checking whether --static is needed... no
checking for g++ -std=gnu++17 option to support OpenMP... -fopenmp
configure: creating ./config.status
config.status: creating src/Makevars
** libs
using C++ compiler: ‘g++ (GCC) 13.1.1 20230614 (Red Hat 13.1.1-4)’
g++ -std=gnu++17 -I"/software/R-4.3.1/include" -DNDEBUG -I/usr/local/include  -Dcimg_use_fftw3   -Dcimg_use_tiff -I../inst/include -DCIMG_COMPILING -Dcimg_use_rng -Dcimg_use_r -Dcimg_use_fftw3_singlethread -Dcimg_verbosity=1 -Dcimg_date='""' -Dcimg_time='""' -I'/data/software/R-4.3.1/library/Rcpp/include' -I/usr/local/include   -fopenmp -fpic  -g -O2  -c RcppExports.cpp -o RcppExports.o
In file included from ../inst/include/imager.h:12,
                 from RcppExports.cpp:4:
../inst/include/CImg.h:51701:57: error: ‘uint16_t’ does not name a type
51701 |     void _load_tiff_tiled_contig(TIFF *const tif, const uint16_t samplesperpixel,
      |                                                         ^~~~~~~~
../inst/include/CImg.h:524:1: note: ‘uint16_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
  523 | #include "fftw3.h"
  +++ |+#include <cstdint>
  524 | }
../inst/include/CImg.h:51702:40: error: ‘uint32_t’ does not name a type
51702 |                                  const uint32_t nx, const uint32_t ny, const uint32_t tw, const uint32_t th) {
      |                                        ^~~~~~~~
../inst/include/CImg.h:51702:40: note: ‘uint32_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
../inst/include/CImg.h:51702:59: error: ‘uint32_t’ does not name a type
51702 |                                  const uint32_t nx, const uint32_t ny, const uint32_t tw, const uint32_t th) {
      |                                                           ^~~~~~~~
../inst/include/CImg.h:51702:59: note: ‘uint32_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
../inst/include/CImg.h:51702:78: error: ‘uint32_t’ does not name a type
51702 |                                  const uint32_t nx, const uint32_t ny, const uint32_t tw, const uint32_t th) {
      |                                                                              ^~~~~~~~
../inst/include/CImg.h:51702:78: note: ‘uint32_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
../inst/include/CImg.h:51702:97: error: ‘uint32_t’ does not name a type
51702 |                                  const uint32_t nx, const uint32_t ny, const uint32_t tw, const uint32_t th) {
      |                                                                                                 ^~~~~~~~
../inst/include/CImg.h:51702:97: note: ‘uint32_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
../inst/include/CImg.h:51725:59: error: ‘uint16_t’ does not name a type
51725 |     void _load_tiff_tiled_separate(TIFF *const tif, const uint16_t samplesperpixel,
      |                                                           ^~~~~~~~
../inst/include/CImg.h:51725:59: note: ‘uint16_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
../inst/include/CImg.h:51726:42: error: ‘uint32_t’ does not name a type
51726 |                                    const uint32_t nx, const uint32_t ny, const uint32_t tw, const uint32_t th) {
      |                                          ^~~~~~~~
../inst/include/CImg.h:51726:42: note: ‘uint32_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
../inst/include/CImg.h:51726:61: error: ‘uint32_t’ does not name a type
51726 |                                    const uint32_t nx, const uint32_t ny, const uint32_t tw, const uint32_t th) {
      |                                                             ^~~~~~~~
../inst/include/CImg.h:51726:61: note: ‘uint32_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
../inst/include/CImg.h:51726:80: error: ‘uint32_t’ does not name a type
51726 |                                    const uint32_t nx, const uint32_t ny, const uint32_t tw, const uint32_t th) {
      |                                                                                ^~~~~~~~
../inst/include/CImg.h:51726:80: note: ‘uint32_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
../inst/include/CImg.h:51726:99: error: ‘uint32_t’ does not name a type
51726 |                                    const uint32_t nx, const uint32_t ny, const uint32_t tw, const uint32_t th) {
      |                                                                                                   ^~~~~~~~
../inst/include/CImg.h:51726:99: note: ‘uint32_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
../inst/include/CImg.h:51749:51: error: ‘uint16_t’ does not name a type
51749 |     void _load_tiff_contig(TIFF *const tif, const uint16_t samplesperpixel, const uint32_t nx, const uint32_t ny) {
      |                                                   ^~~~~~~~
../inst/include/CImg.h:51749:51: note: ‘uint16_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
../inst/include/CImg.h:51749:83: error: ‘uint32_t’ does not name a type
51749 |     void _load_tiff_contig(TIFF *const tif, const uint16_t samplesperpixel, const uint32_t nx, const uint32_t ny) {
      |                                                                                   ^~~~~~~~
../inst/include/CImg.h:51749:83: note: ‘uint32_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
../inst/include/CImg.h:51749:102: error: ‘uint32_t’ does not name a type
51749 |     void _load_tiff_contig(TIFF *const tif, const uint16_t samplesperpixel, const uint32_t nx, const uint32_t ny) {
      |                                                                                                      ^~~~~~~~
../inst/include/CImg.h:51749:102: note: ‘uint32_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
../inst/include/CImg.h:51774:53: error: ‘uint16_t’ does not name a type
51774 |     void _load_tiff_separate(TIFF *const tif, const uint16_t samplesperpixel, const uint32_t nx, const uint32_t ny) {
      |                                                     ^~~~~~~~
../inst/include/CImg.h:51774:53: note: ‘uint16_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
../inst/include/CImg.h:51774:85: error: ‘uint32_t’ does not name a type
51774 |     void _load_tiff_separate(TIFF *const tif, const uint16_t samplesperpixel, const uint32_t nx, const uint32_t ny) {
      |                                                                                     ^~~~~~~~
../inst/include/CImg.h:51774:85: note: ‘uint32_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
../inst/include/CImg.h:51774:104: error: ‘uint32_t’ does not name a type
51774 |     void _load_tiff_separate(TIFF *const tif, const uint16_t samplesperpixel, const uint32_t nx, const uint32_t ny) {
      |                                                                                                        ^~~~~~~~
../inst/include/CImg.h:51774:104: note: ‘uint32_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
../inst/include/CImg.h: In member function ‘void cimg_library::CImg<T>::_load_tiff_contig(TIFF*, int, int, int)’:
../inst/include/CImg.h:51752:9: error: ‘uint32_t’ was not declared in this scope
51752 |         uint32_t row, rowsperstrip = (uint32_t)-1;
      |         ^~~~~~~~
../inst/include/CImg.h:51752:9: note: ‘uint32_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
../inst/include/CImg.h:51753:48: error: ‘rowsperstrip’ was not declared in this scope
51753 |         TIFFGetField(tif,TIFFTAG_ROWSPERSTRIP,&rowsperstrip);
      |                                                ^~~~~~~~~~~~
../inst/include/CImg.h:51755:20: error: expected ‘;’ before ‘nrow’
51755 |           uint32_t nrow = (row + rowsperstrip>ny?ny - row:rowsperstrip);
      |                    ^~~~
../inst/include/CImg.h:51765:40: error: ‘nrow’ was not declared in this scope; did you mean ‘row’?
51765 |           for (unsigned int rr = 0; rr<nrow; ++rr)
      |                                        ^~~~
      |                                        row
../inst/include/CImg.h: In member function ‘void cimg_library::CImg<T>::_load_tiff_separate(TIFF*, int, int, int)’:
../inst/include/CImg.h:51777:9: error: ‘uint32_t’ was not declared in this scope
51777 |         uint32_t row, rowsperstrip = (uint32_t)-1;
      |         ^~~~~~~~
../inst/include/CImg.h:51777:9: note: ‘uint32_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
../inst/include/CImg.h:51778:48: error: ‘rowsperstrip’ was not declared in this scope
51778 |         TIFFGetField(tif,TIFFTAG_ROWSPERSTRIP,&rowsperstrip);
      |                                                ^~~~~~~~~~~~
../inst/include/CImg.h:51781:22: error: expected ‘;’ before ‘nrow’
51781 |             uint32_t nrow = (row + rowsperstrip>ny?ny - row:rowsperstrip);
      |                      ^~~~
../inst/include/CImg.h:51791:41: error: ‘nrow’ was not declared in this scope; did you mean ‘row’?
51791 |             for (unsigned int rr = 0;rr<nrow; ++rr)
      |                                         ^~~~
      |                                         row
../inst/include/CImg.h: In member function ‘cimg_library::CImg<T>& cimg_library::CImg<T>::_load_tiff(TIFF*, unsigned int, float*, cimg_library::CImg<typename cimg_library::cimg::last<T, char>::type>*)’:
../inst/include/CImg.h:51802:7: error: ‘uint16_t’ was not declared in this scope
51802 |       uint16_t samplesperpixel = 1, bitspersample = 8, photo = 0;
      |       ^~~~~~~~
../inst/include/CImg.h:51802:7: note: ‘uint16_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
../inst/include/CImg.h:51803:16: error: expected ‘;’ before ‘sampleformat’
51803 |       uint16_t sampleformat = 1;
      |                ^~~~~~~~~~~~
../inst/include/CImg.h:51804:7: error: ‘uint32_t’ was not declared in this scope
51804 |       uint32_t nx = 1, ny = 1;
      |       ^~~~~~~~
../inst/include/CImg.h:51804:7: note: ‘uint32_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
../inst/include/CImg.h:51806:75: error: ‘samplesperpixel’ was not declared in this scope
51806 |       const bool is_spp = (bool)TIFFGetField(tif,TIFFTAG_SAMPLESPERPIXEL,&samplesperpixel);
      |                                                                           ^~~~~~~~~~~~~~~
../inst/include/CImg.h:51807:44: error: ‘nx’ was not declared in this scope
51807 |       TIFFGetField(tif,TIFFTAG_IMAGEWIDTH,&nx);
      |                                            ^~
../inst/include/CImg.h:51808:45: error: ‘ny’ was not declared in this scope; did you mean ‘yn’?
51808 |       TIFFGetField(tif,TIFFTAG_IMAGELENGTH,&ny);
      |                                             ^~
      |                                             yn
../inst/include/CImg.h:51809:48: error: ‘sampleformat’ was not declared in this scope
51809 |       TIFFGetField(tif, TIFFTAG_SAMPLEFORMAT, &sampleformat);
      |                                                ^~~~~~~~~~~~
../inst/include/CImg.h:51810:56: error: ‘bitspersample’ was not declared in this scope
51810 |       TIFFGetFieldDefaulted(tif,TIFFTAG_BITSPERSAMPLE,&bitspersample);
      |                                                        ^~~~~~~~~~~~~
../inst/include/CImg.h:51811:45: error: ‘photo’ was not declared in this scope
51811 |       TIFFGetField(tif,TIFFTAG_PHOTOMETRIC,&photo);
      |                                             ^~~~~
../inst/include/CImg.h:51843:19: error: expected primary-expression before ‘const’
51843 |         uint32_t *const raster = (uint32_t*)_TIFFmalloc(nx*ny*sizeof(uint32_t));
      |                   ^~~~~
../inst/include/CImg.h:51844:14: error: ‘raster’ was not declared in this scope
51844 |         if (!raster) {
      |              ^~~~~~
../inst/include/CImg.h:51851:37: error: ‘raster’ was not declared in this scope
51851 |         TIFFReadRGBAImage(tif,nx,ny,raster,0);
      |                                     ^~~~~~
../inst/include/CImg.h:51875:18: error: expected ‘;’ before ‘config’
51875 |         uint16_t config;
      |                  ^~~~~~
../inst/include/CImg.h:51876:48: error: ‘config’ was not declared in this scope
51876 |         TIFFGetField(tif,TIFFTAG_PLANARCONFIG,&config);
      |                                                ^~~~~~
../inst/include/CImg.h:51878:20: error: expected ‘;’ before ‘tw’
51878 |           uint32_t tw = 1, th = 1;
      |                    ^~
../inst/include/CImg.h:51879:47: error: ‘tw’ was not declared in this scope; did you mean ‘tm’?
51879 |           TIFFGetField(tif,TIFFTAG_TILEWIDTH,&tw);
      |                                               ^~
      |                                               tm
../inst/include/CImg.h:51880:48: error: ‘th’ was not declared in this scope; did you mean ‘tm’?
51880 |           TIFFGetField(tif,TIFFTAG_TILELENGTH,&th);
      |                                                ^~
      |                                                tm
../inst/include/CImg.h: In member function ‘const cimg_library::CImg<T>& cimg_library::CImg<T>::_save_tiff(TIFF*, unsigned int, unsigned int, const t&, unsigned int, const float*, const char*) const’:
../inst/include/CImg.h:55879:7: error: ‘uint32_t’ was not declared in this scope
55879 |       uint32_t rowsperstrip = (uint32_t)-1;
      |       ^~~~~~~~
../inst/include/CImg.h:55879:7: note: ‘uint32_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
../inst/include/CImg.h:55880:7: error: ‘uint16_t’ was not declared in this scope
55880 |       uint16_t spp = _spectrum, bpp = sizeof(t)*8, photometric;
      |       ^~~~~~~~
../inst/include/CImg.h:55880:7: note: ‘uint16_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
../inst/include/CImg.h:55881:11: error: ‘spp’ was not declared in this scope
55881 |       if (spp==3 || spp==4) photometric = PHOTOMETRIC_RGB;
      |           ^~~
../inst/include/CImg.h:55881:29: error: ‘photometric’ was not declared in this scope
55881 |       if (spp==3 || spp==4) photometric = PHOTOMETRIC_RGB;
      |                             ^~~~~~~~~~~
../inst/include/CImg.h:55882:12: error: ‘photometric’ was not declared in this scope
55882 |       else photometric = PHOTOMETRIC_MINISBLACK;
      |            ^~~~~~~~~~~
../inst/include/CImg.h:55897:48: error: ‘spp’ was not declared in this scope
55897 |       TIFFSetField(tif,TIFFTAG_SAMPLESPERPIXEL,spp);
      |                                                ^~~
../inst/include/CImg.h:55904:46: error: ‘bpp’ was not declared in this scope
55904 |       TIFFSetField(tif,TIFFTAG_BITSPERSAMPLE,bpp);
      |                                              ^~~
../inst/include/CImg.h:55906:44: error: ‘photometric’ was not declared in this scope
55906 |       TIFFSetField(tif,TIFFTAG_PHOTOMETRIC,photometric);
      |                                            ^~~~~~~~~~~
../inst/include/CImg.h:55909:7: error: ‘rowsperstrip’ was not declared in this scope
55909 |       rowsperstrip = TIFFDefaultStripSize(tif,rowsperstrip);
      |       ^~~~~~~~~~~~
../inst/include/CImg.h:55917:20: error: expected ‘;’ before ‘nrow’
55917 |           uint32_t nrow = (row + rowsperstrip>_height?_height - row:rowsperstrip);
      |                    ^~~~
../inst/include/CImg.h:55920:40: error: ‘nrow’ was not declared in this scope; did you mean ‘row’?
55920 |           for (unsigned int rr = 0; rr<nrow; ++rr)
      |                                        ^~~~
      |                                        row
make: *** [/software/R-4.3.1/etc/Makeconf:200: RcppExports.o] Error 1
ERROR: compilation failed for package ‘imager’
* removing ‘/data/software/R-4.3.1/library/imager’
* restoring previous ‘/data/software/R-4.3.1/library/imager’

The downloaded source packages are in
        ‘/tmp/RtmpuqVlR5/downloaded_packages’
Warning message:
In install.packages("imager") :
  installation of package ‘imager’ had non-zero exit status

Is this a problem with my config, or is there an #include missing, as suggested by the compiler:

../inst/include/CImg.h:51701:57: error: ‘uint16_t’ does not name a type
51701 |     void _load_tiff_tiled_contig(TIFF *const tif, const uint16_t samplesperpixel,
      |                                                         ^~~~~~~~
../inst/include/CImg.h:524:1: note: ‘uint16_t’ is defined in header ‘<cstdint>’; **did you forget to ‘#include <cstdint>’?**

Thanks in advance

set_omp_num_threads compiling error (utils.cpp)

Hi!

When compiling in R (macOS, arm64) I am getting the following error:

utils.cpp:336:3: error: use of undeclared identifier 'omp_set_num_threads'; did you mean 'set_omp_num_threads'? omp_set_num_threads(threads); ^~~~~~~~~~~~~~~~~~~ set_omp_num_threads utils.cpp:333:6: note: 'set_omp_num_threads' declared here void set_omp_num_threads(int threads) ^ 1 error generated. make: *** [utils.o] Error 1

bug

Excuse me, when I install package by devtools::install_github("asgr/imager"), before this I have conducted command'sudo apt install libfftw3-dev libtiff-dev libxml2-dev libicu-dev libgmp-dev libpng-dev libglpk-dev' ,but after devtools, it reminds that as figures described
1705151549928
How do I solve it? My linux is Ubuntu 22.04.2 LTS

How can I load an (sRGB-)image in HSV-color space?

Hello,

I am quite confused about how to control which color-space imager::load.image() loads images, or rather about how to properly convert them to a desired color-space.

Assume the attached jpg-image is loaded via imager:

path <- r"(example.jpg)"
im <- imager::load.image(path)
im_srgb_to_rgb <- imager::sRGBtoRGB(im)
im_rgb_to_hsv <- imager::RGBtoHSV(im_srgb_to_rgb)
imager::display(im)
imager::display(im_srgb_to_rgb)
imager::display(im_rgb_to_hsv)

Original sRGB-Image on disc, saved as 'example.jpg':
example

Image as loaded and displayed via imager::display(im) (subset):
grafik

Image after srgb2rgb:
grafik

Image after rgb2hsv:
grafik

This obviously does not seem to be right - at least to my eyes; the first transformation from SRGB to RGB works properly.
However, then converting to HSV results in the mess we see above. This also occures if we convert the loaded im directly to HSV. Note that imager::spectrum(im) returns 3, so the originally loaded images does have 3 channels. I would assume that therefore I should be able to convert SRGB > RGB > HSL.

What exactly am I missing?
Any help is welcome.

Thank you.
Sincerely,
~Gw


As background, I must detect yellow & green pixels within comparable images; and from my understanding I'd much rather do so in HSV-color space than in RGB, because color-detection in RGB is rather annoying.
So the actual question really is how I can load an image as HSV as resource-efficient as possible, without apparently nuking the image?

Build failure with errors related to standard integer types (uint*_t) in tiff function signatures.

Recently I have had build failures for the current CRAN version of imager (0.45.8) in certain environments (e.g. Debian Buster with libtiff-dev installed).

The errors reported relate to usage of standard integer types in the tiff function signatures, such as:
../inst/include/CImg.h:51701:57: error: ‘uint16_t’ does not name a type; did you mean ‘u_int16_t’?

It looks to me that CImg.h references these types without including <cstdint> as it should.

I can work around this issue by removing libtiff-dev, but at the expense of TIFF support.

I've attached a full build log with all errors.
imager_0-45-8_build_log_2024-03-13.txt

Suggestion: Loading subset of image as defined by coordinate set only

Hello,

this is kind of related to #14, but only tangentially so.

Image-loading takes quite a bit of time if you are processing 4k x 6k sized images.

In fact it takes so prohibitively long that I am currently trying to figure out how to load subset of an image only. Imager does not allow for this; but RBioFormats does. However, setting up that package properly has turned out to be very complicated.

A good amount of the image is unlikely to be relevant for me, and I'd rather just not load it to begin with and save myself a lot of time and resources.

Could imager::load.image() be expanded by 4 parameters x1,x2,y1,y2 defining the range of pixel locations imported?

As a reference, the RBioFormats has a suitable function that does this in principal.

RBioFormats::read.image(
                                file = image.path,
                                ...,
                                subset = list(x=x1:x2,y1:y2)
                            )

Unfortunately, I have found that its image-data is not 1-to-1 with the data loaded by imager. I would not have assumed those to load identical data, but I certainly hoped for it. At this point I am not sure if the value differences are small enough so that I can deprecate imager::load.image() for RBioFormats::read.image() to implement this; because I have not come around to testing this particular change.

Nonetheless I would prefer a native support in imager so that I don't have to worry about these value diffs. Additionally, setting up RBioFormats() is somewhat of a pain to manage; particularly when you must consider it in the scope of a package, instead of a "normal" script-environment.

Is something like this possible in principal?

Thank you.
Sincerely,
~Gw

Install error in R 4.3.3

System: Ubuntu 22.04.4 LTS (GNU/Linux 5.15.0-105-generic x86_64) - Uptodate
FFTW version 3.3.10 is installed
imager 0.45.8 already installed

In R:

install.packages("imager")
gives an error (see below).

Have you a solution... I searched for but I found nothing.
Thanks
Marc

In R:

install.packages("imager")
Installation du package dans ‘/home/mgirond/R/x86_64-pc-linux-gnu-library/4.3’
(car ‘lib’ n'est pas spécifié)
essai de l'URL 'https://cloud.r-project.org/src/contrib/imager_1.0.1.tar.gz'
Content type 'application/x-gzip' length 4509699 bytes (4.3 MB)
==================================================
downloaded 4.3 MB

  • installing source package ‘imager’ ...
    ** package ‘imager’ correctement décompressé et sommes MD5 vérifiées
    ** using staged installation
    checking for pkg-config... /usr/bin/pkg-config
    checking whether the C++ compiler works... yes
    checking for C++ compiler default output file name... a.out
    checking for suffix of executables...
    checking whether we are cross compiling... no
    checking for suffix of object files... o
    checking whether we are using the GNU C++ compiler... yes
    checking whether g++ -std=gnu++17 accepts -g... yes
    checking how to run the C++ preprocessor... g++ -std=gnu++17 -E
    checking for X... libraries , headers
    checking for XOpenDisplay in -lX11... yes
    X11 library found.
    configure: Checking if FFTW3 library is available using pkg-config
    checking for pkg-config... /usr/bin/pkg-config
    checking pkg-config is at least version 0.9.0... yes
    checking for FFTW... yes
    FFTW3 found!
    checking whether pkg-config knows about libtiff-4... yes
    checking for configurable backends... checking whether --static is needed... no
    checking for g++ -std=gnu++17 option to support OpenMP... -fopenmp
    configure: creating ./config.status
    config.status: creating src/Makevars
    ** libs
    using C++ compiler: ‘g++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’
    using C++11
    g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -Dcimg_use_fftw3 -I/usr/local/include -I/usr/include/x86_64-linux-gnu -Dcimg_use_tiff -I../inst/include -DCIMG_COMPILING -Dcimg_use_rng -Dcimg_use_r -Dcimg_use_fftw3_singlethread -Dcimg_verbosity=1 -Dcimg_date='""' -Dcimg_time='""' -I'/usr/local/lib/R/site-library/Rcpp/include' -fopenmp -fpic -g -O2 -ffile-prefix-map=/build/r-base-14Q6vq/r-base-4.3.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -c RcppExports.cpp -o RcppExports.o
    g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -Dcimg_use_fftw3 -I/usr/local/include -I/usr/include/x86_64-linux-gnu -Dcimg_use_tiff -I../inst/include -DCIMG_COMPILING -Dcimg_use_rng -Dcimg_use_r -Dcimg_use_fftw3_singlethread -Dcimg_verbosity=1 -Dcimg_date='""' -Dcimg_time='""' -I'/usr/local/lib/R/site-library/Rcpp/include' -fopenmp -fpic -g -O2 -ffile-prefix-map=/build/r-base-14Q6vq/r-base-4.3.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -c colourspace.cpp -o colourspace.o
    g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -Dcimg_use_fftw3 -I/usr/local/include -I/usr/include/x86_64-linux-gnu -Dcimg_use_tiff -I../inst/include -DCIMG_COMPILING -Dcimg_use_rng -Dcimg_use_r -Dcimg_use_fftw3_singlethread -Dcimg_verbosity=1 -Dcimg_date='""' -Dcimg_time='""' -I'/usr/local/lib/R/site-library/Rcpp/include' -fopenmp -fpic -g -O2 -ffile-prefix-map=/build/r-base-14Q6vq/r-base-4.3.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -c coordinates.cpp -o coordinates.o
    g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -Dcimg_use_fftw3 -I/usr/local/include -I/usr/include/x86_64-linux-gnu -Dcimg_use_tiff -I../inst/include -DCIMG_COMPILING -Dcimg_use_rng -Dcimg_use_r -Dcimg_use_fftw3_singlethread -Dcimg_verbosity=1 -Dcimg_date='""' -Dcimg_time='""' -I'/usr/local/lib/R/site-library/Rcpp/include' -fopenmp -fpic -g -O2 -ffile-prefix-map=/build/r-base-14Q6vq/r-base-4.3.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -c display.cpp -o display.o
    g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -Dcimg_use_fftw3 -I/usr/local/include -I/usr/include/x86_64-linux-gnu -Dcimg_use_tiff -I../inst/include -DCIMG_COMPILING -Dcimg_use_rng -Dcimg_use_r -Dcimg_use_fftw3_singlethread -Dcimg_verbosity=1 -Dcimg_date='""' -Dcimg_time='""' -I'/usr/local/lib/R/site-library/Rcpp/include' -fopenmp -fpic -g -O2 -ffile-prefix-map=/build/r-base-14Q6vq/r-base-4.3.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -c drawing.cpp -o drawing.o
    g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -Dcimg_use_fftw3 -I/usr/local/include -I/usr/include/x86_64-linux-gnu -Dcimg_use_tiff -I../inst/include -DCIMG_COMPILING -Dcimg_use_rng -Dcimg_use_r -Dcimg_use_fftw3_singlethread -Dcimg_verbosity=1 -Dcimg_date='""' -Dcimg_time='""' -I'/usr/local/lib/R/site-library/Rcpp/include' -fopenmp -fpic -g -O2 -ffile-prefix-map=/build/r-base-14Q6vq/r-base-4.3.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -c filtering.cpp -o filtering.o
    g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -Dcimg_use_fftw3 -I/usr/local/include -I/usr/include/x86_64-linux-gnu -Dcimg_use_tiff -I../inst/include -DCIMG_COMPILING -Dcimg_use_rng -Dcimg_use_r -Dcimg_use_fftw3_singlethread -Dcimg_verbosity=1 -Dcimg_date='""' -Dcimg_time='""' -I'/usr/local/lib/R/site-library/Rcpp/include' -fopenmp -fpic -g -O2 -ffile-prefix-map=/build/r-base-14Q6vq/r-base-4.3.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -c hough.cpp -o hough.o
    g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -Dcimg_use_fftw3 -I/usr/local/include -I/usr/include/x86_64-linux-gnu -Dcimg_use_tiff -I../inst/include -DCIMG_COMPILING -Dcimg_use_rng -Dcimg_use_r -Dcimg_use_fftw3_singlethread -Dcimg_verbosity=1 -Dcimg_date='""' -Dcimg_time='""' -I'/usr/local/lib/R/site-library/Rcpp/include' -fopenmp -fpic -g -O2 -ffile-prefix-map=/build/r-base-14Q6vq/r-base-4.3.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -c imgraphs.cpp -o imgraphs.o
    g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -Dcimg_use_fftw3 -I/usr/local/include -I/usr/include/x86_64-linux-gnu -Dcimg_use_tiff -I../inst/include -DCIMG_COMPILING -Dcimg_use_rng -Dcimg_use_r -Dcimg_use_fftw3_singlethread -Dcimg_verbosity=1 -Dcimg_date='""' -Dcimg_time='""' -I'/usr/local/lib/R/site-library/Rcpp/include' -fopenmp -fpic -g -O2 -ffile-prefix-map=/build/r-base-14Q6vq/r-base-4.3.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -c interact.cpp -o interact.o
    g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -Dcimg_use_fftw3 -I/usr/local/include -I/usr/include/x86_64-linux-gnu -Dcimg_use_tiff -I../inst/include -DCIMG_COMPILING -Dcimg_use_rng -Dcimg_use_r -Dcimg_use_fftw3_singlethread -Dcimg_verbosity=1 -Dcimg_date='""' -Dcimg_time='""' -I'/usr/local/lib/R/site-library/Rcpp/include' -fopenmp -fpic -g -O2 -ffile-prefix-map=/build/r-base-14Q6vq/r-base-4.3.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -c interpolation.cpp -o interpolation.o
    g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -Dcimg_use_fftw3 -I/usr/local/include -I/usr/include/x86_64-linux-gnu -Dcimg_use_tiff -I../inst/include -DCIMG_COMPILING -Dcimg_use_rng -Dcimg_use_r -Dcimg_use_fftw3_singlethread -Dcimg_verbosity=1 -Dcimg_date='""' -Dcimg_time='""' -I'/usr/local/lib/R/site-library/Rcpp/include' -fopenmp -fpic -g -O2 -ffile-prefix-map=/build/r-base-14Q6vq/r-base-4.3.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -c morphology.cpp -o morphology.o
    g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -Dcimg_use_fftw3 -I/usr/local/include -I/usr/include/x86_64-linux-gnu -Dcimg_use_tiff -I../inst/include -DCIMG_COMPILING -Dcimg_use_rng -Dcimg_use_r -Dcimg_use_fftw3_singlethread -Dcimg_verbosity=1 -Dcimg_date='""' -Dcimg_time='""' -I'/usr/local/lib/R/site-library/Rcpp/include' -fopenmp -fpic -g -O2 -ffile-prefix-map=/build/r-base-14Q6vq/r-base-4.3.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -c reductions.cpp -o reductions.o
    g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -Dcimg_use_fftw3 -I/usr/local/include -I/usr/include/x86_64-linux-gnu -Dcimg_use_tiff -I../inst/include -DCIMG_COMPILING -Dcimg_use_rng -Dcimg_use_r -Dcimg_use_fftw3_singlethread -Dcimg_verbosity=1 -Dcimg_date='""' -Dcimg_time='""' -I'/usr/local/lib/R/site-library/Rcpp/include' -fopenmp -fpic -g -O2 -ffile-prefix-map=/build/r-base-14Q6vq/r-base-4.3.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -c transformations.cpp -o transformations.o
    g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -Dcimg_use_fftw3 -I/usr/local/include -I/usr/include/x86_64-linux-gnu -Dcimg_use_tiff -I../inst/include -DCIMG_COMPILING -Dcimg_use_rng -Dcimg_use_r -Dcimg_use_fftw3_singlethread -Dcimg_verbosity=1 -Dcimg_date='""' -Dcimg_time='""' -I'/usr/local/lib/R/site-library/Rcpp/include' -fopenmp -fpic -g -O2 -ffile-prefix-map=/build/r-base-14Q6vq/r-base-4.3.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -c utils.cpp -o utils.o
    In file included from /usr/include/stdio.h:894,
    from /usr/include/c++/11/cstdio:42,
    from ../inst/include/CImg.h:73,
    from ../inst/include/imager.h:12,
    from utils.cpp:1:
    In function ‘int fprintf(FILE*, const char*, ...)’,
    inlined from ‘static double cimg_library::CImg::_cimg_math_parser::mp_vector_print(cimg_library::CImg::_cimg_math_parser&) [with T = double]’ at ../inst/include/CImg.h:29015:25:
    /usr/include/x86_64-linux-gnu/bits/stdio2.h:105:24: warning: ‘%s’ directive argument is null [-Wformat-overflow=]
    105 | return __fprintf_chk (__stream, __USE_FORTIFY_LEVEL - 1, __fmt,
    | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    106 | __va_arg_pack ());
    | ~~~~~~~~~~~~~~~~~
    g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -Dcimg_use_fftw3 -I/usr/local/include -I/usr/include/x86_64-linux-gnu -Dcimg_use_tiff -I../inst/include -DCIMG_COMPILING -Dcimg_use_rng -Dcimg_use_r -Dcimg_use_fftw3_singlethread -Dcimg_verbosity=1 -Dcimg_date='""' -Dcimg_time='""' -I'/usr/local/lib/R/site-library/Rcpp/include' -fopenmp -fpic -g -O2 -ffile-prefix-map=/build/r-base-14Q6vq/r-base-4.3.3=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -c wrappers.cpp -o wrappers.o
    g++ -std=gnu++11 -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -flto=auto -ffat-lto-objects -flto=auto -Wl,-z,relro -o imager.so RcppExports.o colourspace.o coordinates.o display.o drawing.o filtering.o hough.o imgraphs.o interact.o interpolation.o morphology.o reductions.o transformations.o utils.o wrappers.o -fopenmp -lX11 -Dcimg_use_fftw3 -L/usr/local/lib -lfftw3 -ltiff -L/usr/lib/R/lib -lR
    /usr/bin/ld: /usr/local/lib/libfftw3.a(assert.o): warning: relocation against stdout@@GLIBC_2.2.5' in read-only section .text'
    /usr/bin/ld: /usr/local/lib/libfftw3.a(assert.o): relocation R_X86_64_PC32 against symbol `stdout@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
    /usr/bin/ld: final link failed: bad value
    collect2: error: ld returned 1 exit status
    make: *** [/usr/share/R/share/make/shlib.mk:10: imager.so] Error 1
    ERROR: compilation failed for package ‘imager’
  • removing ‘/home/mgirond/R/x86_64-pc-linux-gnu-library/4.3/imager’
    Warning in install.packages :
    l'installation du package ‘imager’ a eu un statut de sortie non nul

Les packages source téléchargés sont dans
‘/tmp/RtmpBM3LLy/downloaded_packages’

Problem using load.video() from paths with spaces

I was having troubles loading .avi files with load.video(), but just with some files and not others, giving me this error:

Error in tryCatchList(expr, classes, parentenv, handlers) :
No output was generated

Found this unresolved old issue in the previous repository, with the same error. Not sure if it was caused by the same reason, but in my case, the problem was that the path to the video file had spaces in it. So, it resolved when I changed spaces into underscores (_), and I could recreate the error with other paths.

I was using imager 0.42 first, but then I installed the 0.45.2 and still throws the same error on that condition.

Interactively grabbing multiple points from an image

Is it possible to have an equivalent of graphics::locator in imager to grab coordinates of multiple points?

plot(boats)
locator(n = 4)

It is possible with grabPoint, but it selects only one point at a time. For multiple points, the image needs to be opened and closed multiple times.

grabPoint(boats)

This will be useful for large images where imager::display is faster than plot.

Imager on Windows fails its own CRAN Package Checks

Hello,

since a couple of hours ago, any and all GH-Action-executions of R CMD CHECK-routine break on windows-machines for the package
duflor.gui (any of the failed workflows beyond the #1).

Additionally, the CRAN package check results also suggest something is broken on windows-installs.

I would presume these two to be related, but I have no further insights into what exactly is going south.
Locally, I can compile duflor successfully on my windows-machine.

Edit: Issues on my end were caused by differently configured lockfiles, with the duflor.gui-package loading CRAN-packages from PPPM, and duflor going straight via cran. So this was unrelated, and thus can be disregarded.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.