Last data update: 2014.03.03

R: Rotate an image (or matrix) 270 degrees.
rotate270R Documentation

Rotate an image (or matrix) 270 degrees.

Description

Rotate an image (or matrix) 270 degrees.

Usage

rotate270(img)

Arguments

img

A matrix or numeric array representation of an image.

Value

An image of equal dimensionality to the input, rotated 270 degrees.

Author(s)

Allison Irvine

See Also

displayImg

Examples

	data(pirate);
	#perform histogram equalization
	img = histeq(img);
	#convert to grayscale
	img = rowSums(img, dims=2)/3;
	#rotate image 270 degrees so it appears upright
	img = rotate270(img);
	#set colors
	levels = seq(0,1,.0000001);
	g = gray(levels);
	image(img,col=g)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(IM)
Loading required package: png
Loading required package: jpeg
Loading required package: bmp
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/IM/rotate270.Rd_%03d_medium.png", width=480, height=480)
> ### Name: rotate270
> ### Title: Rotate an image (or matrix) 270 degrees.
> ### Aliases: rotate270 rotate270-methods rotate270,Numbers-method
> ### Keywords: misc
> 
> ### ** Examples
> 
> 	data(pirate);
> 	#perform histogram equalization
> 	img = histeq(img);
> 	#convert to grayscale
> 	img = rowSums(img, dims=2)/3;
> 	#rotate image 270 degrees so it appears upright
> 	img = rotate270(img);
> 	#set colors
> 	levels = seq(0,1,.0000001);
> 	g = gray(levels);
> 	image(img,col=g)
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>