Skip to content

Latest commit

ย 

History

History
798 lines (710 loc) ยท 29.5 KB

DevGuide.md

File metadata and controls

798 lines (710 loc) ยท 29.5 KB

์‘์šฉ ํ”„๋กœ๊ทธ๋žจ ๊ฐœ๋ฐœ ๊ฐ€์ด๋“œ

๋ชฉ์ฐจ

1. Entry points

๋ชจ๋“  ํ•จ์ˆ˜ ์›ํ˜•์€ ์•„๋ž˜์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค.

#ifdef WIN32
#define TS_ANPR_ENTRY extern "C" __declspec(dllexport) const char* WINAPI
#else
#define TS_ANPR_ENTRY extern "C" const char* 
#endif

- ์žฅํ™ฉํ•ด์ง€์ง€ ์•Š๋„๋ก ์ดํ•˜๋Š” TS_ANPR_ENTRY๋กœ ํ‘œ๊ธฐํ•ฉ๋‹ˆ๋‹ค.

1.1. anpr_initialize

๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ ์ดˆ๊ธฐํ™” ํ•ฉ๋‹ˆ๋‹ค. ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ๋ฅผ ์‚ฌ์šฉํ•˜๊ธฐ ์œ„ํ•ด ๋‹ค๋ฅธ ํ•จ์ˆ˜๋ณด๋‹ค ๋จผ์ € ํ•œ ๋ฒˆ ํ˜ธ์ถœํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค.

TS_ANPR_ENTRY anpr_initialize(const char* mode); // [IN] ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ๋™์ž‘ ๋ฐฉ์‹ ์„ค์ •

Parameters:

  • mode
    • ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ๋™์ž‘ ๋ฐฉ์‹์„ ์ง€์ •ํ•˜๋Š” ๋ชฉ์ ์œผ๋กœ ์‚ฌ์šฉ (๊ธฐ์กด outputFormat์—์„œ ์šฉ๋„ ํ™•์žฅ)
    • ์„ธ๋ฏธ์ฝœ๋ก (;) ๋ฌธ์ž๋กœ ๊ตฌ๋ถ„ํ•˜์—ฌ ์—ฌ๋Ÿฌ ์„ค์ •์„ ํ‘œํ˜„ํ•  ์ˆ˜ ์žˆ์Œ (์˜ˆ: json;sync)
  • ์ง€์ • ๊ฐ€๋Šฅํ•œ ํ•ญ๋ชฉ
    • outputFormat:
      • ์ถœ๋ ฅ ๋ฐ์ดํ„ฐ ํ˜•์‹
      • ์ง€์›ํ•˜๋Š” ๋ฐ์ดํ„ฐ ํ˜•์‹: text, json, yaml, xml, csv (๊ธฐ๋ณธ๊ฐ’: text)
      • outputFormat์ƒ๋žตํ•˜๊ณ  ๊ฐ„๋‹จํžˆ text, json์œผ๋กœ ์‚ฌ์šฉ ๊ฐ€๋Šฅ
    • sync:
      • ๋™๊ธฐ ๋ชจ๋“œ๋กœ ์‹คํ–‰ (์“ฐ๋ ˆ๋“œ lock์„ ๊ฑธ๊ณ  ํ˜ธ์ถœํ•œ ์ˆœ์„œ๋Œ€๋กœ ์ฒ˜๋ฆฌ)
      • ๋ฏธ๋ฆฌ ์ƒ์„ฑ๋œ ๊ณ ์ • ๊ฐฏ์ˆ˜์˜ ์“ฐ๋ ˆ๋“œํ’€ ํ˜•ํƒœ๊ฐ€ ์•„๋‹ˆ๊ณ  ์“ฐ๋ ˆ๋“œ๊ฐ€ ๊ณ„์† ์ƒˆ๋กœ ์ƒ์„ฑ๋˜๋Š” ๊ตฌ์กฐ์˜ ์‘์šฉ ํ”„๋กœ๊ทธ๋žจ์—์„œ ํ˜ธ์ถœํ•˜๋Š” ๊ฒฝ์šฐ, ์•„๋ž˜์™€ ๊ฐ™์€ ์˜ค๋ฅ˜ ์ฝ”๋“œ ๋ฐœ์ƒ์‹œ ์‚ฌ์šฉ์„ ๊ณ ๋ คํ•  ์ˆ˜ ์žˆ์Œ
        • 103: Too many workers ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ํ˜ธ์ถœ ์“ฐ๋ ˆ๋“œ ์ˆ˜๊ฐ€ ํ•œ๊ณ„๋ฅผ ์ดˆ๊ณผํ•œ ๊ฒฝ์šฐ (์ตœ๋Œ€ 256๊ฐœ)
        • 104: Resource exhausted ๋” ์ด์ƒ ์ž์›์„ ํ• ๋‹นํ•  ์ˆ˜ ์—†๋Š” ๊ฒฝ์šฐ
      • ๋ณต์žกํ•œ ๋น„๋™๊ธฐ ์“ฐ๋ ˆ๋“œ ๊ด€๋ฆฌ๋ฅผ ์‹ ๊ฒฝ์“ฐ์ง€ ์•Š์•„๋„ ๋˜๋Š” ๋ฐ˜๋ฉด ์“ฐ๋ ˆ๋“œ ๋ฝ(lock)์„ ์‚ฌ์šฉํ•˜๋Š” ๋ฐฉ์‹์ด๋ฏ€๋กœ ์„ฑ๋Šฅ์€ ๋‹ค์†Œ ๋–จ์–ด์งˆ ์ˆ˜ ์žˆ์Œ
      • sync=true ๋˜๋Š” sync=false ๋กœ ํ‘œํ˜„ํ•  ์ˆ˜ ์žˆ์œผ๋ฉฐ, ๊ฐ„๋‹จํžˆ sync๋งŒ ์‚ฌ์šฉํ•ด๋„ ๋จ (์ง€์ •์•ˆํ•˜๋ฉด ๊ธฐ๋ณธ๊ฐ’ sync=false๋กœ ๋™์ž‘)

Return value:

  • ์ •์ƒ ์ฒ˜๋ฆฌ๋œ ๊ฒฝ์šฐ ๋นˆ ํ…์ŠคํŠธ NULL terminated string (0x00)์„ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค.
  • ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ•œ ๊ฒฝ์šฐ๋Š” mode์˜ outputFormat์œผ๋กœ ์ง€์ •ํ•œ ๋ฐ์ดํ„ฐ ํ˜•์‹์˜ ๋ฌธ์ž์—ด(utf-8 ์ธ์ฝ”๋”ฉ)๋กœ ์˜ค๋ฅ˜ ๋‚ด์šฉ์„ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค.

1.2. anpr_read_file

์ด๋ฏธ์ง€ ํŒŒ์ผ์—์„œ ์ฐจ๋Ÿ‰ ๋ฒˆํ˜ธ๋ฅผ ์ธ์‹ํ•ฉ๋‹ˆ๋‹ค.

TS_ANPR_ENTRY anpr_read_file(
  const char* imgFileName,  // [IN] ์ž…๋ ฅ ์ด๋ฏธ์ง€ ํŒŒ์ผ๋ช…
  const char* outputFormat, // [IN] ์ถœ๋ ฅ ๋ฐ์ดํ„ฐ ํ˜•์‹
  const char* options);     // [IN] ๊ธฐ๋Šฅ ์˜ต์…˜

Parameters:

  • imgFileName:
    • ์ž…๋ ฅ ์ด๋ฏธ์ง€ ํŒŒ์ผ๋ช… (utf-8 ์ธ์ฝ”๋”ฉ)
    • ์ง€์›ํ•˜๋Š” ์ด๋ฏธ์ง€ ํŒŒ์ผ ํ˜•์‹: bmp, jpg, png, pnm, pbm, pgm, ppm, jfif, webp
  • outputFormat:
    • ์ถœ๋ ฅ ๋ฐ์ดํ„ฐ ํ˜•์‹
    • ์ง€์›ํ•˜๋Š” ๋ฐ์ดํ„ฐ ํ˜•์‹: text, json, yaml, xml, csv (๊ธฐ๋ณธ๊ฐ’: text)
    • ๊ฐ์ฒด ์ธ์‹ ์˜ต์…˜์„ ์‚ฌ์šฉํ•  ๊ฒฝ์šฐ text๋Š” csv๋กœ ์ถœ๋ ฅ๋ฉ๋‹ˆ๋‹ค.
  • options:
    • ์•„๋ž˜ ๋ฌธ์ž๋“ค์„ ์กฐํ•ฉํ•˜์—ฌ ๋ฒˆํ˜ธ ์ธ์‹ ์•Œ๊ณ ๋ฆฌ์ฆ˜์˜ ์˜ต์…˜์„ ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค.

      ๋ฌธ์ž ์˜๋ฏธ ์ ์šฉ ๋ผ์ด์„ ์Šค
      v ๋ฒˆํ˜ธํŒ ์ฐจ๋Ÿ‰ ๋ถ€์ฐฉ ์—ฌ๋ถ€ ํŒ๋‹จ ์ „์ฒด
      m ์—ฌ๋Ÿฌ ๋Œ€์˜ ์ฐจ๋Ÿ‰ ๋ฒˆํ˜ธํŒ์„ ๋ชจ๋‘ ์ธ์‹ (๋‹ค์ค‘ ์ธ์‹) ๊ฐ์ฒด์ธ์‹, ํ”„๋กœ, ์„œ๋ฒ„
      s 360ยฐ ๋ชจ๋“  ๊ฐ๋„์˜ ์ฐจ๋Ÿ‰์—์„œ ๋ฒˆํ˜ธํŒ ์ธ์‹ (์„œ๋ผ์šด๋“œ ์ธ์‹) ๊ฐ์ฒด์ธ์‹, ํ”„๋กœ, ์„œ๋ฒ„
      d ๊ฐ์ฒด ์ธ์‹ (๋งŒ.๊ณต์ฐจ์šฉ) ์ „์ฒด
      r ์ธ์‹๋œ ๊ฐ์ฒด(์ฐจ๋Ÿ‰)์˜ ์ฐจ๋Ÿ‰ ๋ฒˆํ˜ธ ์ธ์‹ ์ „์ฒด
    • ๋ผ์ด์„ ์Šค ์ข…๋ฅ˜์— ๋”ฐ๋ผ ๊ธฐ๋Šฅ ๋ฐ ๋‹ค์ค‘ ์ธ์‹ ์ฐจ๋Ÿ‰ ์ˆ˜๊ฐ€ ๋‹ค๋ฅด๊ฒŒ ์ ์šฉ๋ฉ๋‹ˆ๋‹ค. (์ฐธ๊ณ : TS-ANPR ์—”์ง„ ๋ฐ”์ด๋„ˆ๋ฆฌ)

    • ์˜ต์…˜ ์„ ํƒ ์•ˆ๋‚ด ์•„๋ž˜ ํ”Œ๋กœ์šฐ์ฐจํŠธ์—์„œ ์‹œ์ž‘์—์„œ ์„ ํƒ์™„๋ฃŒ๊นŒ์ง€ ์กฐ๊ฑด์„ ๋”ฐ๋ผ ์ด๋™ํ•˜๋ฉด์„œ ์ง€๋‚˜๊ฐ„ ์ดˆ๋ก์ƒ‰ ์›์˜ ๋ฌธ์ž๋“ค์„ ๋ชจ์•„ ์˜ต์…˜ ๊ฐ’์œผ๋กœ ์‚ฌ์šฉํ•˜๋ฉด ๋ฉ๋‹ˆ๋‹ค. (๋ฌธ์ž์˜ ์ˆœ์„œ๋Š” ๋ฌด๊ด€ํ•ฉ๋‹ˆ๋‹ค.) ์˜ˆ) ์ด๋™ ๊ฒฝ๋กœ๊ฐ€ ์‹œ์ž‘ โ†’ v โ†’ s โ†’ m โ†’ ์„ ํƒ์™„๋ฃŒ ์ด๋ฉด "vsm"๊ฐ€ ์˜ต์…˜ ๊ฐ’์ž…๋‹ˆ๋‹ค.

      flowchart TD
        
        start[/์‹œ์ž‘/]-->attach{{๋ฒˆํ˜ธํŒ ์ฐจ๋Ÿ‰ ๋ถ€์ฐฉ ์—ฌ๋ถ€?}}
        attach-->|์ƒ๊ด€์—†์Œ|multi
        attach-->|์ฐจ๋Ÿ‰์— ๋ถ€์ฐฉ๋œ ๋ฒˆํ˜ธํŒ๋งŒ|v((v)):::opt
        
        v-->angle{{์ฐจ๋Ÿ‰ ๊ฐ๋„?}}
        angle-->|๋ฐ”๋กœ ์„  ์ฐจ๋Ÿ‰๋งŒ|multi{{๋‹ค์ค‘์ธ์‹?}}
        angle-->|360ยฐ ๋ชจ๋“  ๊ฐ๋„|s((s)):::opt
        s-->multi
        multi-->|์˜ˆ|m((m)):::opt
        multi-->|์•„๋‹ˆ์˜ค|done[/์„ ํƒ์™„๋ฃŒ/]
        m-->done      
      
        start-->d((d)):::opt
        d-->angle2{{์ฐจ๋Ÿ‰ ๊ฐ๋„?}}
        angle2-->|๋ฐ”๋กœ ์„  ์ฐจ๋Ÿ‰๋งŒ|multi2{{๋‹ค์ค‘์ธ์‹?}}
        angle2-->|360ยฐ ๋ชจ๋“  ๊ฐ๋„|s2((s)):::opt
        s2-->multi2
        multi2-->|์˜ˆ|m2((m)):::opt
        multi2-->|์•„๋‹ˆ์˜ค|read
        m2-->read{{๋ฒˆํ˜ธ ์ธ์‹?}}
        
        read-->|์˜ˆ|r((r)):::opt
        read-->|์•„๋‹ˆ์˜ค|done
        r-->done
       
      
        subgraph "๋ฒˆํ˜ธ ์ธ์‹"
          attach
          v
          angle
          multi
          m
          s
        end
      
        subgraph "๊ฐ์ฒด ์ธ์‹"
          read
          angle2
          multi2
          s2
          m2
          d
          r
        end
      
        classDef opt fill:#6F6,stroke:#CCC,stroke-width:4px,padding:10px,font-weight:bold
      
      Loading
    • ๋ฒˆํ˜ธ ์ธ์‹ ์˜ต์…˜ ์‚ฌ์šฉ ์˜ˆ

      options ์˜๋ฏธ
      ๋ชจ๋“  ๋ฒˆํ˜ธํŒ ์ค‘ ํ•˜๋‚˜ ์ธ์‹
      v ์ฐจ๋Ÿ‰ ๋ถ€์ฐฉ๋œ ๋ฒˆํ˜ธํŒ ์ค‘ ํ•˜๋‚˜ ์ธ์‹
      m ๋ชจ๋“  ๋ฒˆํ˜ธํŒ, ๋‹ค์ค‘ ์ธ์‹
      vm ์ฐจ๋Ÿ‰ ๋ถ€์ฐฉ๋œ ๋ฒˆํ˜ธํŒ, ๋‹ค์ค‘ ์ธ์‹
      vs ์ฐจ๋Ÿ‰ ๋ถ€์ฐฉ๋œ ๋ฒˆํ˜ธํŒ, 360ยฐ ์„œ๋ผ์šด๋“œ, ํ•˜๋‚˜ ์ธ์‹
      vsm ์ฐจ๋Ÿ‰ ๋ถ€์ฐฉ๋œ ๋ฒˆํ˜ธํŒ, 360ยฐ ์„œ๋ผ์šด๋“œ, ๋‹ค์ค‘ ์ธ์‹
    • ๊ฐ์ฒด ์ธ์‹ ์˜ต์…˜ ์‚ฌ์šฉ ์˜ˆ

      options ์˜๋ฏธ
      d ๋‹จ์ผ ๊ฐ์ฒด ์ธ์‹ (์ฐจ๋Ÿ‰ ๋ฒˆํ˜ธ ์ธ์‹ ์•ˆํ•จ)
      dr ๋‹จ์ผ ๊ฐ์ฒด, ์ฐจ๋Ÿ‰ ๋ฒˆํ˜ธ ์ธ์‹
      ds ๋‹จ์ผ ๊ฐ์ฒด, 360ยฐ ์„œ๋ผ์šด๋“œ ์ธ์‹ (์ฐจ๋Ÿ‰ ๋ฒˆํ˜ธ ์ธ์‹ ์•ˆํ•จ)
      dsr ๋‹จ์ผ ๊ฐ์ฒด, 360ยฐ ์„œ๋ผ์šด๋“œ, ์ฐจ๋Ÿ‰ ๋ฒˆํ˜ธ ์ธ์‹
      dm ๋‹ค์ค‘ ๊ฐ์ฒด ์ธ์‹ (์ฐจ๋Ÿ‰ ๋ฒˆํ˜ธ ์ธ์‹ ์•ˆํ•จ)
      dmr ๋‹ค์ค‘ ๊ฐ์ฒด, ์ฐจ๋Ÿ‰ ๋ฒˆํ˜ธ ์ธ์‹ (์ฐจ๋Ÿ‰ ๋ฒˆํ˜ธ ์ธ์‹ ์•ˆํ•จ)
      dms ๋‹ค์ค‘ ๊ฐ์ฒด, 360ยฐ ์„œ๋ผ์šด๋“œ (์ฐจ๋Ÿ‰ ๋ฒˆํ˜ธ ์ธ์‹ ์•ˆํ•จ)
      dmsr ๋‹ค์ค‘ ๊ฐ์ฒด, 360ยฐ ์„œ๋ผ์šด๋“œ, ์ฐจ๋Ÿ‰ ๋ฒˆํ˜ธ ์ธ์‹

Return value:

  • outputFormat์— ์ง€์ •ํ•œ ๋ฐ์ดํ„ฐ ํ˜•์‹์˜ ๋ฌธ์ž์—ด(utf-8 ์ธ์ฝ”๋”ฉ)๋กœ ๋ฒˆํ˜ธ ์ธ์‹ ๊ฒฐ๊ณผ๋ฅผ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค.
  • ์‚ฌ์šฉํ•œ options์ด ๋ฒˆํ˜ธ์ธ์‹๊ณผ ๊ฐ์ฒด์ธ์‹ ๊ณ„์—ด์— ๋”ฐ๋ผ outputFormat ํ˜•์‹์ด ์ด์›ํ™”๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค. (์ฐธ๊ณ : 2. Output Format)

Remarks:

  • Return value์— ์‚ฌ์šฉ๋˜๋Š” ๋ฌธ์ž์—ด ๋ฒ„ํผ๋Š” ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ๋‚ด๋ถ€์—์„œ ๊ด€๋ฆฌ๋˜๋ฉฐ ์‘์šฉ ํ”„๋กœ๊ทธ๋žจ์—์„œ๋Š” ๋ฌธ์ž์—ด ๋ฒ„ํผ๋ฅผ ์ฐธ์กฐํ•˜๊ธฐ๋งŒ ํ•˜๋ฉด ๋ฉ๋‹ˆ๋‹ค.
  • ์ด ๋ฌธ์ž์—ด ๋ฒ„ํผ๋Š” thread-safeํ•˜๋ฉฐ ๊ฐ thread ๋ณ„๋กœ ๋‹ค์Œ ํ˜ธ์ถœ ์ „๊นŒ์ง€ ๊ฒฐ๊ณผ ๊ฐ’์ด ์œ ์ง€๋ฉ๋‹ˆ๋‹ค.
  • ์ฐธ๊ณ  ์‚ฌ์ดํŠธ

1.3. anpr_read_pixels

๋กœ๋”ฉ๋œ ์ด๋ฏธ์ง€์˜ ๋ฉ”๋ชจ๋ฆฌ ๋ฒ„ํผ์—์„œ ์ฐจ๋Ÿ‰ ๋ฒˆํ˜ธ๋ฅผ ์ธ์‹ํ•ฉ๋‹ˆ๋‹ค. v2.3.0๋ถ€ํ„ฐ๋Š” ์ธ์ฝ”๋”ฉ๋œ ์ด๋ฏธ์ง€ ๋ฒ„ํผ๋ฅผ ์ž…๋ ฅํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

TS_ANPR_ENTRY anpr_read_pixels(
  const unsigned char* pixels,  // [IN] ์ด๋ฏธ์ง€ ํ”ฝ์…€ ์‹œ์ž‘ ์ฃผ์†Œ
  const unsigned long width,    // [IN] ์ด๋ฏธ์ง€ ๊ฐ€๋กœ ํ”ฝ์…€ ์ˆ˜
  const unsigned long height,   // [IN] ์ด๋ฏธ์ง€ ์„ธ๋กœ ํ”ฝ์…€ ์ˆ˜
  const unsigned long stride,   // [IN] ์ด๋ฏธ์ง€ ํ•œ ๋ผ์ธ์˜ ๋ฐ”์ดํŠธ ์ˆ˜
  const char* pixelFormat,      // [IN] ์ด๋ฏธ์ง€ ํ”ฝ์…€ ํ˜•์‹ 
  const char* outputFormat,     // [IN] ์ถœ๋ ฅ ๋ฐ์ดํ„ฐ ํ˜•์‹
  const char* options);         // [IN] ๊ธฐ๋Šฅ ์˜ต์…˜

Parameters:

  • pixels:
    • ์ด๋ฏธ์ง€ ํ”ฝ์…€ ์‹œ์ž‘ ์ฃผ์†Œ
  • width:
    • ์ด๋ฏธ์ง€ ๊ฐ€๋กœ ํ”ฝ์…€ ์ˆ˜
    • ์ธ์ฝ”๋”ฉ๋œ ์ด๋ฏธ์ง€์ธ ๊ฒฝ์šฐ ์ด ๋ฐ”์ดํŠธ ์ˆ˜
  • height:
    • ์ด๋ฏธ์ง€ ์„ธ๋กœ ํ”ฝ์…€ ์ˆ˜
    • ์ธ์ฝ”๋”ฉ๋œ ์ด๋ฏธ์ง€์ธ ๊ฒฝ์šฐ ์‚ฌ์šฉ์•ˆํ•จ (๊ธฐ๋ณธ๊ฐ’ 0์œผ๋กœ ์ง€์ •)
  • stride:
    • ์ด๋ฏธ์ง€ ํ•œ ๋ผ์ธ์˜ ๋ฐ”์ดํŠธ ์ˆ˜ (0์ด๋ฉด padding์˜์—ญ์ด ์—†๋Š” ๊ฒƒ์œผ๋กœ ๊ฐ„์ฃผํ•˜๊ณ  ์ž๋™ ๊ณ„์‚ฐ)
    • ์ธ์ฝ”๋”ฉ๋œ ์ด๋ฏธ์ง€์ธ ๊ฒฝ์šฐ ์‚ฌ์šฉ์•ˆํ•จ (๊ธฐ๋ณธ๊ฐ’ 0์œผ๋กœ ์ง€์ •)
  • pixelFormat:
    • ์ด๋ฏธ์ง€ ํ”ฝ์…€ ํฌ๋ฉง
    • ์ง€์›ํ•˜๋Š” ํ”ฝ์…€ ํฌ๋ฉง:
      • GRAY: ํ‘๋ฐฑ ์ด๋ฏธ์ง€ (8bpp)
      • BGRA: BGRA (32bpp)
      • RGBA: RGBA (32bpp)
      • RGB: RGB (24bpp)
      • BGR: BGR (24bpp)
      • BGR555: BGR (16bpp)
      • BGR565: BGR (16bpp)
      • HSV: HSV (32bpp)
      • YCrCb: YUV444 (32bpp)
      • I420: YUV420 (12bpp)
      • YV12: YUV420 (12bpp)
      • IYUV: YUV420 (12bpp)
      • NV12: YUV420 (12bpp)
      • NV21: YUV420 (12bpp)
    • ์ง€์›ํ•˜๋Š” ์ด๋ฏธ์ง€ ์ธ์ฝ”๋”ฉ ํ˜•์‹
      • bmp, jpg, jpeg, png, pnm, pbm, pgm, ppm, jfif, webp
      • encoded๋กœ ์ง€์ •ํ•˜๋ฉด ์ด๋ฏธ์ง€ ํ˜•์‹ ์ž๋™ ์ธ์‹
  • outputFormat: (anpr_read_file๊ณผ ๋™์ผ)
  • options: (anpr_read_file๊ณผ ๋™์ผ)

Return value: (anpr_read_file๊ณผ ๋™์ผ) Remarks: (anpr_read_file๊ณผ ๋™์ผ)

2. Output Format

์ถœ๋ ฅ ๋ฐ์ดํ„ฐ๋Š” options์— d๊ฐ€ ํฌํ•จ๋˜๋Š” ๊ฐ์ฒด ์ธ์‹๊ณผ ํฌํ•จ๋˜์ง€ ์•Š๋Š” ์ฐจ๋Ÿ‰ ๋ฒˆํ˜ธ ์ธ์‹ ๋‘ ๊ฐ€์ง€ ํ˜•์‹์œผ๋กœ ๊ตฌ๋ถ„๋ฉ๋‹ˆ๋‹ค.

2.1. ์ฐจ๋Ÿ‰ ๋ฒˆํ˜ธ ์ธ์‹ ๊ฒฐ๊ณผ

2.1.1. text

์ฐจ๋Ÿ‰ ๋ฒˆํ˜ธ ํ…์ŠคํŠธ๋งŒ ์ถœ๋ ฅํ•ฉ๋‹ˆ๋‹ค. ๋ฒˆํ˜ธํŒ์ด ์—ฌ๋Ÿฌ ๊ฐœ์ธ ๊ฒฝ์šฐ๋Š” ์ค„๋ฐ”๊ฟˆ ๋ฌธ์ž CR (0x0d)๋กœ ๊ตฌ๋ถ„ํ•ฉ๋‹ˆ๋‹ค.

01๊ฐ€2345
67๋‚˜8901

์ฐจ๋Ÿ‰ ๋ฒˆํ˜ธ๊ฐ€ ์ธ์‹๋˜์ง€ ์•Š์€ ๊ฒฝ์šฐ๋Š” ๋นˆ ํ…์ŠคํŠธNULL terminated string (0x00)๋ฅผ ์ถœ๋ ฅํ•ฉ๋‹ˆ๋‹ค.

์˜ค๋ฅ˜๊ฐ€ ๋ฐ˜ํ™˜๋˜๋Š” ๊ฒฝ์šฐ๋Š” ์•„๋ž˜์™€ ๊ฐ™์€ ํ…์ŠคํŠธ ํ˜•์‹์œผ๋กœ ์ถœ๋ ฅํ•ฉ๋‹ˆ๋‹ค.

error: (1) Invalid parameters
2.1.2. csv

์ฐจ๋Ÿ‰ ๋ฒˆํ˜ธ์™€ ์†์„ฑ์„ csv ํ˜•์‹์œผ๋กœ ์ถœ๋ ฅํ•ฉ๋‹ˆ๋‹ค. ์ธ์‹๋œ ์ฐจ๋Ÿ‰ ๋ฒˆํ˜ธ ๋‹น ํ•œ ๋ผ์ธ ์”ฉ์œผ๋กœ ๊ตฌ์„ฑ๋˜๋ฉฐ ๊ฐ ์ปฌ๋Ÿผ์€ ์ฝค๋งˆ ๋ฌธ์ž(,)๋กœ ๊ตฌ๋ถ„๋ฉ๋‹ˆ๋‹ค.

01๊ฐ€2345,1217,2083,92,175,12.45,0.75,0.83,0.20,ev
67๋‚˜8901,1108,1317,67,217,12.45,0.76,0.89,0.10,

๊ฐ ์ปฌ๋Ÿผ์˜ ์˜๋ฏธ๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.

์ปฌ๋Ÿผ ์˜๋ฏธ ๋น„๊ณ 
1 ์ฐจ๋Ÿ‰๋ฒˆํ˜ธ text
2 ๋ฒˆํ˜ธํŒ xํ”ฝ์…€ ์ขŒํ‘œ area.x
3 ๋ฒˆํ˜ธํŒ yํ”ฝ์…€ ์ขŒํ‘œ area.y
4 ๋ฒˆํ˜ธํŒ ํญ area.width
5 ๋ฒˆํ˜ธํŒ ๋†’์ด area.height
6 ๋ฒˆํ˜ธํŒ ๊ฐ๋„ area.angle
7 ๋ฌธ์ž ์ธ์‹ ์‹ ๋ขฐ๋„ conf.ocr
8 ๋ฒˆํ˜ธํŒ ์ธ์‹ ์‹ ๋ขฐ๋„ conf.plate
9 ๋ฌธ์ž ์ธ์‹ ์†Œ์š” ์‹œ๊ฐ„ (์ดˆ) elapsed
10(1) ์นœํ™˜๊ฒฝ ์ „๊ธฐ์ž๋™์ฐจ ์—ฌ๋ถ€ attr.ev
  • (1) ์นœํ™˜๊ฒฝ ์ „๊ธฐ์ž๋™์ฐจ์ด๋ฉด ev๊ฐ€ ์ถœ๋ ฅ๋˜๊ณ  ์•„๋‹ˆ๋ฉด ๊ณต๋ž€์œผ๋กœ ํ‘œ์‹œ๋จ

์ฐจ๋Ÿ‰ ๋ฒˆํ˜ธ๊ฐ€ ์ธ์‹๋˜์ง€ ์•Š์€ ๊ฒฝ์šฐ๋Š” ๋นˆ ํ…์ŠคํŠธNULL terminated string (0x00)๋ฅผ ์ถœ๋ ฅํ•ฉ๋‹ˆ๋‹ค.

์˜ค๋ฅ˜๊ฐ€ ๋ฐ˜ํ™˜๋˜๋Š” ๊ฒฝ์šฐ๋Š” ์•„๋ž˜์™€ ๊ฐ™์€ ํ…์ŠคํŠธ ํ˜•์‹์œผ๋กœ ์ถœ๋ ฅํ•ฉ๋‹ˆ๋‹ค.

error,1,Invalid parameters

2.1.3. json

์ฐจ๋Ÿ‰ ๋ฒˆํ˜ธ์™€ ์†์„ฑ์„ json ํ˜•์‹์œผ๋กœ ์ถœ๋ ฅํ•ฉ๋‹ˆ๋‹ค.

[
  {                         // ์ฒซ๋ฒˆ์งธ ๋ฒˆํ˜ธํŒ  
    "text": "01๊ฐ€2345",     // ์ฐจ๋Ÿ‰ ๋ฒˆํ˜ธ
    "area": {               // ๋ฒˆํ˜ธํŒ ์˜์—ญ (ํ”ฝ์…€ ๋‹จ์œ„)
      "x": 1217,            // ์ขŒ์ธก ์ƒ๋‹จ x ์ขŒํ‘œ
      "y": 2083,            // ์ขŒ์ธก ์ƒ๋‹จ y ์ขŒํ‘œ
      "width": 92,          // ํญ
      "height": 175,        // ๋†’์ด
      "angle": 12.45        // ๊ธฐ์šธ๊ธฐ (๋„)
    },
    "attrs": {              // ๋ฒˆํ˜ธํŒ ์†์„ฑ
      "ev": true            // ์นœํ™˜๊ฒฝ ์ „๊ธฐ์ž๋™์ฐจ ์—ฌ๋ถ€
    },
    "ev": true,             // deprecated (attrs.ev๋กœ ์˜ฎ๊น€, ์ถ”ํ›„ ๋ฒ„์ „์—์„œ ์‚ญ์ œ ์˜ˆ์ •)
    "conf": {               // ์‹ ๋ขฐ๋„ (๋ฒ”์œ„: 0 ~ 1)
      "ocr": 0.75,          // ๋ฌธ์ž ์ธ์‹ ์‹ ๋ขฐ๋„
      "plate": 0.84         // ๋ฒˆํ˜ธํŒ ์ธ์‹ ์‹ ๋ขฐ๋„
    },
    "elapsed": 0.27         // ์†Œ์š” ์‹œ๊ฐ„ (์ดˆ ๋‹จ์œ„)
  },
  {                         // ๋‘๋ฒˆ์งธ ๋ฒˆํ˜ธํŒ
    "text": "67๋‚˜8901",
    "area": {
      "x": 1108,
      "y": 1317,
      "width": 67,
      "height": 217,
      "angle": 12.45
    },
    "attrs": {
      "ev": false
    },
    "ev": false,
    "conf": {
      "ocr": 0.76,
      "plate": 0.89
    },
    "elapsed": 0.14
  }
]

์ฐจ๋Ÿ‰ ๋ฒˆํ˜ธ๊ฐ€ ์ธ์‹๋˜์ง€ ์•Š์€ ๊ฒฝ์šฐ๋Š” ์•„๋ž˜์™€ ๊ฐ™์ด ๋นˆ ๋ฐ์ดํ„ฐ๋ฅผ ์ถœ๋ ฅํ•ฉ๋‹ˆ๋‹ค.

[]

์˜ค๋ฅ˜๊ฐ€ ๋ฐ˜ํ™˜๋˜๋Š” ๊ฒฝ์šฐ๋Š” ์•„๋ž˜์™€ ๊ฐ™์€ json ํ˜•์‹์œผ๋กœ ์ถœ๋ ฅํ•ฉ๋‹ˆ๋‹ค.

{
  "error": {
    "code": 1,
    "message": "Invalid parameters"
  }
}

2.1.4. yaml

์ฐจ๋Ÿ‰ ๋ฒˆํ˜ธ์™€ ์†์„ฑ์„ yaml ํ˜•์‹์œผ๋กœ ์ถœ๋ ฅํ•ฉ๋‹ˆ๋‹ค.

- text: 01๊ฐ€2345        # ์ฒซ๋ฒˆ์งธ ๋ฒˆํ˜ธํŒ, ์ฐจ๋Ÿ‰ ๋ฒˆํ˜ธ 
  area:                 # ๋ฒˆํ˜ธํŒ ์˜์—ญ (ํ”ฝ์…€ ๋‹จ์œ„)
    x: 1217             # ์ขŒ์ธก ์ƒ๋‹จ x ์ขŒํ‘œ
    y: 2083             # ์ขŒ์ธก ์ƒ๋‹จ y ์ขŒํ‘œ
    width: 92           # ํญ
    height: 175         # ๋†’์ด
    angle: 12.45        # ๊ธฐ์šธ๊ธฐ (๋„)
  conf:                 # ์‹ ๋ขฐ๋„ (๋ฒ”์œ„: 0 ~ 1)
    ocr: 0.75           # ๋ฌธ์ž ์ธ์‹ ์‹ ๋ขฐ๋„
    plate: 0.83         # ๋ฒˆํ˜ธํŒ ์ธ์‹ ์‹ ๋ขฐ๋„
  attrs:                # ๋ฒˆํ˜ธํŒ ์†์„ฑ
    ev: true            # ์นœํ™˜๊ฒฝ ์ „๊ธฐ์ž๋™์ฐจ ์—ฌ๋ถ€
  ev: true              # deprecated (attrs.ev๋กœ ์˜ฎ๊น€, ์ถ”ํ›„ ๋ฒ„์ „์—์„œ ์‚ญ์ œ ์˜ˆ์ •)
  elapsed: 0.20         # ์†Œ์š” ์‹œ๊ฐ„ (์ดˆ)
- text: 67๋‚˜8901        # ๋‘๋ฒˆ์งธ ๋ฒˆํ˜ธํŒ
  area:
    x: 1108
    y: 1317
    width: 67
    height: 217
    angle: 12.45
  conf:
    ocr: 0.76
    plate: 0.89
  ev: false
  elapsed: 0.10

์ฐจ๋Ÿ‰ ๋ฒˆํ˜ธ๊ฐ€ ์ธ์‹๋˜์ง€ ์•Š์€ ๊ฒฝ์šฐ๋Š” ์•„๋ž˜์™€ ๊ฐ™์ด ๋นˆ ๋ฐ์ดํ„ฐ๋ฅผ ์ถœ๋ ฅํ•ฉ๋‹ˆ๋‹ค.

์˜ค๋ฅ˜๊ฐ€ ๋ฐ˜ํ™˜๋˜๋Š” ๊ฒฝ์šฐ๋Š” ์•„๋ž˜์™€ ๊ฐ™์€ yaml ํ˜•์‹์œผ๋กœ ์ถœ๋ ฅํ•ฉ๋‹ˆ๋‹ค.

error
  code: 1
  message: Invalid parameters

2.1.5. xml

์ฐจ๋Ÿ‰ ๋ฒˆํ˜ธ์™€ ์†์„ฑ์„ xml ํ˜•์‹์œผ๋กœ ์ถœ๋ ฅํ•ฉ๋‹ˆ๋‹ค.

<?xml version="1.0" encoding="utf-8"?>
<data>
  <!-- ์ฒซ๋ฒˆ์งธ ๋ฒˆํ˜ธํŒ 
    text: ์ฐจ๋Ÿ‰ ๋ฒˆํ˜ธ
    ev: deprecated (attrs.ev๋กœ ์˜ฎ๊น€, ์ถ”ํ›„ ๋ฒ„์ „์—์„œ ์‚ญ์ œ ์˜ˆ์ •)
    elapsed: ์†Œ์š” ์‹œ๊ฐ„ (์ดˆ)
  -->
  <license-plate text="01๊ฐ€2345" ev="true" elapsed="0.20">
    <!-- ๋ฒˆํ˜ธํŒ ์†์„ฑ
      ev: ์นœํ™˜๊ฒฝ ์ „๊ธฐ์ž๋™์ฐจ ์—ฌ๋ถ€ 
    -->    
    <attrs ev="true"/>
    <!-- ๋ฒˆํ˜ธํŒ ์˜์—ญ (ํ”ฝ์…€ ๋‹จ์œ„)
      x: ์ขŒ์ธก ์ƒ๋‹จ x ์ขŒํ‘œ
      y:  ์ขŒ์ธก ์ƒ๋‹จ y ์ขŒํ‘œ
      width: ํญ
      height: ๋†’์ด
      angle: ๊ธฐ์šธ๊ธฐ (๋„)
    -->
    <area x="1217" y="2083" width="92" height="175" angle="12.45"/>
    <!-- ์‹ ๋ขฐ๋„ (๋ฒ”์œ„: 0 ~ 1)
      ocr: ๋ฌธ์ž ์ธ์‹ ์‹ ๋ขฐ๋„
      plate: ๋ฒˆํ˜ธํŒ ์ธ์‹ ์‹ ๋ขฐ๋„
    -->
    <conf ocr="0.75" plate="0.83"/>
  </license-plate>
  <!-- ๋‘๋ฒˆ์งธ ๋ฒˆํ˜ธํŒ -->
  <license-plate text="67๋‚˜8901" ev="false" elapsed="0.11">
    <attrs ev="false"/>
    <area x="1108" y="1317" width="67" height="217"/>
    <conf ocr="0.76" plate="0.89"/>
  </license-plate>
</data>

์ฐจ๋Ÿ‰ ๋ฒˆํ˜ธ๊ฐ€ ์ธ์‹๋˜์ง€ ์•Š์€ ๊ฒฝ์šฐ๋Š” ์•„๋ž˜์™€ ๊ฐ™์ด ๋นˆ ๋ฐ์ดํ„ฐ๋ฅผ ์ถœ๋ ฅํ•ฉ๋‹ˆ๋‹ค.

<?xml version="1.0" encoding="utf-8"?>
<data />

์˜ค๋ฅ˜๊ฐ€ ๋ฐ˜ํ™˜๋˜๋Š” ๊ฒฝ์šฐ๋Š” ์•„๋ž˜์™€ ๊ฐ™์€ xml ํ˜•์‹์œผ๋กœ ์ถœ๋ ฅํ•ฉ๋‹ˆ๋‹ค.

<?xml version="1.0" encoding="utf-8"?>
<error code="1" message="Invalid parameters" />

2.2. ๊ฐ์ฒด ์ธ์‹ ๊ฒฐ๊ณผ

์ด๋ฏธ์ง€์—์„œ ๋ฏธ๋ฆฌ ํ•™์Šตํ•œ ๊ฐ์ฒด๋ฅผ ์ฐพ์•„๋ƒ…๋‹ˆ๋‹ค. ์ฐจ๋ณ„ํ™”๋œ ํŠน์ง•์€ 360ยฐ ์–ด์•ˆ ๋ Œ์ฆˆ ์นด๋ฉ”๋ผ๋กœ ์ดฌ์˜๋œ ์›๋ณธ ์ด๋ฏธ์ง€์—์„œ ์™ธ๊ณก๋œ ํ˜•ํƒœ์˜ ๊ฐ์ฒด๋ฅผ ์ธ์‹ํ•ฉ๋‹ˆ๋‹ค. ํ˜„์žฌ ์ง€์›ํ•˜๋Š” ๊ฐ์ฒด ๋ชฉ๋ก์€ ์•„๋ž˜์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค.

class ์ด๋ฆ„
car ์ฐจ๋Ÿ‰
motorcycle ์˜คํ† ๋ฐ”์ด
2.2.1. csv, text

๊ฐ์ฒด ์ธ์‹ ๊ฒฐ๊ณผ๋ฅผ cvs ํ˜•์‹์˜ ํ…์ŠคํŠธ๋กœ ์ถœ๋ ฅํ•ฉ๋‹ˆ๋‹ค. ์ถœ๋ ฅ ํ˜•์‹์„ text๋กœ ์ง€์ •ํ•œ ๊ฒฝ์šฐ๋„ csv ํ˜•์‹์œผ๋กœ ๋Œ€์ฒด๋˜์–ด ์ถœ๋ ฅ๋ฉ๋‹ˆ๋‹ค.

์ธ์‹๋œ ๊ฐ์ฒด ๋‹น ํ•œ ๋ผ์ธ ์”ฉ์œผ๋กœ ๊ตฌ์„ฑ๋˜๋ฉฐ ๊ฐ ์ปฌ๋Ÿผ์€ ์ฝค๋งˆ ๋ฌธ์ž(,)๋กœ ๊ตฌ๋ถ„๋ฉ๋‹ˆ๋‹ค.

car,2171,2281,396,521,0.9679,0.2886,51์กฐ8969,2420,2295,110,81,147.5933,0.9005,0.7864,0.3913,ev
car,264,2266,433,543,0.9706,0.2886,41๋…ธ7656,315,2281,103,81,211.3135,0.9160,0.8299,0.4189,
car,777,0,579,403,0.9716,0.2886 // ๋ฒˆํ˜ธํŒ ์ •๋ณด๊ฐ€ ์—†๋Š” ๊ฒฝ์šฐ

๊ฐ ์ปฌ๋Ÿผ์˜ ์˜๋ฏธ๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค.

์ปฌ๋Ÿผ ์˜๋ฏธ ๋น„๊ณ 
1 ์ข…๋ฅ˜ class
2 xํ”ฝ์…€ ์ขŒํ‘œ area.x
3 yํ”ฝ์…€ ์ขŒํ‘œ area.y
4 ํญ area.width
5 ๋†’์ด area.height
6 ์‹ ๋ขฐ๋„ conf
7 ์†Œ์š” ์‹œ๊ฐ„(์ดˆ) elapsed
8(1) ์ฐจ๋Ÿ‰๋ฒˆํ˜ธ licensePlate.text
9 ๋ฒˆํ˜ธํŒ xํ”ฝ์…€ ์ขŒํ‘œ licensePlate.area.x
10 ๋ฒˆํ˜ธํŒ yํ”ฝ์…€ ์ขŒํ‘œ licensePlate.area.y
11 ๋ฒˆํ˜ธํŒ ํญ licensePlate.area.width
12 ๋ฒˆํ˜ธํŒ ๋†’์ด licensePlate.area.height
13 ๋ฒˆํ˜ธํŒ ๊ฐ๋„ licensePlate.area.angle
14 ๋ฌธ์ž ์ธ์‹ ์‹ ๋ขฐ๋„ licensePlate.conf.ocr
15 ๋ฒˆํ˜ธํŒ ์ธ์‹ ์‹ ๋ขฐ๋„ licensePlate.conf.plate
16 ๋ฌธ์ž ์ธ์‹ ์†Œ์š” ์‹œ๊ฐ„ (์ดˆ) licensePlate.elapsed
17(2) ์นœํ™˜๊ฒฝ ์ „๊ธฐ์ž๋™์ฐจ ์—ฌ๋ถ€ licensePlate.attrs.ev
  • (1) 8๋ฒˆ ์ปฌ๋Ÿผ๋ถ€ํ„ฐ๋Š” r ์˜ต์…˜์„ ์‚ฌ์šฉํ•˜์—ฌ ์ฐจ๋Ÿ‰ ๋ฒˆํ˜ธ๊ฐ€ ์ธ์‹๋œ ๊ฒฝ์šฐ๋งŒ ์ถœ๋ ฅ๋˜๋ฉฐ ์•„๋‹ˆ๋ฉด ์ดํ•˜ ์ปฌ๋Ÿผ์ด ๋ชจ๋‘ ์ƒ๋žต๋จ
  • (2) 17๋ฒˆ ์ปฌ๋Ÿผ์€ ์นœํ™˜๊ฒฝ ์ „๊ธฐ์ž๋™์ฐจ๋กœ ์ธ์‹๋œ ๊ฒฝ์šฐ ev๋กœ ์ถœ๋ ฅ๋˜๋ฉฐ ์•„๋‹ˆ๋ฉด ๊ณต๋ž€์œผ๋กœ ํ‘œ์‹œ๋จ

๊ฐ์ฒด๊ฐ€ ์ธ์‹๋˜์ง€ ์•Š์€ ๊ฒฝ์šฐ๋Š” ๋นˆ ํ…์ŠคํŠธNULL terminated string (0x00)๋ฅผ ์ถœ๋ ฅํ•ฉ๋‹ˆ๋‹ค.

์˜ค๋ฅ˜๊ฐ€ ๋ฐ˜ํ™˜๋˜๋Š” ๊ฒฝ์šฐ๋Š” ์•„๋ž˜์™€ ๊ฐ™์€ ํ…์ŠคํŠธ ํ˜•์‹์œผ๋กœ ์ถœ๋ ฅํ•ฉ๋‹ˆ๋‹ค.

error,1,Invalid parameters
2.2.2. json

๊ฐ์ฒด ์ธ์‹ ๊ฒฐ๊ณผ๋ฅผ json ํ˜•์‹์œผ๋กœ ์ถœ๋ ฅํ•ฉ๋‹ˆ๋‹ค.

 [
  {                           // ์ฒซ๋ฒˆ์งธ ๊ฐ์ฒด
    "class": "car",           // ๊ฐ์ฒด ์ข…๋ฅ˜
    "area": {                 // ๊ฐ์ฒด ์˜์—ญ (ํ”ฝ์…€ ๋‹จ์œ„)
      "x": 2171,              // ์ขŒ์ธก ์ƒ๋‹จ x ์ขŒํ‘œ
      "y": 2281,              // ์ขŒ์ธก ์ƒ๋‹จ y ์ขŒํ‘œ
      "width": 396,           // ํญ
      "height": 521           // ๋†’์ด
    },
    "conf": 0.9679,           // ๊ฐ์ฒด ์ธ์‹ ์‹ ๋ขฐ๋„ (๋ฒ”์œ„: 0 ~ 1)
    "elapsed": 0.2513,        // ์†Œ์š” ์‹œ๊ฐ„ (์ดˆ)
    "licensePlate": [         // ๋ฒˆํ˜ธํŒ
      {
        "text": "51์กฐ8969"    // ์ฐจ๋Ÿ‰ ๋ฒˆํ˜ธ
        "area": {             // ๋ฒˆํ˜ธํŒ ์˜์—ญ (ํ”ฝ์…€ ๋‹จ์œ„)
          "x": 2420,          // ์ขŒ์ธก ์ƒ๋‹จ x ์ขŒํ‘œ
          "y": 2295           // ์ขŒ์ธก ์ƒ๋‹จ y ์ขŒํ‘œ
          "width": 110,       // ํญ
          "height": 81,       // ๋†’์ด
          "angle": 147.5933   // ๊ธฐ์šธ๊ธฐ (๋„)
        },
        "attrs": {            // ๋ฒˆํ˜ธํŒ ์†์„ฑ
          "ev": true          // ์นœํ™˜๊ฒฝ ์ „๊ธฐ์ž๋™์ฐจ ์—ฌ๋ถ€
        },
        "conf": {             // ์‹ ๋ขฐ๋„ (๋ฒ”์œ„: 0 ~ 1)
          "ocr": 0.9005,      // ๋ฌธ์ž ์ธ์‹ ์‹ ๋ขฐ๋„
          "plate": 0.7864     // ๋ฒˆํ˜ธํŒ ์ธ์‹ ์‹ ๋ขฐ๋„
        },
        "elapsed": 0.3525,    // ์†Œ์š” ์‹œ๊ฐ„ (์ดˆ)
      }
    ]
  },
  {                           // ๋‘๋ฒˆ์งธ ๊ฐ์ฒด    
    "class": "car",
    "area": {      
      "x": 264,
      "y": 2266,
      "width": 433,
      "height": 543
    },
    "conf": 0.9706,
    "elapsed": 0.2513,
    "licensePlate": [
      {
        "text": "41๋…ธ7656"
        "area": {
          "x": 315,
          "y": 2281,
          "width": 103,
          "height": 81,
          "angle": 211.3135
        },
        "attrs": {
          "ev": false
        },
        "conf": {
          "ocr": 0.916,
          "plate": 0.8299
        },
        "elapsed": 0.4402
      }
    ]
  },
  {                           // ์„ธ๋ฒˆ์งธ ๊ฐ์ฒด (๋ฒˆํ˜ธํŒ ์ •๋ณด๊ฐ€ ์—†๋Š” ๊ฒฝ์šฐ)
    "class": "car",
    "area": {
      "x": 777,
      "y": 0
      "height": 403,
      "width": 579,
    },
    "conf": 0.9716,
    "elapsed": 0.2513
  }
]

๊ฐ์ฒด๊ฐ€ ์ธ์‹๋˜์ง€ ์•Š์€ ๊ฒฝ์šฐ๋Š” ์•„๋ž˜์™€ ๊ฐ™์ด ๋นˆ ๋ฐ์ดํ„ฐ๋ฅผ ์ถœ๋ ฅํ•ฉ๋‹ˆ๋‹ค.

[]

์˜ค๋ฅ˜๊ฐ€ ๋ฐ˜ํ™˜๋˜๋Š” ๊ฒฝ์šฐ๋Š” ์•„๋ž˜์™€ ๊ฐ™์€ json ํ˜•์‹์œผ๋กœ ์ถœ๋ ฅํ•ฉ๋‹ˆ๋‹ค.

{
  "error": {
    "code": 1,
    "message": "Invalid parameters"
  }
}
2.2.3. yaml

๊ฐ์ฒด ์ธ์‹ ๊ฒฐ๊ณผ๋ฅผ yaml ํ˜•์‹์œผ๋กœ ์ถœ๋ ฅํ•ฉ๋‹ˆ๋‹ค.

- class: car            # ์ฒซ๋ฒˆ์งธ ๊ฐ์ฒด, ๊ฐ์ฒด ์ข…๋ฅ˜
  area:                 # ๊ฐ์ฒด ์˜์—ญ (ํ”ฝ์…€ ๋‹จ์œ„)
    x: 2171             # ์ขŒ์ธก ์ƒ๋‹จ x ์ขŒํ‘œ
    y: 2281             # ์ขŒ์ธก ์ƒ๋‹จ y ์ขŒํ‘œ
    width: 396          # ํญ
    height: 521         # ๋†’์ด
  conf: 0.9678          # ๊ฐ์ฒด ์ธ์‹ ์‹ ๋ขฐ๋„ (๋ฒ”์œ„: 0 ~ 1)
  elapsed: 0.3190       # ์†Œ์š” ์‹œ๊ฐ„ (์ดˆ)
  licensePlate:         # ๋ฒˆํ˜ธํŒ
    - text: 51์กฐ8969    # ์ฐจ๋Ÿ‰ ๋ฒˆํ˜ธ
      area:             # ๋ฒˆํ˜ธํŒ ์˜์—ญ (ํ”ฝ์…€ ๋‹จ์œ„)
        x: 2420         # ์ขŒ์ธก ์ƒ๋‹จ x ์ขŒํ‘œ
        y: 2295         # ์ขŒ์ธก ์ƒ๋‹จ y ์ขŒํ‘œ
        width: 110      # ํญ
        height: 81      # ๋†’์ด
        angle: 147.5933 # ๊ธฐ์šธ๊ธฐ (๋„)
      attrs:            # ๋ฒˆํ˜ธํŒ ์†์„ฑ
        ev: true        # ์นœํ™˜๊ฒฝ ์ „๊ธฐ์ž๋™์ฐจ ์—ฌ๋ถ€
      conf:             # ์‹ ๋ขฐ๋„ (๋ฒ”์œ„: 0 ~ 1)
        ocr: 0.9005     # ๋ฌธ์ž ์ธ์‹ ์‹ ๋ขฐ๋„
        plate: 0.7864   # ๋ฒˆํ˜ธํŒ ์ธ์‹ ์‹ ๋ขฐ๋„
      elapsed: 0.3226   # ์†Œ์š” ์‹œ๊ฐ„ (์ดˆ)
- class: car            # ๋‘๋ฒˆ์งธ ๊ฐ์ฒด
  area:
    x: 264
    y: 2266
    width: 433
    height: 543
  conf: 0.9706
  elapsed: 0.3191
  licensePlate:
    - text: 41๋…ธ7656
      area:
        x: 315
        y: 2281
        width: 103
        height: 81
        angle: 211.3135
      conf:
        ocr: 0.916
        plate: 0.8299
      attrs:
        ev: false
      elapsed: 0.5527
- class: car            # ์„ธ๋ฒˆ์งธ ๊ฐ์ฒด (๋ฒˆํ˜ธํŒ ์ •๋ณด๊ฐ€ ์—†๋Š” ๊ฒฝ์šฐ)
  area:
    x: 777
    y: 0
    width: 579
    height: 403
  conf: 0.9716
  elapsed: 0.3191

๊ฐ์ฒด๊ฐ€ ์ธ์‹๋˜์ง€ ์•Š์€ ๊ฒฝ์šฐ๋Š” ์•„๋ž˜์™€ ๊ฐ™์ด ๋นˆ ๋ฐ์ดํ„ฐ๋ฅผ ์ถœ๋ ฅํ•ฉ๋‹ˆ๋‹ค.

์˜ค๋ฅ˜๊ฐ€ ๋ฐ˜ํ™˜๋˜๋Š” ๊ฒฝ์šฐ๋Š” ์•„๋ž˜์™€ ๊ฐ™์€ yaml ํ˜•์‹์œผ๋กœ ์ถœ๋ ฅํ•ฉ๋‹ˆ๋‹ค.

error
  code: 1
  message: Invalid parameters
2.2.4. xml

๊ฐ์ฒด ์ธ์‹ ๊ฒฐ๊ณผ๋ฅผ xml ํ˜•์‹์œผ๋กœ ์ถœ๋ ฅํ•ฉ๋‹ˆ๋‹ค.

<?xml version="1.0" encoding="utf-8"?>
<data>
  <!-- ์ฒซ๋ฒˆ์งธ ๊ฐ์ฒด
    class: ๊ฐ์ฒด ์ข…๋ฅ˜
    conf: ๊ฐ์ฒด ์ธ์‹ ์‹ ๋ขฐ๋„ (๋ฒ”์œ„: 0 ~ 1)
    elapsed: ์†Œ์š” ์‹œ๊ฐ„ (์ดˆ)
  -->
  <object class="car" conf="0.9679" elapsed="0.3287">
    <!-- ๊ฐ์ฒด ์˜์—ญ (ํ”ฝ์…€ ๋‹จ์œ„)
      x: ์ขŒ์ธก ์ƒ๋‹จ x ์ขŒํ‘œ
      y: ์ขŒ์ธก ์ƒ๋‹จ y ์ขŒํ‘œ
      width: ํญ
      height: ๋†’์ด
    -->
    <area x="2171" y="2281" width="396" height="521"/>

    <!-- ๋ฒˆํ˜ธํŒ
      text: ์ฐจ๋Ÿ‰ ๋ฒˆํ˜ธ
      elapsed: ์†Œ์š” ์‹œ๊ฐ„ (์ดˆ)
    -->
    <license-plate text="51์กฐ8969" elapsed="0.3961">
    
      <!-- ๋ฒˆํ˜ธํŒ ์†์„ฑ
        ev: ์นœํ™˜๊ฒฝ ์ „๊ธฐ์ž๋™์ฐจ ์—ฌ๋ถ€
      -->
      <attrs ev="true"/>
      
      <!-- ๋ฒˆํ˜ธํŒ ์˜์—ญ (ํ”ฝ์…€ ๋‹จ์œ„)
        x: ์ขŒ์ธก ์ƒ๋‹จ x ์ขŒํ‘œ
        y: ์ขŒ์ธก ์ƒ๋‹จ y ์ขŒํ‘œ
        width: ํญ
        height: ๋†’์ด
        angle: ๊ธฐ์šธ๊ธฐ (๋„)
      -->
      <area x="2420" y="2295" width="110" height="81" angle="147.5933"/>

      <!-- ์‹ ๋ขฐ๋„ (๋ฒ”์œ„: 0 ~ 1)
        ocr: ๋ฌธ์ž ์ธ์‹ ์‹ ๋ขฐ๋„
        plate: ๋ฒˆํ˜ธํŒ ์ธ์‹ ์‹ ๋ขฐ๋„
      -->
      <conf ocr="0.9005" plate="0.7864"/>
    </license-plate>
  </object>

  <!-- ๋‘๋ฒˆ์งธ ๊ฐ์ฒด -->
  <object class="car" conf="0.9706" elapsed="0.3287">
    <area x="264" y="2266" width="433" height="543"/>
    <license-plate text="41๋…ธ7656" elapsed="0.4364">
      <attrs ev="false"/>
      <area x="315" y="2281" width="103" height="81" angle="211.3135"/>
      <conf ocr="0.9160" plate="0.8299"/>
    </license-plate>
  </object>

  <!-- ์„ธ๋ฒˆ์งธ ๊ฐ์ฒด (๋ฒˆํ˜ธํŒ ์ •๋ณด๊ฐ€ ์—†๋Š” ๊ฒฝ์šฐ) -->
  <object class="car" conf="0.9716" elapsed="0.3287">
    <area x="777" y="0" width="579" height="403"/>
  </object>
</data>

๊ฐ์ฒด๊ฐ€ ์ธ์‹๋˜์ง€ ์•Š์€ ๊ฒฝ์šฐ๋Š” ์•„๋ž˜์™€ ๊ฐ™์ด ๋นˆ ๋ฐ์ดํ„ฐ๋ฅผ ์ถœ๋ ฅํ•ฉ๋‹ˆ๋‹ค.

<?xml version="1.0" encoding="utf-8"?>
<data />

์˜ค๋ฅ˜๊ฐ€ ๋ฐ˜ํ™˜๋˜๋Š” ๊ฒฝ์šฐ๋Š” ์•„๋ž˜์™€ ๊ฐ™์€ xml ํ˜•์‹์œผ๋กœ ์ถœ๋ ฅํ•ฉ๋‹ˆ๋‹ค.

<?xml version="1.0" encoding="utf-8"?>
<error code="1" message="Invalid parameters" />

3. ์˜ค๋ฅ˜ ์ฝ”๋“œํ‘œ

์ „์ฒด ์˜ค๋ฅ˜ ๋ชฉ๋ก์€ ์•„๋ž˜ ํ‘œ์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค.

code message ์„ค๋ช…
1 Invalid parameters ํ•จ์ˆ˜ ํ˜ธ์ถœ ์ธ์ž๊ฐ€ ์ž˜๋ชป๋œ ๊ฒฝ์šฐ
2 File not found ์ž…๋ ฅ ์ด๋ฏธ์ง€ ํŒŒ์ผ์ด ์กด์žฌํ•˜์ง€ ์•Š๋Š” ๊ฒฝ์šฐ
3 Invalid image ์ž…๋ ฅ ์ด๋ฏธ์ง€ ๋ฉ”๋ชจ๋ฆฌ๊ฐ€ ํ˜•์‹์— ๋งž์ง€ ์•Š๋Š” ๊ฒฝ์šฐ
4 Unsupported image format ์ž…๋ ฅ ์ด๋ฏธ์ง€๊ฐ€ ์ง€์›๋˜์ง€ ์•Š๋Š” ํ˜•์‹์ธ ๊ฒฝ์šฐ
100 License expired ๋ผ์ด์„ ์Šค๊ฐ€ ๋งŒ๋ฃŒ๋œ ๊ฒฝ์šฐ
101 Corrupted library ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ๊ตฌ์„ฑ ํŒŒ์ผ ์ค‘ ์ผ๋ถ€๊ฐ€ ์—†๊ฑฐ๋‚˜ ์†์ƒ๋œ ๊ฒฝ์šฐ
102 Not initialized ์—”์ง„์ด ์ดˆ๊ธฐํ™”๋˜์ง€ ์•Š์€ ์ƒํƒœ
103 Too many workers ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ํ˜ธ์ถœ ์“ฐ๋ ˆ๋“œ ์ˆ˜๊ฐ€ ํ•œ๊ณ„๋ฅผ ์ดˆ๊ณผํ•œ ๊ฒฝ์šฐ (์ตœ๋Œ€ 256๊ฐœ)
104 Resource exhausted ๋” ์ด์ƒ ์ž์›์„ ํ• ๋‹นํ•  ์ˆ˜ ์—†๋Š” ๊ฒฝ์šฐ
105 License not installed ๋ผ์ด์„ ์Šค๊ฐ€ ์„ค์น˜๋˜์ง€ ์•Š์€ ์ƒํƒœ (๋ฆฌ๋ˆ…์Šค์—์„œ ๋ฌด๋ฃŒ ํ‰๊ฐ€ํŒ ๋ผ์ด์„ผ์Šค๊ฐ€ ์„ค์น˜๋˜์ง€ ์•Š์€ ๊ฒฝ์šฐ ๋ฐœ์ƒํ•จ)
106 USB dongle I/O error USB ๋ผ์ด์„ ์Šค ๋™๊ธ€ ์ฝ๊ธฐ ์‹คํŒจ์‹œ ๋ฐœ์ƒ
107 License required ํ•ด๋‹น ๊ธฐ๋Šฅ์„ ์‚ฌ์šฉํ•˜๊ธฐ ์œ„ํ•œ ๋ผ์ด์„ ์Šค๊ฐ€ ์—†์Œ
108 Unsupported platform ์ง€์›๋˜์ง€ ์•Š๋Š” ํ™˜๊ฒฝ์—์„œ ์‹คํ–‰์‹œ ๋ฐœ์ƒ
200 Unknown ๊ธฐํƒ€ ์ •์˜๋˜์ง€ ์•Š์€ ์˜ค๋ฅ˜

4. ์˜ˆ์ œ

  • ๋””๋ ‰ํ† ๋ฆฌ ๊ตฌ์„ฑ

    /examples
      /bin                  # ๊ฐ ํ”Œ๋žซํผ๋ณ„ ANPR ์—”์ง„
        /windows-x86_64     # x86 64๋น„ํŠธ ์œˆ๋„์šฐ์ฆˆ์šฉ
        /windows-x86        # x86 32๋น„ํŠธ ์œˆ๋„์šฐ์ฆˆ์šฉ
        /linux-x86_64       # x86 64๋น„ํŠธ ๋ฆฌ๋ˆ…์Šค์šฉ
        /linux-aarch64      # ARM 64๋น„ํŠธ ๋ฆฌ๋ˆ…์Šค์šฉ
      /img                  # ํ…Œ์ŠคํŠธ์šฉ ์ƒ˜ํ”Œ ์ด๋ฏธ์ง€
      /cpp                  # C++ ์˜ˆ์ œ
      /csharp               # C#  ์˜ˆ์ œ
      /vb                   # Visual Basic ์˜ˆ์ œ
      /javascript/nodejs    # JavaScript/Node.js ์˜ˆ์ œ
      /python               # Python ์˜ˆ์ œ
      /go                   # Golang ์˜ˆ์ œ
      /pascal/delphi        # Pascal/Delphi ์˜ˆ์ œ
      /perl                 # Perl ์˜ˆ์ œ
      /ruby                 # Ruby ์˜ˆ์ œ
    
  • TS-ANPR ์—”์ง„ ๋””๋ ‰ํ† ๋ฆฌ๋ฅผ /examples/bin ๋””๋ ‰ํ† ๋ฆฌ์— ๋ณต์‚ฌํ•ด ๋„ฃ๊ณ  ์˜ˆ์ œ๋ฅผ ์‹คํ–‰ํ•˜๋ฉด ๋ฉ๋‹ˆ๋‹ค.

์–ธ์–ด ํ˜ธ์ถœ๋ฐฉ์‹ ์˜ˆ์ œ
C/C++ Importlib examples/cpp/anprCpp1
(์ƒ๋™) LoadLibrary examples/cpp/anprCpp2
C# .Net examples/csharp/anprCsharpDotnet1
Visual Basic .Net examples/vb/anprVbDotnet1
Python ctypes examples/python
JavaScript Node.js, ffi examples/javascript/nodejs
Go C, syscall examples/go
Pascal Delphi examples/pascal/delphi
Perl Win32::API examples/perl
Ruby ffi examples/ruby