Thank you so much for the reply. Honestly am still struggling to understand what to do as am a complete newbie. There are two things am struggling with. Let me ask you the simpler one first. The JSON data am getting from the URL when I do a HTTP POST is given below. How do I extract only the values I want, and maybe print it on my serial console so I can see the values am receiving? The values I want are of the 6 hex
values or the 6 rgb values. Thanks for all the help.
{
"stats" : {
"hsv" : {
"h" : {
"min" : [
"0"
],
"avg" : [
"34 0.00"
],
"max" : [
"360"
],
"median" : [
42
]
},
"v" : {
"min" : [
"15"
],
"avg" : [
63
],
"max" : [
"94"
],
"median" : [
69
]
},
"s" : {
"min" : [
"0"
],
"avg" : [
25
],
"max" : [
"75"
],
"median" : [
21
]
}
},
"rgb" : {
"r" : {
"min" : [
"36"
],
"avg" : [
154
],
"max" : [
"239"
],
"median" : [
165
]
},
"g" : {
"min" : [
"29"
],
"avg" : [
141
],
"max" : [
"235"
],
"median" : [
151
]
},
"b" : {
"min" : [
"37"
],
"avg" : [
126
],
"max" : [
"233"
],
"median" : [
129
]
}
},
"lch" : {
"l" : {
"min" : [
"12"
],
"avg" : [
59
],
"max" : [
"93"
],
"median" : [
64
]
},
"c" : {
"min" : [
"0"
],
"avg" : [
16
],
"max" : [
"65"
],
"median" : [
12
]
},
"h" : {
"min" : [
"1"
],
"avg" : [
"76 0.00"
],
"max" : [
"360"
],
"median" : [
85
]
}
},
"lab" : {
"l" : {
"min" : [
"12"
],
"avg" : [
59
],
"max" : [
"93"
],
"median" : [
64
]
},
"a" : {
"min" : [
"-26"
],
"avg" : [
4
],
"max" : [
"43"
],
"median" : [
4
]
},
"b" : {
"min" : [
"-9"
],
"avg" : [
10
],
"max" : [
"55"
],
"median" : [
8
]
}
}
},
"file" : {
"w" : 50,
"w0" : 1080,
"filename" : "/home/martink/www/htdocs/color-summarizer/tmp/color_summarizer_oshZL5F.2",
"h0" : 1080
},
"clusters" : {
"4" : {
"hsv" : [
"24",
"55",
"81"
],
"n" : 350,
"cmyk" : [
"0",
"27",
"44",
"19"
],
"tags" : "di:raw:schnapps:serria:sienna:sour:whiskey:peach",
"num_neighbours_maxdE" : 5,
"rgb" : [
"207",
"138",
"94"
],
"lch" : [
"64",
"40",
"58"
],
"f" : 0.14,
"hex" : [
"#CF8A5E"
],
"xyz" : [
"0.37",
"0.32",
"0.15"
],
"neighbours" : "whiskey[1758][210,144,98](2.2):peach_schnapps[1581][198,128,89](4.4):raw_sienna[1699][214,138,89](4.5):di_serria[1821][212,145,93](4.9):whiskey_sour[1822][212,145,93](4.9):tan[1527][219,147,112](5.6):antique_brass[1630][200,138,101](5.8):beethoven[1728][209,148,108](6.1):burning_sand[1411][208,131,99](6.2):florentine_pink[1412][208,131,99](6.2)"
},
"1" : {
"hsv" : [
"166",
"18",
"69"
],
"n" : 538,
"cmyk" : [
"12",
"0",
"3",
"31"
],
"tags" : "boulevard:cascade:nymph:sea:skeptic:sorrento:unwind",
"num_neighbours_maxdE" : 7,
"rgb" : [
"145",
"177",
"170"
],
"lch" : [
"70",
"12",
"180"
],
"f" : 0.2152,
"hex" : [
"#91B1AA"
],
"xyz" : [
"0.35",
"0.4",
"0.44"
],
"neighbours" : "unwind[5476][152,183,175](2.5):sea_nymph[5469][138,174,164](2.6):cascade[5595][139,169,165](3.2):cascade[5456][140,168,160](3.2):skeptic[5349][157,180,170](3.3):sorrento[5557][154,176,172](4.4):boulevard[5533][142,165,160](5.0):pewter[5388][150,168,161](5.2):tower_grey[5348][156,172,165](5.7):ashanti[5400][166,187,179](5.8)"
},
"3" : {
"hsv" : [
"338",
"18",
"25"
],
"n" : 428,
"cmyk" : [
"0",
"5",
"3",
"75"
],
"tags" : "afficionado:barbecue:blackadder:caffeine:chocolate:cowboy:eclipse:half:horoscope:legend:lounge:platypus:urban",
"num_neighbours_maxdE" : 10,
"rgb" : [
"63",
"52",
"56"
],
"lch" : [
"23",
"6",
"353"
],
"f" : 0.1712,
"hex" : [
"#3F3438"
],
"xyz" : [
"0.04",
"0.04",
"0.04"
],
"neighbours" : "caffeine[8166][60,49,53](1.1):horoscope[16][67,55,58](1.2):half_barbecue[8245][60,53,55](1.9):platypus[223][61,51,52](2.1):afficionado[185][69,54,56](2.3):urban_legend[8062][66,51,58](2.6):blackadder[8074][56,45,50](3.0):eclipse[388][63,57,57](3.8):cowboy[641][68,55,54](3.8):chocolate_lounge[7889][69,60,67](3.9)"
},
"0" : {
"hsv" : [
"34",
"16",
"78"
],
"n" : 736,
"cmyk" : [
"0",
"6",
"13",
"22"
],
"tags" : "antique:bison:craigieburn:cream:drought:eighth:half:hide:joss:malta:nullarbor:quarter:rickshaw:sandcastle:thorndon:triple:white",
"num_neighbours_maxdE" : 10,
"rgb" : [
"200",
"185",
"167"
],
"lch" : [
"76",
"11",
"80"
],
"f" : 0.2944,
"hex" : [
"#C8B9A7"
],
"xyz" : [
"0.48",
"0.5",
"0.44"
],
"neighbours" : "quarter_malta[2469][198,184,166](1.0):quarter_rickshaw[2152][203,185,168](1.7):half_sandcastle[2512][194,180,161](2.0):half_drought[2681][202,189,169](2.0):half_joss[2308][198,185,171](2.1):eighth_nullarbor[2566][194,180,160](2.2):antique_white[2428][205,192,176](2.3):bison_hide[2892][193,183,164](2.5):triple_thorndon_cream[3132][197,189,170](2.6):quarter_craigieburn[3067][191,183,166](2.7)"
},
"2" : {
"hsv" : [
"18",
"30",
"54"
],
"n" : 448,
"cmyk" : [
"0",
"11",
"16",
"46"
],
"tags" : "slate:cement:coffee:donkey:dune:peachpuff:puff:roman:russett:sand:wrangler:brown:peach",
"num_neighbours_maxdE" : 9,
"rgb" : [
"138",
"110",
"97"
],
"lch" : [
"49",
"15",
"50"
],
"f" : 0.1792,
"hex" : [
"#8A6E61"
],
"xyz" : [
"0.18",
"0.17",
"0.14"
],
"neighbours" : "wrangler[1593][128,103,90](3.0):donkey_brown[2112][129,110,92](4.4):cement[2005][141,118,98](4.5):russett[1369][125,101,92](4.6):sand_dune[1594][130,111,101](4.7):peach_puff[2043][139,119,101](4.9):peachpuff[2044][139,119,101](4.9):roman_coffee[1847][125,103,87](4.9):slate_brown[1848][125,103,87](4.9):beaver[1624][146,111,91](5.1)"
}
}
}