# These are the steps to classify an example image supplied in the package
yellow <- "#ffcd0eff"
blue <- "#5536ffff"
ivy_oak_rgb <- read_image(system.file("extdata", "IvyOak400x300.JPG",
package = "pixelclasser"))
rule_01 <- pixel_rule("rule_01", "g", "b",
list(c(0.345, 1/3), c(0.40, 0.10)), comp_op = "<")
rule_02 <- pixel_rule("rule_02", "g", "b",
list(c(0.345, 1/3), c(0.40, 0.10)), comp_op = ">=")
cat_dead_leaves <- pixel_category("dead_leaves", blue, rule_01)
cat_living_leaves <- pixel_category("living_leaves", yellow, rule_02)
ivy_oak_classified <- classify_pixels(ivy_oak_rgb, cat_dead_leaves,
cat_living_leaves)
Run the code above in your browser using DataLab