-1
번호판을 감지하고 이에 대한 정보를 제공하는 응용 프로그램을 작성 중입니다. 이것은 "openALPR"이라는 Rest API를 호출하여 수행됩니다. 는 결과적으로 나는 JSON 문자열이처럼 보이는 얻을 :C#의 JSON에서 값 추출하기
{
"uuid": "",
"data_type": "alpr_results",
"epoch_time": 1512554543436,
"processing_time": {
"plates": 145.41024780273438,
"total": 147.6409999995667
},
"img_height": 233,
"img_width": 700,
"results": [
{
"plate": "MTF5101",
"confidence": 94.978622436523438,
"region_confidence": 0,
"vehicle_region": {
"y": 1,
"x": 234,
"height": 232,
"width": 232
},
"region": "fr",
"plate_index": 0,
"processing_time_ms": 193.28457641601563,
"candidates": [
{
"matches_template": 0,
"plate": "MTF5101",
"confidence": 94.978622436523438
}
],
"coordinates": [
{
"y": 102,
"x": 289
},
{
"y": 101,
"x": 412
},
{
"y": 126,
"x": 412
},
{
"y": 128,
"x": 289
}
],
"matches_template": 0,
"requested_topn": 50
},
{
"plate": "MHV7718",
"confidence": 94.9754638671875,
"region_confidence": 0,
"vehicle_region": {
"y": 0,
"x": 395,
"height": 233,
"width": 233
},
"region": "fr",
"plate_index": 1,
"processing_time_ms": 193.28457641601563,
"candidates": [
{
"matches_template": 0,
"plate": "MHV7718",
"confidence": 94.9754638671875
},
{
"matches_template": 0,
"plate": "MH7718",
"confidence": 81.550361633300781
},
{
"matches_template": 0,
"plate": "MHY7718",
"confidence": 81.411224365234375
}
],
"coordinates": [
{
"y": 142,
"x": 475
},
{
"y": 148,
"x": 676
},
{
"y": 184,
"x": 674
},
{
"y": 178,
"x": 475
}
],
"matches_template": 0,
"requested_topn": 50
},
{
"plate": "MTG7780",
"confidence": 94.97296142578125,
"region_confidence": 0,
"vehicle_region": {
"y": 1,
"x": 91,
"height": 232,
"width": 232
},
"region": "fr",
"plate_index": 2,
"processing_time_ms": 193.28457641601563,
"candidates": [
{
"matches_template": 0,
"plate": "MTG7780",
"confidence": 94.97296142578125
},
{
"matches_template": 0,
"plate": "MT7780",
"confidence": 81.548896789550781
},
{
"matches_template": 0,
"plate": "MT67780",
"confidence": 81.409553527832031
}
],
"coordinates": [
{
"y": 84,
"x": 18
},
{
"y": 96,
"x": 202
},
{
"y": 140,
"x": 201
},
{
"y": 128,
"x": 16
}
],
"matches_template": 0,
"requested_topn": 50
}
],
"credits_monthly_used": 48,
"version": 2,
"credits_monthly_total": 2000,
"error": false,
"regions_of_interest": [],
"credit_cost": 1
}
지금 내가 모든 번호판에 대한 좌표를 얻을 필요가있다. 이 예에는 3 개의 번호판이 있습니다. 각 "좌표"키에는 네 개의 점 (x, y)이 포함됩니다.
어떻게 이러한 좌표를 C#에서 얻을 수 있습니까?
내 질문을 찾아 주셔서 감사합니다!
최대한으로, Fabian Maurhart! 우선 들어
[JSON 응답의 추출 부분 (의 사용 가능한 복제 https://stackoverflow.com/questions/15805175/extracting : 마지막으로 0의 C# 모델 클래스를받은 후, 단지 모든 정보를 가져 오기 위해 LINQ를 적용 -part-of-json-response) – Hille
json2csharp를 사용하여 클래스를 가져온 다음 newtonsoft.json을 사용하여 비 직렬화 – Coder1409
@ Coder1409 관심있는 모든 것이 값인 경우 첫 번째 부분을 수행해야합니까? 동적으로 액세스하거나 "문자열 형식의"메서드, newtonsoft의 일반 JObject 클래스 등을 통해 액세스 할 수 있습니다. –