如何对位图的像素进行排序? [英] how to have pixels of a bitmap sorted?

查看:91
本文介绍了如何对位图的像素进行排序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,我有一个包含像素的位图.我想要一个排序后的像素列表,以便可以到达其颜色,原始位置等.解决方案是什么?我应该有一个列表吗? strictures_包括颜色和像素位置?如果是,如何按结构的一部分(颜色)进行排序?这是我要写的算法名称:"Algorithm 4.1 Vincent-Soille分水岭算法[52] ."
以pdf命名:分水岭变换:定义,算法和
并行化策略"
地址:" 在此先谢谢您.

Hello,I have a bitmap including pixels.I want to have something like a list of the sorted pixels so that I can reach their color,original place ,etc.What''s the solution?Should I have a list of strictures_including color and place of pixels?If so,how can I sort the structures by one of their parts(color)?Here is the algorithim I''m trying to write with name:"Algorithm 4.1 Vincent-Soille watershed algorithm [52]."
in pdf named:"The Watershed Transform: De nitions, Algorithms and
Parallelization Strategies"
with address:"http://www.google.com/url?q=http://citeseerx.ist.psu.edu/viewdoc/download%3Fdoi%3D10.1.1.10.3852%26rep%3Drep1%26type%3Dpdf&sa=U&ei=nfUfTs2sFITAswbs8pWOAg&ved=0CA0QFjAA&sig2=-CJTSerOvP-yuFsS8i4A5A&usg=AFQjCNFT4WU0htcqWLrxlTRSyzZfEFo-HQ[^]"
Thanks in advance.

推荐答案

您为什么要这样做?您将得到的是一个比原始位图大很多的数据集:单独的位置数据将为32位-与ARGB像素大小相同-没有颜色信息或列表开销.

您想做些什么,以为您需要这个?
Why would you want to do that? All you will get is a data set that is bigger than the original bitmap by huge amounts: the location data alone will be 32 bits - the same size as a ARGB pixel - without the colour information, or list overhead.

What are you trying to do that you think you need this?


我建​​议使用System.Collection.Generic.Dictionary<Color, System.Collections.Generic.List<Point>>.它将按颜色(ARGB)索引所有像素位置,并将相同颜色的像素放入同一列表中.但是,我不确定这正是第一步要做的.相反,您需要在对颜色进行分类之前将其合并为单一的平均"颜色,并使用参数准则将这些颜色视为接近".但是,相同的数据结构会有所帮助.

—SA
I would suggest to use System.Collection.Generic.Dictionary<Color, System.Collections.Generic.List<Point>>. It would index all pixel locations by the color (ARGB) with pixels of identical color put in the same list. However, I''m not sure this is exactly what needs to be done at first step. Rather you will need to merge close colors in a single "average" color before classifying them, with parametric criterion for the colors to be considered "close". Nevertheless, the same data structure would help.

—SA


asma_from_yazd写道:
asma_from_yazd wrote:

我想要一个类似排序的像素列表,以便我可以到达它们的颜色,原始位置等.解决方案是什么?

I want to have something like a list of the sorted pixels so that I can reach their color,original place ,etc.What''s the solution?

  1. 选择排序标准.
  2. 对像素进行排序根据选择的排序标准.


不多也不少.

但是,正如 OriginalGriff 所述,没有(您的)进一步解释,我们很难找到这样的操作有用.


No more, no less.

However, as OriginalGriff noted, without (yours) further explanations, we can hardly find useful such a operation.


这篇关于如何对位图的像素进行排序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆