Introduction - If you have any usage issues, please Google them yourself
Algorithmic steps:
Given the size of an image M*N, it can be converted from RGB space to LAB space, and the color space of LAB is more comprehensive.
If the predefined parameter K, K is the number of pre-generated super-pixels, i.e., the image of M*N size (the number of pixels is M*N) is expected to be divided into K super-pixel blocks, each of which contains [(M*N)/K] pixels.
Assuming that the length and width of each super-pixel region are evenly distributed, the length and width of each super-pixel block can be defined as S, S = sqrt (M*N/K).
The traversal operation saves the coordinates (x, y) and lab values of the central points of each pixel block and adds them to a pre-defined set.