All Projects → dahtah → Imager

dahtah / Imager

Licence: lgpl-3.0
R package for image processing

Programming Languages

r
7636 projects

Projects that are alternatives of or similar to Imager

Color recognition
🎨 Color recognition & classification & detection on webcam stream / on video / on single image using K-Nearest Neighbors (KNN) is trained with color histogram features by OpenCV.
Stars: ✭ 154 (-7.23%)
Mutual labels:  image-processing
Gasyori100knock
image processing codes to understand algorithm
Stars: ✭ 1,988 (+1097.59%)
Mutual labels:  image-processing
Pngtastic
A pure Java PNG image optimization and manipulation library
Stars: ✭ 159 (-4.22%)
Mutual labels:  image-processing
Gpuimage X
A Cross-platform (for both Android & iOS) Framework for GPU-based Filters, Video and Image Processing.
Stars: ✭ 154 (-7.23%)
Mutual labels:  image-processing
Degate
Open source software for chip reverse engineering.
Stars: ✭ 156 (-6.02%)
Mutual labels:  image-processing
Openisp
Image Signal Processor
Stars: ✭ 158 (-4.82%)
Mutual labels:  image-processing
Hltool
Go 开发常用工具库, Google2步验证客户端,AES加密解密,RSA加密解密,钉钉机器人,邮件发送,JWT生成解析,Log,BoltDB操作,图片操作,json操作,struct序列化
Stars: ✭ 151 (-9.04%)
Mutual labels:  image-processing
Bimef
Code and data for the research paper "A Bio-Inspired Multi-Exposure Fusion Framework for Low-light Image Enhancement" (Submitted to IEEE Transactions on Cybernetics)
Stars: ✭ 161 (-3.01%)
Mutual labels:  image-processing
Low Light Image Enhancement Resources
This is a resouce list for low light image enhancement
Stars: ✭ 155 (-6.63%)
Mutual labels:  image-processing
Open Solution Data Science Bowl 2018
Open solution to the Data Science Bowl 2018
Stars: ✭ 159 (-4.22%)
Mutual labels:  image-processing
Similarimagehunter
Mac 上寻找相似内容的图片工具
Stars: ✭ 155 (-6.63%)
Mutual labels:  image-processing
Spectrum
A client-side image transcoding library.
Stars: ✭ 1,908 (+1049.4%)
Mutual labels:  image-processing
Deblurgan
Image Deblurring using Generative Adversarial Networks
Stars: ✭ 2,033 (+1124.7%)
Mutual labels:  image-processing
Fall Detection
Human Fall Detection from CCTV camera feed
Stars: ✭ 154 (-7.23%)
Mutual labels:  image-processing
Pdftabextract
A set of tools for extracting tables from PDF files helping to do data mining on (OCR-processed) scanned documents.
Stars: ✭ 1,969 (+1086.14%)
Mutual labels:  image-processing
Computer Vision Video Lectures
A curated list of free, high-quality, university-level courses with video lectures related to the field of Computer Vision.
Stars: ✭ 154 (-7.23%)
Mutual labels:  image-processing
Smartcrop.js
Content aware image cropping
Stars: ✭ 12,345 (+7336.75%)
Mutual labels:  image-processing
Essential Image Optimization
Essential Image Optimization - an eBook
Stars: ✭ 1,950 (+1074.7%)
Mutual labels:  image-processing
Php Legofy
Transform your images as if they were made out of LEGO bricks.
Stars: ✭ 161 (-3.01%)
Mutual labels:  image-processing
Gan Mri
Code repository for Frontiers article 'Generative Adversarial Networks for Image-to-Image Translation on Multi-Contrast MR Images - A Comparison of CycleGAN and UNIT'
Stars: ✭ 159 (-4.22%)
Mutual labels:  image-processing

Linux Build Status 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("dahtah/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 under Linux make sure you have the headers for libX11 and libfftw3 (optionally, libtiff as well). On my Ubuntu system this seems to be enough:

sudo apt-get install libfftw3-dev libx11-dev libtiff-dev

For other Linux distributions, you can query the SystemRequirements database to determine the relevant dependency package names for imager:

# install prerequisites
install.packages("remotes")
remotes::install_github("r-hub/sysreqs")

# set platform; supported platforms are listed here: https://github.com/r-hub/sysreqsdb/tree/master/platforms
target <- "linux-x86_64-arch-gcc"

# print package names as character vector
tmp <- tempfile(pattern = "DESCRIPTION")
download.file(url = "https://github.com/dahtah/imager/raw/master/DESCRIPTION",
              destfile = tmp)
sysreqs::(desc = tmp,
          platform = "linux-x86_64-arch-gcc",
	  soft = FALSE)
rm(tmp)

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].