我有一组像这样的图像:
我希望用类似的矩阵对它们进行排序:
我如何在Matlab中执行此操作?
答案 0 :(得分:1)
您可以遵循的步骤。
1.Store the values as a matrix
2. Convert the rgb values to hsv colorspace using rgb2hsv function.
Example: C = rgb2hsv(C);
3. Then sort by hue first then by value
Example: C = sortrows(C, [-1 -3 2]); %# sort first by Hue, then by value
4. Convert it back to rgb
Exmaple : C = hsv2rgb(C);