Click here to Skip to main content
15,888,113 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.
Posted
Updated 14-Jul-11 22:17pm
v2

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?
 
Share this answer
 
Comments
ready to learn 15-Jul-11 1:58am    
I want to write watershed algorithim which determines the areas of the picture(according to the color).One of the steps in the algorithim I found is what I explained.after all I would be so thankfull if you help me to solve my problem or give me another watershed algorithim which doesn't cost this problem.
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
 
Share this answer
 
v3
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. Choose the sorting criterion.
  2. Sort the pixels according to the choosen sorting criterion.

No more, no less.

However, as OriginalGriff noted, without (yours) further explanations, we can hardly find useful such a operation.
 
Share this answer
 
Comments
ready to learn 15-Jul-11 4:05am    
I explaned more for OriginalGriff ,please read my explanation,besides I should say I want that list sorted by color so that I start from the least integer(color),go on, and reach the pixcels which have that color.I will show you the algorithim If I can
CPallini 15-Jul-11 4:08am    
Hence you need 'just' sorted list of positions (color number being the list key).
ready to learn 15-Jul-11 4:21am    
yeah.and how can I do that?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900