View source: R/pixel_subcategory.R
pixel_subcategory | R Documentation |
Creates an object of class pixel_subcategory
from a list of objects of
class pixel_rule
.
pixel_subcategory(subcat_name, ...)
is.subcategory(x)
## S3 method for class 'pixel_subcategory'
summary(object, ...)
subcat_name |
a character string containing the name of the subcategory. |
... |
in |
x |
the R object being tested |
object |
an object of class |
When the shape of the cluster of pixels belonging to one category is not convex, the rules become inconsistent (the lines cross in awkward ways) and the classification produced is erroneous. To solve this problem, the complete set of rules is divided into several subsets (subcategories) that break the original non-convex shape into a set of convex polygons. Note that any polygon can be divided in a number of triangles, so this problem always has solution. However, in many cases (such as the one presented in the pixelclasser vignette) a complete triangulation is not needed.
Internally, classify_pixels()
classifies the points belonging to
each subcategory and then joins the incidence matrices using the or
operator, to create the matrix for the whole category.
An object of class "pixel_subcategory"
, which is a list with
these elements:
name
a character string containing the name of the
subcategory.
rules_list
a list of pixel_rule
objects.
pixel_rule
, pixel_category
rule01 <- pixel_rule("R01", "g", "b",
list(c(0.35, 0.30), c(0.45, 0.10)), ">=")
rule02 <- pixel_rule("R02", "g", "b",
list(c(0.35, 0.253), c(0.45, 0.253)), ">=")
subcat01 <- pixel_subcategory("Subcat_01", rule01, rule02)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.