Click here to Skip to main content
15,881,812 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Ive worked on this for some time and searched google with no luck. What I'm attempting is to scan each row of an image, and foreach pixel in row determine if the next pixel is equal to current, if so then an index(starts at 1) should be advanced by 1 until the next pixel is not equal or end of current row. The final index for the current color should be added to a collection with the row, column, and final index then the final index should be reset to 1 and continue on the current row unless end of row reached in that case start on next row.
Posted
Comments
BillWoodruff 10-Feb-14 8:37am    
You can adapt the code found here:

http://www.codeproject.com/Answers/677649/Csharp-find-the-majority-color-of-an-image

But, what about the case that there is a block of pixels in one color that spans columns, but not rows ? To determine color groupings, don't you need to scan in column-major order as well as in row-major order ?
charles henington 12-Feb-14 12:13pm    
yes bill you are absolutely correct i only asked about row as im trying to get column first once i fiqure out how to do this with rows then ill be able to apply such on the columns as well

1 solution

 
Share this answer
 
Comments
charles henington 12-Feb-14 12:11pm    
Thanks for the link. Checked it out but the issue that im facing is not simply finding a color at a given point or the most commonly used color but rather finding the length that each color continues in first row and then 2nd set and 3rd set so on and so on in first row store that data then move on to the second row and so on and so on. this is the first step once i get this narrowed down then same would have to be done with columns alike

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