Segment image into parts.
Currently contains only quadtree segmentation.
*sequence-generator* dynamicSequence generator used to select pixels for decision about subdivision. Defaults to R2
low-discrepancy sequence.
(segment-pixels p ch)
(segment-pixels p ch {:keys [min-size max-size threshold], :or {min-size 4, max-size 256, threshold 15.0}})
Decompose channel ch
from Pixels
into square segments using quadtree decomposition.
min-size
is minimum size of segmentmax-size
is maximum sizethreshold
is accuracy (minimum std dev of pixel values to make decision about subdivision).Returns lazy sequence of vectors containing x y size where x y is segment position and size
is a side length.
For segmentation, sequence generator (dynamic variable *sequence-generator*
is used.
Usage
(count (segment-pixels (p/load-pixels "docs/cockatoo.jpg") 0))
;;=> 705
(nth (segment-pixels (p/load-pixels "docs/cockatoo.jpg")
0
{:min-size 2, :threshold 40})
5)
;;=> [40 0 2]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4