diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-05-12 18:02:46 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-05-12 18:02:46 +0300 |
| commit | 8d58d0b03648069600f8abf39dbe68b16c90559b (patch) | |
| tree | 4b2fee06d34aacc4799504029f3484a152440439 /Software | |
| parent | 213a348824f382bcbf8ed3a627b4fc1cc572e6d1 (diff) | |
| download | Tango-8d58d0b03648069600f8abf39dbe68b16c90559b.tar.gz Tango-8d58d0b03648069600f8abf39dbe68b16c90559b.zip | |
Added TCC service use of benchmarks.
Diffstat (limited to 'Software')
| -rw-r--r-- | Software/DB/TCC/TCC.mdf | bin | 8388608 -> 8388608 bytes | |||
| -rw-r--r-- | Software/DB/TCC/TCC_log.ldf | bin | 8388608 -> 8388608 bytes | |||
| -rw-r--r-- | Software/Visual_Studio/TCC/Benchmarks/benchmarks_rgb_lab.csv | 212 | ||||
| -rw-r--r-- | Software/Visual_Studio/TCC/Tango.TCC.ColorDetector/PMR/TCC/DetectionColorFile.pb-c.c | 105 | ||||
| -rw-r--r-- | Software/Visual_Studio/TCC/Tango.TCC.ColorDetector/PMR/TCC/DetectionColorFile.pb-c.h | 73 | ||||
| -rw-r--r-- | Software/Visual_Studio/TCC/Tango.TCC.Service/Controllers/ColorDetectionController.cs | 11 | ||||
| -rw-r--r-- | Software/Visual_Studio/TCC/Tango.TCC.Service/Web.config | 4 |
7 files changed, 294 insertions, 111 deletions
diff --git a/Software/DB/TCC/TCC.mdf b/Software/DB/TCC/TCC.mdf Binary files differindex 583667787..beb586477 100644 --- a/Software/DB/TCC/TCC.mdf +++ b/Software/DB/TCC/TCC.mdf diff --git a/Software/DB/TCC/TCC_log.ldf b/Software/DB/TCC/TCC_log.ldf Binary files differindex 394c67999..9ebef8596 100644 --- a/Software/DB/TCC/TCC_log.ldf +++ b/Software/DB/TCC/TCC_log.ldf diff --git a/Software/Visual_Studio/TCC/Benchmarks/benchmarks_rgb_lab.csv b/Software/Visual_Studio/TCC/Benchmarks/benchmarks_rgb_lab.csv index 141397cd4..a486736d6 100644 --- a/Software/Visual_Studio/TCC/Benchmarks/benchmarks_rgb_lab.csv +++ b/Software/Visual_Studio/TCC/Benchmarks/benchmarks_rgb_lab.csv @@ -1,111 +1,111 @@ Red,Green,Blue,L,A,B 0,0,0,0,0,0 -169,169,169,71.12,0.133333333,-0.051666667 -112,112,112,52.7025,-1.2625,0.225 -198,198,198,79.77166667,0.398333333,-1.038333333 -83,83,83,42.17166667,-1.261666667,-0.135 -226,226,226,87.19833333,0.988333333,-2.736666667 -54,54,54,33.112,-1.636,1.224 -255,255,255,94.06833333,1.695,-4.553333333 -26,26,26,24.80833333,-1.2,1.33 +0,172,198,64.06,-29.154,-20.995 +112,112,112,47.565,-0.885,-1.4885 +142,153,81,56.679,-11.077,20.161 +83,83,83,40.9265,-0.279,-0.77025 +141,76,111,44.306,21.767,-8.453 +226,226,226,82.37675,-0.20075,-5.147 +17,57,134,39.884,7.868,-39.507 +198,198,198,72.70469444,-1.454777778,-3.803944444 0,0,0,0,0,0 -26,26,26,24.05,-1.5425,1.7175 -179,45,131,46.21333333,53.01666667,-15.06166667 -237,72,35,55.83,49.84666667,47.51333333 -54,70,61,36.79333333,-7.683333333,4.253333333 -38,58,111,30.57833333,8.741666667,-28.87166667 -212,132,66,63.97,19.78,39.89666667 -72,107,66,45.735,-19.39833333,17.27666667 -142,76,97,46.27333333,27.43,-0.658333333 -97,95,162,46.68166667,15.74333333,-30.815 -140,140,140,61.34833333,1.033333333,-0.151666667 -255,255,255,93.77333333,1.765,-4.411666667 -158,154,201,67.955,11.27333333,-20.06 -255,236,0,87.50166667,-12.59166667,78.655 -255,182,4,75.95833333,9.428333333,67.96333333 -243,107,33,61.09,39,52.50833333 -235,35,65,51.09833333,62.24166667,27.82333333 -106,55,134,36.80166667,32.49333333,-30.18666667 -255,185,59,76.87166667,9.426666667,57.305 -243,157,192,74.25,30.54,-7.908333333 -169,169,169,70.22333333,0.92,0.1 -54,54,54,30.775,-0.525,0.32 -116,59,54,39.87,20.87,12.47 -65,108,99,47.85833333,-15.3,1.538333333 -140,76,119,46.595,29.31666667,-10.93333333 -53,59,81,32.97333333,2.943333333,-12.37833333 -138,75,128,46.22333333,30.45666667,-15.91666667 -137,180,113,68.87833333,-23.25666667,27.84333333 -0,158,179,61.18,-20.86,-16.83833333 -113,207,244,78.175,-12.04333333,-22.53833333 -112,112,112,51.61,-0.502,-0.136 -226,226,226,87.13333333,1.495,-3.138333333 -184,50,46,45.52833333,42.72833333,29.61 -238,99,157,62.11,50.415,-7.06 -42,86,65,39.50666667,-17.82333333,8.103333333 -90,176,65,63.03166667,-42.46666667,43.37333333 -233,34,35,50.54666667,60.89166667,42.66 -190,230,250,86.84666667,-4.345,-12.96333333 -17,57,134,32.005,14.47333333,-34.95666667 -0,162,227,63.635,-10.44333333,-33.42166667 -198,198,198,79.01,1.025,-0.918333333 -83,83,83,42.464,-1.92,0.73 -0,172,198,64.285,-21.78166667,-20.35333333 -255,249,205,92.19333333,-3.3,13.94333333 -142,153,81,63.36833333,-13.99,33.38 -230,136,63,66.125,23.97666667,44.36833333 -141,76,111,45.82333333,28.36666667,-7.24 -231,22,127,52.11333333,66.82,-3.993333333 -190,157,147,68.685,10.07166667,7.398333333 -81,180,118,65.39166667,-38.2,21.53333333 -83,83,83,40.794,-0.94,-0.32 -198,198,198,79.14666667,0.791666667,-1.766666667 -234,31,101,52.21833333,64.01666667,8.343333333 -255,203,59,81.59333333,1.206666667,60.66833333 -252,173,144,76.00166667,19.22,17.49833333 -237,73,123,58.05833333,54.47333333,3.016666667 -206,138,159,66.82333333,23.78333333,-2.453333333 -143,76,82,45.865,25.65,7.266666667 -0,129,159,52.54833333,-15.35166667,-20.88666667 -0,130,198,54.21666667,-3.341666667,-36.37833333 -226,226,226,86.78666667,1.36,-2.605 -112,112,112,51.81,-0.583333333,-0.52 -0,152,77,56.07833333,-46.975,31.68 -0,164,72,58.71666667,-49.065,37.25166667 -137,75,137,45.86333333,31.94666667,-19.99 -167,210,173,79.54,-16.565,10.95166667 -59,109,116,47.90833333,-11.37166667,-8.108333333 -141,166,82,66.06833333,-20.29,37.86166667 -186,134,159,63.88,20.75166667,-5.778333333 -202,209,33,78.01833333,-18.415,67.03833333 -54,54,54,32.25,-1.4925,1.52 -169,169,169,71.545,-0.0625,-0.33 -244,110,79,62.268,39.444,32.43 -140,178,84,68.00333333,-25.05166667,39.31166667 -131,124,169,57.03833333,10.89833333,-19.545 -255,240,90,88.664,-11.328,60.484 -35,110,154,47.93333333,-5.69,-27.08833333 -0,125,73,48.08833333,-39.07333333,20.28 -0,86,159,38.855,7.425,-39.47166667 -138,190,85,69.98666667,-29.77333333,41.79833333 -255,255,255,93.715,1.663333333,-4.443333333 -140,140,140,61.934,-0.202,-0.038 -249,207,225,85.474,13.868,-6.676 -0,155,119,57.845,-37.60333333,9.745 -93,167,88,61.77166667,-35.645,29.3 -245,234,143,88.21833333,-8.618333333,37.94666667 -0,183,236,68.89666667,-15.51,-31.53166667 -81,60,92,34.46833333,13.13166667,-14.09 -255,245,153,90.20666667,-7.895,34.44333333 -70,108,81,46.88666667,-18.28333333,11.555 -26,26,26,23.2425,-0.405,0.9525 +38,58,111,37.747,4.872,-26.718 +179,45,131,46.581,41.223,-20.266 +237,72,35,56.863,49.134,30.79 +54,70,61,37.532,-5.127,1.701 +26,26,26,28.42266667,0.359666667,0.002333333 +212,132,66,58.827,21.779,24.102 +72,107,66,45.396,-13.557,8.772 +142,76,97,44.174,21.323,-2.299 +97,95,162,46.874,10.337,-31.235 +140,140,140,54.92066667,-1.297,-2.268 +255,255,255,93.611,1.569333333,-5.331666667 +140,178,84,64.116,-22.779,24.305 +255,236,0,85.343,-4.319,65.742 +255,182,4,72.665,21.02,49.667 +243,107,33,61.281,41.795,33.553 +169,169,169,63.19944444,-0.871666667,-2.706083333 +106,55,134,41.81,21.729,-30.614 +255,185,59,73.239,20.839,44.279 +243,157,192,68.848,36.007,-6.283 +138,75,128,45.305,22.542,-17.182 +53,59,81,35.835,1.138,-9.881 +0,155,119,58.239,-34.327,4.352 +65,108,99,45.834,-11.818,-0.543 +140,76,119,44.516,21.396,-12.022 +54,54,54,34.56025,0.0065,-0.423 +235,35,65,54.503,57.048,20.622 +137,180,113,64.528,-22.672,15.732 +0,158,179,59.859,-26.61,-17.082 +0,152,77,56.744,-37.595,14.907 +112,112,112,47.565,-0.885,-1.4885 +226,226,226,82.37675,-0.20075,-5.147 +184,50,46,46.535,37.611,16.18 +238,99,157,60.138,48.749,-6.109 +42,86,65,40.825,-13.133,3.402 +90,176,65,62.595,-37.823,24.943 +198,198,198,72.70469444,-1.454777778,-3.803944444 +190,230,250,79.927,-11.017,-19.508 +255,255,255,93.611,1.569333333,-5.331666667 +0,162,227,60.806,-17.555,-36.754 +233,34,35,54.152,55.499,28.059 +230,136,63,62.055,26.819,27.422 +169,169,169,63.19944444,-0.871666667,-2.706083333 +54,54,54,34.56025,0.0065,-0.423 +198,198,198,72.70469444,-1.454777778,-3.803944444 +140,140,140,54.92066667,-1.297,-2.268 +54,54,54,34.56025,0.0065,-0.423 +112,112,112,47.565,-0.885,-1.4885 +190,157,147,61.925,8.9,4.316 +140,140,140,54.92066667,-1.297,-2.268 +83,83,83,40.9265,-0.279,-0.77025 +26,26,26,28.42266667,0.359666667,0.002333333 +234,31,101,53.986,59.027,8.144 +255,203,59,76.633,12.889,50.041 +252,173,144,71.715,27.501,18.15 +237,73,123,57.332,53.365,4.238 +226,226,226,82.37675,-0.20075,-5.147 +143,76,82,44.227,20.192,2.688 +0,129,159,51.411,-17.369,-18.556 +0,130,198,53.954,-9.622,-37.527 +206,138,159,61.113,24.589,-3.138 +167,210,173,73.857,-21.841,7.585 +113,207,244,72.144,-20.686,-28.836 +0,164,72,60.155,-44.121,20.211 +137,75,137,45.496,23.368,-22.13 +83,83,83,40.9265,-0.279,-0.77025 +59,109,116,45.85,-11.553,-6.398 +141,166,82,60.09333333,-17.52444444,22.18333333 +186,134,159,58.157,18.614,-6.909 +202,209,33,73.426,-17.001,49.032 +54,54,54,34.56025,0.0065,-0.423 +169,169,169,63.19944444,-0.871666667,-2.706083333 +244,110,79,61.75888889,43.41888889,24.27555556 +158,154,201,60.995,7.571,-24.298 +131,124,169,53.808,7.4,-20.742 +255,240,90,86.321,-4.946,55.671 +255,255,255,93.611,1.569333333,-5.331666667 +0,125,73,49.711,-27.816,9.514 +0,86,159,44.899,0.404,-39.405 +138,190,85,66.5,-30.156,25.062 +35,110,154,48.006,-8.826,-24.779 +245,234,143,83.368,-4.173,36.016 +249,207,225,78.537,20.461,-6.307 +116,59,54,34.874,15.67,5.339 +93,167,88,60.188,-30.287,17.345 +112,112,112,47.565,-0.885,-1.4885 +0,183,236,66.816,-24.318,-35.309 +81,60,92,37.458,9.554,-11.929 +255,245,153,86.746,-4.843,39.048 +70,108,81,45.77333333,-12.81888889,4.813333333 +26,26,26,28.42266667,0.359666667,0.002333333 0,0,0,0,0,0 -255,255,255,94.11333333,1.658333333,-4.575 -54,54,54,32.195,-1.735,1.2575 -226,226,226,86.62833333,1.258333333,-2.736666667 -83,83,83,40.4025,-0.7875,-1.06 -198,198,198,79.255,1.036666667,-1.23 -112,112,112,51.55,-0.24,-1.1725 -169,169,169,70.695,0.278333333,-0.368333333 -140,140,140,61.43833333,0.363333333,-0.338333333 +255,255,255,93.611,1.569333333,-5.331666667 +255,249,205,89.35,-3.13,20.873 +226,226,226,82.37675,-0.20075,-5.147 +83,83,83,40.9265,-0.279,-0.77025 +198,198,198,72.70469444,-1.454777778,-3.803944444 +231,22,127,53.468,59.28,-6.929 +169,169,169,63.19944444,-0.871666667,-2.706083333 +81,180,118,64.57777778,-36.30444444,12.43222222 0,0,0,0,0,0 diff --git a/Software/Visual_Studio/TCC/Tango.TCC.ColorDetector/PMR/TCC/DetectionColorFile.pb-c.c b/Software/Visual_Studio/TCC/Tango.TCC.ColorDetector/PMR/TCC/DetectionColorFile.pb-c.c new file mode 100644 index 000000000..c6341cc3a --- /dev/null +++ b/Software/Visual_Studio/TCC/Tango.TCC.ColorDetector/PMR/TCC/DetectionColorFile.pb-c.c @@ -0,0 +1,105 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: DetectionColorFile.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "DetectionColorFile.pb-c.h" +void detection_color_file__init + (DetectionColorFile *message) +{ + static const DetectionColorFile init_value = DETECTION_COLOR_FILE__INIT; + *message = init_value; +} +size_t detection_color_file__get_packed_size + (const DetectionColorFile *message) +{ + assert(message->base.descriptor == &detection_color_file__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t detection_color_file__pack + (const DetectionColorFile *message, + uint8_t *out) +{ + assert(message->base.descriptor == &detection_color_file__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t detection_color_file__pack_to_buffer + (const DetectionColorFile *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &detection_color_file__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +DetectionColorFile * + detection_color_file__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (DetectionColorFile *) + protobuf_c_message_unpack (&detection_color_file__descriptor, + allocator, len, data); +} +void detection_color_file__free_unpacked + (DetectionColorFile *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &detection_color_file__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor detection_color_file__field_descriptors[2] = +{ + { + "RawColor", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_MESSAGE, + 0, /* quantifier_offset */ + offsetof(DetectionColorFile, rawcolor), + &detection_color__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "ProcessedColor", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_MESSAGE, + 0, /* quantifier_offset */ + offsetof(DetectionColorFile, processedcolor), + &detection_color__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned detection_color_file__field_indices_by_name[] = { + 1, /* field[1] = ProcessedColor */ + 0, /* field[0] = RawColor */ +}; +static const ProtobufCIntRange detection_color_file__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor detection_color_file__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "DetectionColorFile", + "DetectionColorFile", + "DetectionColorFile", + "", + sizeof(DetectionColorFile), + 2, + detection_color_file__field_descriptors, + detection_color_file__field_indices_by_name, + 1, detection_color_file__number_ranges, + (ProtobufCMessageInit) detection_color_file__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Visual_Studio/TCC/Tango.TCC.ColorDetector/PMR/TCC/DetectionColorFile.pb-c.h b/Software/Visual_Studio/TCC/Tango.TCC.ColorDetector/PMR/TCC/DetectionColorFile.pb-c.h new file mode 100644 index 000000000..e362356aa --- /dev/null +++ b/Software/Visual_Studio/TCC/Tango.TCC.ColorDetector/PMR/TCC/DetectionColorFile.pb-c.h @@ -0,0 +1,73 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: DetectionColorFile.proto */ + +#ifndef PROTOBUF_C_DetectionColorFile_2eproto__INCLUDED +#define PROTOBUF_C_DetectionColorFile_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + +#include "DetectionColor.pb-c.h" + +typedef struct _DetectionColorFile DetectionColorFile; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _DetectionColorFile +{ + ProtobufCMessage base; + DetectionColor *rawcolor; + DetectionColor *processedcolor; +}; +#define DETECTION_COLOR_FILE__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&detection_color_file__descriptor) \ + , NULL, NULL } + + +/* DetectionColorFile methods */ +void detection_color_file__init + (DetectionColorFile *message); +size_t detection_color_file__get_packed_size + (const DetectionColorFile *message); +size_t detection_color_file__pack + (const DetectionColorFile *message, + uint8_t *out); +size_t detection_color_file__pack_to_buffer + (const DetectionColorFile *message, + ProtobufCBuffer *buffer); +DetectionColorFile * + detection_color_file__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void detection_color_file__free_unpacked + (DetectionColorFile *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*DetectionColorFile_Closure) + (const DetectionColorFile *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor detection_color_file__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_DetectionColorFile_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/TCC/Tango.TCC.Service/Controllers/ColorDetectionController.cs b/Software/Visual_Studio/TCC/Tango.TCC.Service/Controllers/ColorDetectionController.cs index d508c2f10..fe79cf16d 100644 --- a/Software/Visual_Studio/TCC/Tango.TCC.Service/Controllers/ColorDetectionController.cs +++ b/Software/Visual_Studio/TCC/Tango.TCC.Service/Controllers/ColorDetectionController.cs @@ -22,6 +22,7 @@ using System.Data.Entity; using SendGrid; using SendGrid.Helpers.Mail; using System.Web; +using System.Web.Hosting; namespace Tango.TCC.Service.Controllers { @@ -132,13 +133,17 @@ namespace Tango.TCC.Service.Controllers using (ColorDetector detector = new ColorDetector()) { - var output = detector.Detect(new DetectionInput() + var input = new DetectionInput() { Bitmap = ByteString.CopyFrom(bitmapBytes), Columns = TCCServiceConfig.CARD_COLUMNS, Rows = TCCServiceConfig.CARD_ROWS, TargetIndex = TCCServiceConfig.CARD_TARGET_INDEX, - }); + }; + + input.Benchmarks.AddRange(ColorDetector.LoadBenchmarks(HostingEnvironment.MapPath("~/bin/TCC/benchmarks_rgb_lab.csv"))); + + var output = detector.Detect(input); return new ColorDetectionResponse() { @@ -221,7 +226,7 @@ namespace Tango.TCC.Service.Controllers var result = client.SendEmailAsync(msg).GetAwaiter().GetResult(); - if(result.StatusCode != HttpStatusCode.Accepted) + if (result.StatusCode != HttpStatusCode.Accepted) { throw new HttpException(result.StatusCode.ToString()); } diff --git a/Software/Visual_Studio/TCC/Tango.TCC.Service/Web.config b/Software/Visual_Studio/TCC/Tango.TCC.Service/Web.config index d84b6b117..aa50e5b14 100644 --- a/Software/Visual_Studio/TCC/Tango.TCC.Service/Web.config +++ b/Software/Visual_Studio/TCC/Tango.TCC.Service/Web.config @@ -30,13 +30,13 @@ <add key="CARD_COLUMNS" value="10" /> <add key="CARD_ROWS" value="11" /> - <add key="CARD_TARGET_INDEX" value="89" /> + <add key="CARD_TARGET_INDEX" value="20" /> <add key="TEMPLATE_STRING" value="PUT TEMPLATE STRING HERE!" /> <add key="SAMPLE_WIDTH" value="300" /> <add key="SAMPLE_HEIGHT" value="330" /> <add key="CAMERA_WIDTH" value="1280" /> <add key="CAMERA_HEIGHT" value="720" /> - <add key="SIMILARITY_TOLERANCE" value="50" /> + <add key="SIMILARITY_TOLERANCE" value="0" /> <add key="HISTOGRAM_METHOD" value="Chi_Square" /> <add key="ENABLE_DOUBLE_CHECKING" value="True" /> <add key="ENFORCE_BARCODE_DETECTION" value="True" /> |
