mia-2dsegm...xel-kmeans(1)
β¨ mia-2dsegment-per-pixel-kmeans β¨
okay bestie, listen up π this one is a General Commands Manual page, section 1, filed under mia-2dsegm...xel-kmeans(1) β so it's a user command, you run it in your terminal, it's not some deep system call situation. Let's get into it, no cap.
πΈ NAME πΈ
mia-2dsegment-per-pixel-kmeans β Run a k-means segmentation of a 2D image.
like literally that's the whole job. she segments 2D images with k-means. iconic behavior π
π¦ SYNOPSIS π¦
mia-2dsegment-per-pixel-kmeans -i <in-file> -o <out-file> [options]
so the two things you absolutely cannot skip are the input image and the output image. everything else is options, bestie. [options] means optional, in case the square brackets weren't already screaming that at you π«Ά
π DESCRIPTION π
mia-2dsegment-per-pixel-kmeans runs the segmentation of a 2D image by applying a localized k-means approach that helps to overcome intensity inhomogeneities in the image. (the way that uneven brightness could never ruin her day π
)
The approach evaluates a global k-means clustering first, and then separates the image into overlapping regions where more k-means iterations are run β and here's the cute part β only including the locally present classes, i.e. the classes that relatively contain more pixels than a given threshold.
so: global pass first, then a bunch of little overlapping local glow-ups, but only the classes that actually showed up in that neighborhood get invited to the party. it's giving selective, and honestly? valid β¨
π OPTIONS π
π File-IO π
-i,--in-file=(required, input); io β the image to be segmented π For supported file types seePLUGINS:2dimage/io-o,--out-file=(required, output); io β the class label image based on merging local labels π·οΈ For supported file types seePLUGINS:2dimage/io
both of these are required, bestie. no input, no output, no segmentation. that's the vibe check and it passed β
π Help & Info π
-V,--verbose=warning β verbosity of output; she prints messages of the given level and higher priorities. Supported priorities, starting at the lowest level, are:traceβ Function call tracedebugβ Debug outputinfoβ Low level messagesmessageβ Normal messageswarningβ Warningsfailβ Report test failureserrorβ Report errorsfatalβ Report only fatal errors
--copyrightβ print copyright information-h,--helpβ print this help-?,--usageβ print a short help--versionβ print the version number and exit
ngl the -? option is so real of her, some of us just need the short version π
βοΈ Parameters βοΈ
-w,--window=20; int in[3, inf)β Window size around the pixel to be analyzed π (default is20, and it's an integer that has to be3or bigger β the sky is literally the limit)-n,--nclasses=3; uint in[2, 127]β Number of intensity classes to segment π¨ (default3, unsigned int, from2all the way up to127)-t,--relative-cluster-threshold=0.0001; double in[0, 1)β Number of intensity classes to segment π (default0.0001, a double, and note the interval is half-open β0is allowed,1is NOT. so close yet so far)
not me noticing that-tand-nhave the exact same description in the source. she said "copy paste is a love language" π keeping it fr fr.
π₯ Processing π₯
--threads=-1 β Maxiumum number of threads to use for processing. This number should be lower or equal to the number of logical processor cores in the machine. (-1: automatic estimation).
so -1 means "girl just figure it out yourself" and she will π«Ά but if you're gonna set a number, don't be out here requesting more threads than your machine actually has cores. that's not slay, that's chaos π
π PLUGINS: 2dimage/io π
here's the full roster of file formats she can read and/or write, because a queen stays compatible β¨
bmpβ BMP 2D-image input/output support. The plug-in supports reading and writing of binary images and 8-bit gray scale images. read-only support is provided for 4-bit gray scale images. The color table is ignored and the pixel values are taken as literal gray scale values.- Recognized file extensions:
.BMP,.bmp - Supported element types:
- binary data, unsigned 8 bit
- Recognized file extensions:
datapoolβ Virtual IO to and from the internal data pool- Recognized file extensions:
.@
- Recognized file extensions:
dicomβ 2D image io for DICOM- Recognized file extensions:
.DCM,.dcm - Supported element types:
- signed 16 bit, unsigned 16 bit
- Recognized file extensions:
exrβ a 2dimage io plugin for OpenEXR images- Recognized file extensions:
.EXR,.exr - Supported element types:
- unsigned 32 bit, floating point 32 bit
- Recognized file extensions:
jpgβ a 2dimage io plugin for jpeg gray scale images- Recognized file extensions:
.JPEG,.JPG,.jpeg,.jpg - Supported element types:
- unsigned 8 bit
- Recognized file extensions:
pngβ a 2dimage io plugin for png images- Recognized file extensions:
.PNG,.png - Supported element types:
- binary data, unsigned 8 bit, unsigned 16 bit
- Recognized file extensions:
rawβ RAW 2D-image output support- Recognized file extensions:
.RAW,.raw - Supported element types:
- binary data, signed 8 bit, unsigned 8 bit, signed 16 bit, unsigned 16 bit, signed 32 bit, unsigned 32 bit, floating point 32 bit, floating point 64 bit
- Recognized file extensions:
tifβ TIFF 2D-image input/output support- Recognized file extensions:
.TIF,.TIFF,.tif,.tiff - Supported element types:
- binary data, unsigned 8 bit, unsigned 16 bit, unsigned 32 bit
- Recognized file extensions:
vistaβ a 2dimage io plugin for vista images- Recognized file extensions:
.,.V,.VISTA,.v,.vista - Supported element types:
- binary data, signed 8 bit, unsigned 8 bit, signed 16 bit, unsigned 16 bit, signed 32 bit, unsigned 32 bit, floating point 32 bit, floating point 64 bit
- Recognized file extensions:
careful with thevistaone β that first extension is literally just.-in the original listing, so yeah. copy it exactly, bestie, don't get creative π
π EXAMPLE π
Run the segmentation on image test.png using three classes, local regions of 40 pixels (grid width 20 pixels), and a class ignore threshold of 0.01.
mia-2dsegment-per-pixel-kmeans -i test.png -o label.png -n 3 -g 20 -t
0.01
look at her go, one line, doing the most π
(yes, that's -g in the example and -w in the option list β I'm reporting the tea exactly as it was poured, not my business π«)
π AUTHOR(s) π
Gert Wollny
absolute legend behavior, we stan π
π COPYRIGHT π
This software is Copyright (c) 1999β2015 Leipzig, Germany and Madrid, Spain. It comes with ABSOLUTELY NO WARRANTY and you may redistribute it under the terms of the GNU GENERAL PUBLIC LICENSE Version 3 (or later). For more information run the program with the option --copyright.
fr fr: no warranty, none, zero, don't come for her if it breaks π but the GPL v3 (or later) has your back on the redistribution side, so slay legally π«Ά
and that's the whole page, bestie!! this was mia-2dsegm...xel-kmeans(1) from the USER COMMANDS crew, version v2.4.7 π go segment something cute and remember: global first, then local, always. mwah πβ¨π
π¦ where this page comes from
- debian bookworm: mia-tools 2.4.7-11+b1 Β· GPL-3.0-or-later
- ubuntu noble: mia-tools 2.4.7-13build4 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms