Description Usage Arguments Value Note Examples
View source: R/01_raw_image_handling.R
Plots non-background pixels according to their color coordinates, and colors them according to their RGB or HSV values. Dimensions are either RGB or HSV depending on flags.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
img |
Either a path to an image or a |
n |
Number of randomly selected pixels to plot; recommend <20000 for speed. If n exceeds the number of non-background pixels in the image, all pixels are plotted. If n is not numeric, all pixels are plotted. |
lower |
RGB or HSV triplet specifying the lower bounds for background pixels. Default upper and lower bounds are set to values that work well for a bright green background (RGB [0, 1, 0]). |
upper |
RGB or HSV triplet specifying the upper bounds for background pixels. Default upper and lower bounds are set to values that work well for a bright green background (RGB [0, 1, 0]). Determining these bounds may take some trial and error, but the following bounds may work for certain common background colors:
If no background filtering is
needed, set bounds to some non-numeric value ( |
color.space |
The color space ( |
ref.white |
The reference white passed to
|
pch |
Passed to |
main |
Plot title. If left as "default", image name is used. |
from |
Original color space of image if plotting in CIE Lab space, probably either "sRGB" or "Apple RGB", depending on your computer. |
xlim, ylim, zlim |
Ranges for the X, Y, and Z axes. If "default", the widest ranges for each axis according to the specified color space (0-1 for RGB and HSV, 0-100 for L of Lab, -128-127 for a and b of Lab) are used. |
... |
Optional parameters passed to
|
3D plot of pixels in either RGB or HSV color space, colored according
to their color in the image. Uses
scatterplot3d
function.
If n
is not numeric, then all pixels are plotted, but this is
not recommended. Unless the image has a low pixel count, it takes much
longer, and plotting this many points in the plot window can obscure
important details.
There are seven CIE standardized illuminants available in
colordistance
(A, B, C, E, and D50, D55, and D65), but the most
common are:
"A"
: Standard incandescent lightbulb
"D65"
: Average daylight
"D50"
: Direct sunlight
1 2 3 | colordistance::plotPixels(system.file("extdata",
"Heliconius/Heliconius_B/Heliconius_07.jpeg", package="colordistance"),
n=20000, upper=rep(1, 3), lower=rep(0.8, 3), color.space = "rgb", angle = -45)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.