我正在尝试为自动车牌识别 (ALPR) 系统设置集成点。我正在使用 OpenALPR。
在本地 PC 上,有一个安装了 IP 摄像头的代理,它将读取车牌并将信息发送到云端。在云中有一个 WebHook 集成点,每次注册车牌时都会触发该集成点。
在 OpenALPR 网页中,WebHook 文档说:
WebHooks send an HTTP POST to your URL every time a plate is received or an alert is triggered. The POST body contains the license plate data.
我已经通过将输出发送到此 URL 上的 WebHook 测试页面来测试集成:https ://webhook.site/
结果显示在这篇文章的末尾。可以看出,输出是 JSON 格式。
我已经完成了一项 RESTful 服务并将其部署在 Azure 中。我的问题是,当我阅读结果时,我没有得到完整的 JSON 结果。根据对http://webhook.site的测试,我知道 WebHook 提供者(发送者)发送所有 JSON 数据,所以我无法弄清楚为什么它没有被完全接收。
如果有更好的方法在我的 Web 应用程序中接收 JSON 结果,我很高兴听到它。以下是我对如何完成工作的看法。除非它不起作用!:-D
谁能告诉我我做错了什么以及为什么只读取部分结果?
这是在我的服务的 HTTP POST 上调用的代码部分。
// POST: api/OpenALP
public HttpResponseMessage Post([FromBody]string value)
{
var content = Request.Content;
Request.Content.LoadIntoBufferAsync().Wait();
string jsonContent = content.ReadAsStringAsync().Result;
HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK);
return response;
}
编辑:不知道它是否重要 - 但调试是通过将服务发布为“调试”并附加调试器来完成的。下面显示的内容是从断点处复制出来的。
这就是我得到的string jsonContent
" \"color\": [{\"confidence\": 92.68022918701172, \"name\": \"white\"}, {\"confidence\": 2.699702501296997, \"name\": \"silver-gray\"}, {\"confidence\": 1.8385039567947388, \"name\": \"yellow\"}, {\"confidence\": 1.024902582168579, \"name\": \"gold-beige\"}, {\"confidence\": 0.5838126540184021, \"name\": \"green\"}], \"make\": [{\"confidence\": 16.192890167236328, \"name\": \"renault\"}, {\"confidence\": 12.871005058288574, \"name\": \"mercedes-benz\"}, {\"confidence\": 7.908616065979004, \"name\": \"volkswagen\"}, {\"confidence\": 4.901283264160156, \"name\": \"opel\"}, {\"confidence\": 4.583385467529297, \"name\": \"bmw\"}], \"body_type\": [{\"confidence\": 20.72427749633789, \"name\": \"sedan-standard\"}, {\"confidence\": 18.412166595458984, \"name\": \"van-mini\"}, {\"confidence\": 17.614177703857422, \"name\": \"sedan-compact\"}, {\"confidence\": 12.435933113098145, \"name\": \"sedan-wagon\"}, {\"confidence\": 6.872223377227783, \"name\": \"suv-crossover\"}], \"year\": [{\"confidence\": 23.91012191772461, \"name\": \"2005-2009\"}, {\"confidence\": 19.78921890258789, \"name\": \"2000-2004\"}, {\"confidence\": 16.811452865600586, \"name\": \"1995-1999\"}, {\"confidence\": 11.53968620300293, \"name\": \"2010-2014\"}, {\"confidence\": 8.91786003112793, \"name\": \"1985-1989\"}], \"make_model\": [{\"confidence\": 2.5598113536834717, \"name\": \"renault_kangoo\"}, {\"confidence\": 1.564223289489746, \"name\": \"fiat_doblo\"}, {\"confidence\": 1.5174164772033691, \"name\": \"alfa-romeo_147\"}, {\"confidence\": 1.0350353717803955, \"name\": \"citroen_2cv\"}, {\"confidence\": 0.986167311668396, \"name\": \"volkswagen_caddy\"}]}, \"best_uuid\": \"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521329355349\", \"epoch_end\": 1521329358227, \"best_image_width\": 640, \"data_type\": \"alpr_group\", \"best_image_height\": 480, \"frame_end\": 865634, \"is_parked\": false, \"web_server_config\": {\"agent_label\": \"DESKTOP-B3PMA1C\", \"camera_label\": \"WebCamHKA\"}, \"best_region\": \"eu-dk\", \"uuids\": [\"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521329355147\", \"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521329355183\", \"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521329355248\", \"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521329355284\", \"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521329355349\", \"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521329355386\", \"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521329355451\", \"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521329355523\", \"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521329355558\", \"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521329355700\", \"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521329355777\", \"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521329355815\", \"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521329355889\", \"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521329356029\", \"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521329356274\", \"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521329356421\", \"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521329356598\", \"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521329356738\", \"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521329356773\", \"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521329356874\", \"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521329356909\", \"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521329357014\", \"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521329357049\", \"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521329357148\", \"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521329357387\", \"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521329357422\", \"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521329357567\", \"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521329357631\", \"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521329357734\", \"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521329357870\", \"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521329357976\", \"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521329358012\", \"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521329358048\", \"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521329358084\", \"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521329358155\", \"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521329358191\", \"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521329358227\"], \"plate_indexes\": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], \"travel_direction\": 255.1732177734375, \"country\": \"eu\", \"best_plate_number\": \"AF22454\", \"best_region_confidence\": 91.45714569091797, \"agent_version\": \"2.5.103\", \"candidates\": [{\"matches_template\": 0, \"plate\": \"AF22454\", \"confidence\": 94.99976348876953}, {\"matches_template\": 0, \"plate\": \"AF2245\", \"confidence\": 69.99081420898438}, {\"matches_template\": 0, \"plate\": \"AF224\", \"confidence\": 68.92207336425781}, {\"matches_template\": 0, \"plate\": \"A22454\", \"confidence\": 65.7693099975586}, {\"matches_template\": 0, \"plate\": \"AY22454\", \"confidence\": 65.72945404052734}, {\"matches_template\": 0, \"plate\": \"AT22454\", \"confidence\": 65.69474029541016}]}"
如果我查看 WebHook 测试站点 ( http://webhoot.site ) 上的输出,我会得到以下结果:
{
"epoch_start": 1521286407536,
"camera_id": 645063384,
"frame_start": 109416,
"agent_uid": "WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X",
"best_confidence": 94.99918365478516,
"company_id": "d1806fef-5549-4915-86a8-1b1f975e8df9",
"version": 2,
"agent_type": "alprd",
"best_plate": {
"plate": "AF25463",
"confidence": 94.99918365478516,
"region_confidence": 99,
"vehicle_region": {
"y": 1,
"x": 80,
"height": 479,
"width": 479
},
"region": "eu-dk",
"plate_index": 0,
"processing_time_ms": 40.263999938964844,
"candidates": [
{
"matches_template": 0,
"plate": "AF25463",
"confidence": 94.99918365478516
}
],
"coordinates": [
{
"y": 248,
"x": 286
},
{
"y": 251,
"x": 599
},
{
"y": 318,
"x": 599
},
{
"y": 314,
"x": 286
}
],
"matches_template": 0,
"requested_topn": 10
},
"vehicle": {
"orientation": [
{
"confidence": 48.20035171508789,
"name": "270"
},
{
"confidence": 26.80327606201172,
"name": "225"
},
{
"confidence": 10.317419052124023,
"name": "315"
},
{
"confidence": 5.075159072875977,
"name": "180"
},
{
"confidence": 4.022528648376465,
"name": "0"
}
],
"color": [
{
"confidence": 89.68812561035156,
"name": "blue"
},
{
"confidence": 3.044862747192383,
"name": "silver-gray"
},
{
"confidence": 2.5986762046813965,
"name": "white"
},
{
"confidence": 2.5680367946624756,
"name": "green"
},
{
"confidence": 0.8009989857673645,
"name": "purple"
}
],
"make": [
{
"confidence": 11.725887298583984,
"name": "renault"
},
{
"confidence": 10.687095642089844,
"name": "land-rover"
},
{
"confidence": 9.455676078796387,
"name": "nissan"
},
{
"confidence": 7.793033123016357,
"name": "citroen"
},
{
"confidence": 6.8527727127075195,
"name": "suzuki"
}
],
"body_type": [
{
"confidence": 19.176368713378906,
"name": "suv-crossover"
},
{
"confidence": 18.331125259399414,
"name": "suv-standard"
},
{
"confidence": 18.325965881347656,
"name": "truck-standard"
},
{
"confidence": 11.761542320251465,
"name": "sedan-wagon"
},
{
"confidence": 10.666444778442383,
"name": "sedan-compact"
}
],
"year": [
{
"confidence": 19.741708755493164,
"name": "2005-2009"
},
{
"confidence": 17.747791290283203,
"name": "2000-2004"
},
{
"confidence": 16.381860733032227,
"name": "1995-1999"
},
{
"confidence": 13.306379318237305,
"name": "1985-1989"
},
{
"confidence": 11.591310501098633,
"name": "1980-1984"
}
],
"make_model": [
{
"confidence": 7.200094223022461,
"name": "land-rover_defender"
},
{
"confidence": 2.6545894145965576,
"name": "land-rover_discovery"
},
{
"confidence": 1.7968538999557495,
"name": "toyota_land-cruiser"
},
{
"confidence": 1.6618626117706299,
"name": "suzuki_sj-samurai"
},
{
"confidence": 1.4205354452133179,
"name": "suzuki_vitara"
}
]
},
"best_uuid": "WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521286410173",
"epoch_end": 1521286411970,
"best_image_width": 640,
"data_type": "alpr_group",
"best_image_height": 480,
"frame_end": 109536,
"is_parked": false,
"web_server_config": {
"agent_label": "DESKTOP-B3PMA1C",
"camera_label": "WebCamHKA"
},
"best_region": "eu-dk",
"uuids": [
"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521286407536",
"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521286407571",
"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521286407607",
"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521286407783",
"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521286407888",
"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521286407991",
"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521286408267",
"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521286408301",
"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521286408335",
"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521286408579",
"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521286408649",
"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521286408860",
"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521286408895",
"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521286408930",
"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521286408964",
"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521286408999",
"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521286409173",
"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521286409278",
"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521286409417",
"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521286409484",
"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521286409651",
"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521286409789",
"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521286409823",
"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521286409999",
"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521286410036",
"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521286410140",
"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521286410173",
"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521286410208",
"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521286410646",
"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521286410751",
"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521286410887",
"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521286410923",
"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521286410957",
"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521286411099",
"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521286411169",
"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521286411204",
"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521286411523",
"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521286411626",
"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521286411694",
"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521286411797",
"WBFOY6ZDPZR03FGCE5C1S9J5GIH2TFH1H6QPMX7X-645063384-1521286411970"
],
"plate_indexes": [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
],
"travel_direction": 18.316375732421875,
"country": "eu",
"best_plate_number": "AF25463",
"best_region_confidence": 97.08333587646484,
"agent_version": "2.5.103",
"candidates": [
{
"matches_template": 0,
"plate": "AF25463",
"confidence": 94.99918365478516
},
{
"matches_template": 0,
"plate": "AF2546",
"confidence": 70.50904846191406
},
{
"matches_template": 0,
"plate": "AF254",
"confidence": 68.68018341064453
},
{
"matches_template": 0,
"plate": "AF254AF",
"confidence": 65.75811767578125
},
{
"matches_template": 0,
"plate": "A25463",
"confidence": 65.72001647949219
},
{
"matches_template": 0,
"plate": "AE25463",
"confidence": 65.68501281738281
}
]
}
编辑:哦-我无法发布图片。我需要至少 10 个声望才能发布它。但我可以在这里链接到它:https ://klitandersen-my.sharepoint.com/:i:/g/personal/henrik_klit-andersen_com/Ec7DQkhrcFhAgZ6wIF24MbkBgrPcbXsgSa7_msXLZDHXQw?e=cnluHm