Send
Close Add comments:
(status displays here)
Got it! This site "robinsnyder.com" uses cookies. You consent to this by clicking on "Got it!" or by continuing to use this website. Note: This appears on each machine/browser from which this site is accessed.
Case study: color analysis
1. Case study: color analysis
In 2017 I did some work on color analysis of children's crayon drawings for a nurse doing research on that and related topics.
2. Found poetry
This was part of a "
Fund Poetry in Type 1 Diabetes" poster presented at a research meeting (by someone for whom I did some of this work).
Here is some text from the brochure (created by the person for whom I did some of this work).
3. Color calibration
Color calibration and matching can be very complex.
4. Crayola
Colors were based on scanning results and the Crayola color codes (found on the Internet).
5. Colors
There are many colors and only a few are needed. But which ones?
6. Projects
I worked on such a project at Armstrong Research many years ago. The claim was that the project would fail if the programming did not get done. I was assigned, using an Apple Two computer with UCSD Pascal on it. I programmed what they wanted (including using spline approximation techniques).
The software worked as intended. But their ideas did not really work well.
I started with getting some crayons and hand coloring the desired colors.
This did not work as well as expected so I created/cropped separate parts for analysis.
7. On-line colors
There are many references on-line as to the exact hex makeup of crayon colors.
This was useful.
8. Grouping colors
There ended up being too many colors so some close ones were merged. Grouping colors can be achieved using a Euclidean distance in color space (perhaps not the best way, but appeared to work pretty well).
The three color dimensions are then, say, the following where (r, g, b) corresponds to (x, y, z)
r: 0..255 as red
g: 0..255 as green
b: 0..255 as blue
9. Three dimensions
The distance
d between colors (r
1,g
1, b
1) and (r
2, g
2, b
2) in RGB color space is determined as follows.
The above math formula can be written in C as the following coding expression (as an assignment statement).
d = sqrt(pow(r2-r1,2) + pow(g2-g1,2) + pow(b2-b1, 2))
10. Color remark via email
I noticed that some "pink" and "green" (and some other) crayon colors are color-wise near to the "gray". Note that whenever "pink" or "green" is greater than you might see on the drawing, the "gray" color is also high. I might be able to figure out how to avoid this. For now, it is a systematic error (that is, consistent shift) that appears on all drawings that use gray. The more gray, the more the pink and green. 2017-04-22
11. Color remark via email
I removed some colors that look different to us but are actually very close to gray. A scanner does not always reflect the exact color we see for every dot/pixel on the page, so the fewer colors used the more the results/charts appear to match the image. In any case, some picture drawings will have trace amounts of various colors because of the way crayons leave colors and scanners recognize those colors. 2017-04-24
12. Original color key
The original color key had too many colors to be useful.
13. Gray issues
The color "gray" is often reported by the scanner or recognized from the scan when it probably should be some other color. This "gray" can be considered "noise".
Email message remark from me: Using the Crayola color for gray, which moved gray away from the previous gray, some gray noise was eliminated. 2017-04-28:
14. Revised color key
The revised color key sheet contains the colors used.
Note that colors were merged to the closest color of those used.
15. Python list
Here is one of the (final) lists used for the colors.
16. Just in case
Since images, spreadsheets, documents, etc., can be generated, one can generate many forms of the target files just-in-case they are later needed once the research project is over.
Python and matplotlib and PIL and openpyxl and python-docx were extensively used in creating the target files.
17. Generated documents
A document summary was generated including many of the images with some data.
18. Date stamps
In general, when generating summary documents, spreadsheets, etc., it can be useful to include the (dash) date in the filename.
Exploratory code is always changing. Besides keeping a backup of code versions (automatically) it can be useful to have a history of generated summary files in case one wants to go back and see what was done before.
19. Categories
Categories included the following.
All
Gender-F, Gender-M (summary by gender)
Drawing-X (individual drawings)
Age-X (summary by age)
Child-X (summary by child)
Picture with chart summary (for each of above)
20. Improved images
The images were improved by combining charts with images (of images) of the drawings represented by the chart.
21. Visualization
The creation of the combined images is a multi-step data-flow process design and implementation.
That is, when a change is made to the data, the code, the method, etc., all of the charts, images, and combined images are regenerated, as well as the summary document and spreadsheets.
22. Generated images
Many different images were generated, including charts using matplotlib.
At some point, some of the custom images were combined with chart images to create overlaid images containing chart and summary drawings.
23. Generated spreadsheets
Spreadsheets (i.e., sheets in a workbook) were generated in many different forms with the raw data and summarized data in case that data would be later needed.
24. Counts
The counts sheet contains the counts of colors found.
25. Percents
The counts sheet contains the percents of colors found.
26. End of page