
    +|h:(                     t   d dgZ ddlZddlZd Z ed      d        Z ed      d        Z ed      d	        Z ed      d
        Z ed      d        Z	 ed      d        Z
 ed       G d d             Z ed       G d d             Zd Zd Zej                  ej                   j"                  _        y)opkernel    Nc                       fd}|S )Nc                 \    | t         j                     j                  | j                  <   | S N)sysmodules__dict____name__)funcmnames    P/var/www/html/test/engine/venv/lib/python3.12/site-packages/cv2/gapi/__init__.pyparameterizedzregister.<locals>.parameterized   s%    59E##DMM2     )r   r   s   ` r   registerr      s     r   zcv2.gapic                      t        j                  t        t        t         j                  j
                  |                   S r   )cvgapi_GNetPackagelistmapdetailstripargss    r   networksr      s'    tC		$>?@@r   c                  H    t        t        t        j                  |             S r   )r   r   r   GCompileArgr   s    r   compile_argsr      s    BNND)**r   cv2c                  
    g | S r   r   r   s    r   GInr"          T7Nr   c                  
    g | S r   r   r   s    r   GOutr%      r#   r   c                  
    g | S r   r   r   s    r   ginr'   "   r#   r   c                  
    g | S r   r   r   s    r   descr_ofr)   '   r#   r   c                   *   e Zd Zd Z G d d      Z G d d      Z G d d      Z G d d	      Z G d
 d      Z G d d      Z	 G d d      Z
 G d d      Z G d d      Z G d d      Z G d d      Z G d d      Z G d d      Z G d d      Zy)GOpaquec                 ,    t        j                  |      S r   )r   GOpaqueTclsargtypes     r   __new__zGOpaque.__new__0   s    {{7##r   c                       e Zd Zd Zy)GOpaque.Boolc                 \    t        j                  t         j                  j                        S r   )r   r-   gapiCV_BOOLselfs    r   r1   zGOpaque.Bool.__new__4       ;;rww//r   Nr   
__module____qualname__r1   r   r   r   Boolr3   3       	0r   r=   c                       e Zd Zd Zy)GOpaque.Intc                 \    t        j                  t         j                  j                        S r   )r   r-   r5   CV_INTr7   s    r   r1   zGOpaque.Int.__new__8       ;;rww~~..r   Nr:   r   r   r   Intr@   7       	/r   rD   c                       e Zd Zd Zy)GOpaque.Int64c                 \    t        j                  t         j                  j                        S r   )r   r-   r5   CV_INT64r7   s    r   r1   zGOpaque.Int64.__new__<       ;;rww//00r   Nr:   r   r   r   Int64rG   ;       	1r   rK   c                       e Zd Zd Zy)GOpaque.UInt64c                 \    t        j                  t         j                  j                        S r   )r   r-   r5   	CV_UINT64r7   s    r   r1   zGOpaque.UInt64.__new__@       ;;rww0011r   Nr:   r   r   r   UInt64rN   ?       	2r   rR   c                       e Zd Zd Zy)GOpaque.Doublec                 \    t        j                  t         j                  j                        S r   )r   r-   r5   	CV_DOUBLEr7   s    r   r1   zGOpaque.Double.__new__D   rQ   r   Nr:   r   r   r   DoublerU   C   rS   r   rX   c                       e Zd Zd Zy)GOpaque.Floatc                 \    t        j                  t         j                  j                        S r   )r   r-   r5   CV_FLOATr7   s    r   r1   zGOpaque.Float.__new__H   rJ   r   Nr:   r   r   r   FloatrZ   G   rL   r   r]   c                       e Zd Zd Zy)GOpaque.Stringc                 \    t        j                  t         j                  j                        S r   )r   r-   r5   	CV_STRINGr7   s    r   r1   zGOpaque.String.__new__L   rQ   r   Nr:   r   r   r   Stringr_   K   rS   r   rb   c                       e Zd Zd Zy)GOpaque.Pointc                 \    t        j                  t         j                  j                        S r   )r   r-   r5   CV_POINTr7   s    r   r1   zGOpaque.Point.__new__P   rJ   r   Nr:   r   r   r   Pointrd   O   rL   r   rg   c                       e Zd Zd Zy)GOpaque.Point2fc                 \    t        j                  t         j                  j                        S r   )r   r-   r5   
CV_POINT2Fr7   s    r   r1   zGOpaque.Point2f.__new__T       ;;rww1122r   Nr:   r   r   r   Point2fri   S       	3r   rm   c                       e Zd Zd Zy)GOpaque.Point3fc                 \    t        j                  t         j                  j                        S r   )r   r-   r5   
CV_POINT3Fr7   s    r   r1   zGOpaque.Point3f.__new__X   rl   r   Nr:   r   r   r   Point3frp   W   rn   r   rs   c                       e Zd Zd Zy)GOpaque.Sizec                 \    t        j                  t         j                  j                        S r   )r   r-   r5   CV_SIZEr7   s    r   r1   zGOpaque.Size.__new__\   r9   r   Nr:   r   r   r   Sizeru   [   r>   r   rx   c                       e Zd Zd Zy)GOpaque.Rectc                 \    t        j                  t         j                  j                        S r   )r   r-   r5   CV_RECTr7   s    r   r1   zGOpaque.Rect.__new__`   r9   r   Nr:   r   r   r   Rectrz   _   r>   r   r}   c                       e Zd Zd Zy)GOpaque.Primc                 \    t        j                  t         j                  j                        S r   )r   r-   r5   CV_DRAW_PRIMr7   s    r   r1   zGOpaque.Prim.__new__d   s    ;;rww3344r   Nr:   r   r   r   Primr   c   s    	5r   r   c                       e Zd Zd Zy)GOpaque.Anyc                 \    t        j                  t         j                  j                        S r   )r   r-   r5   CV_ANYr7   s    r   r1   zGOpaque.Any.__new__h   rC   r   Nr:   r   r   r   Anyr   g   rE   r   r   N)r   r;   r<   r1   r=   rD   rK   rR   rX   r]   rb   rg   rm   rs   rx   r}   r   r   r   r   r   r+   r+   ,   s    $0 0/ /1 12 22 21 12 21 13 33 30 00 05 5/ /r   r+   c                   f   e Zd Zd Z G d d      Z G d d      Z G d d      Z G d d	      Z G d
 d      Z G d d      Z	 G d d      Z
 G d d      Z G d d      Z G d d      Z G d d      Z G d d      Z G d d      Z G d d      Z G d d      Z G d  d!      Z G d" d#      Zy$)%GArrayc                 ,    t        j                  |      S r   )r   GArrayTr.   s     r   r1   zGArray.__new__o   s    zz'""r   c                       e Zd Zd Zy)GArray.Boolc                 \    t        j                  t         j                  j                        S r   )r   r   r5   r6   r7   s    r   r1   zGArray.Bool.__new__s       ::bggoo..r   Nr:   r   r   r   r=   r   r   rE   r   r=   c                       e Zd Zd Zy)
GArray.Intc                 \    t        j                  t         j                  j                        S r   )r   r   r5   rB   r7   s    r   r1   zGArray.Int.__new__w       ::bggnn--r   Nr:   r   r   r   rD   r   v       	.r   rD   c                       e Zd Zd Zy)GArray.Int64c                 \    t        j                  t         j                  j                        S r   )r   r   r5   rI   r7   s    r   r1   zGArray.Int64.__new__{       ::bgg..//r   Nr:   r   r   r   rK   r   z   r>   r   rK   c                       e Zd Zd Zy)GArray.UInt64c                 \    t        j                  t         j                  j                        S r   )r   r   r5   rP   r7   s    r   r1   zGArray.UInt64.__new__       ::bgg//00r   Nr:   r   r   r   rR   r   ~   rL   r   rR   c                       e Zd Zd Zy)GArray.Doublec                 \    t        j                  t         j                  j                        S r   )r   r   r5   rW   r7   s    r   r1   zGArray.Double.__new__   r   r   Nr:   r   r   r   rX   r      rL   r   rX   c                       e Zd Zd Zy)GArray.Floatc                 \    t        j                  t         j                  j                        S r   )r   r   r5   r\   r7   s    r   r1   zGArray.Float.__new__   r   r   Nr:   r   r   r   r]   r      r>   r   r]   c                       e Zd Zd Zy)GArray.Stringc                 \    t        j                  t         j                  j                        S r   )r   r   r5   ra   r7   s    r   r1   zGArray.String.__new__   r   r   Nr:   r   r   r   rb   r      rL   r   rb   c                       e Zd Zd Zy)GArray.Pointc                 \    t        j                  t         j                  j                        S r   )r   r   r5   rf   r7   s    r   r1   zGArray.Point.__new__   r   r   Nr:   r   r   r   rg   r      r>   r   rg   c                       e Zd Zd Zy)GArray.Point2fc                 \    t        j                  t         j                  j                        S r   )r   r   r5   rk   r7   s    r   r1   zGArray.Point2f.__new__       ::bgg0011r   Nr:   r   r   r   rm   r      rS   r   rm   c                       e Zd Zd Zy)GArray.Point3fc                 \    t        j                  t         j                  j                        S r   )r   r   r5   rr   r7   s    r   r1   zGArray.Point3f.__new__   r   r   Nr:   r   r   r   rs   r      rS   r   rs   c                       e Zd Zd Zy)GArray.Sizec                 \    t        j                  t         j                  j                        S r   )r   r   r5   rw   r7   s    r   r1   zGArray.Size.__new__   r   r   Nr:   r   r   r   rx   r      rE   r   rx   c                       e Zd Zd Zy)GArray.Rectc                 \    t        j                  t         j                  j                        S r   )r   r   r5   r|   r7   s    r   r1   zGArray.Rect.__new__   r   r   Nr:   r   r   r   r}   r      rE   r   r}   c                       e Zd Zd Zy)GArray.Scalarc                 \    t        j                  t         j                  j                        S r   )r   r   r5   	CV_SCALARr7   s    r   r1   zGArray.Scalar.__new__   r   r   Nr:   r   r   r   Scalarr      rL   r   r   c                       e Zd Zd Zy)
GArray.Matc                 \    t        j                  t         j                  j                        S r   )r   r   r5   CV_MATr7   s    r   r1   zGArray.Mat.__new__   r   r   Nr:   r   r   r   Matr      r   r   r   c                       e Zd Zd Zy)GArray.GMatc                 \    t        j                  t         j                  j                        S r   )r   r   r5   CV_GMATr7   s    r   r1   zGArray.GMat.__new__   r   r   Nr:   r   r   r   GMatr      rE   r   r   c                       e Zd Zd Zy)GArray.Primc                 \    t        j                  t         j                  j                        S r   )r   r   r5   r   r7   s    r   r1   zGArray.Prim.__new__   s    99RWW1122r   Nr:   r   r   r   r   r      rn   r   r   c                       e Zd Zd Zy)
GArray.Anyc                 \    t        j                  t         j                  j                        S r   )r   r   r5   r   r7   s    r   r1   zGArray.Any.__new__   s    99RWW^^,,r   Nr:   r   r   r   r   r      s    	-r   r   N)r   r;   r<   r1   r=   rD   rK   rR   rX   r]   rb   rg   rm   rs   rx   r}   r   r   r   r   r   r   r   r   r   r   k   s    #/ /. .0 01 11 10 01 10 02 22 2/ // /1 1. ./ /3 3- -r   r   c                     i t         j                  j                  t         j                  j                  t         j                  j
                  t         j                  j                  t         j                  j                  t         j                  j                  t         j                  j                  t         j                  j                  t         j                  j                  t         j                  j                  t         j                  j                  t         j                  j                  t         j                  j                  t         j                  j                   t         j                  j"                  t         j                  j$                  t         j                  j&                  t         j                  j(                  t         j                  j*                  t         j                  j,                  t         j                  j.                  t         j                  j0                  t         j                  j2                  t         j                  j4                  t         j                  j6                  t         j                  j8                  t         j                  j:                  t         j                  j<                  t         j                  j>                  t         j                  j@                  t         j                  jB                  t         j                  jD                  t         j                  jF                  t         j                  jH                  i t         jJ                  j.                  t         j                  j0                  t         jJ                  j2                  t         j                  j4                  t         jJ                  j                  t         j                  j                  t         jJ                  j
                  t         j                  j                  t         jJ                  j                  t         j                  j                  t         jJ                  j                  t         j                  j                  t         jJ                  j                  t         j                  j                  t         jJ                  j                  t         j                  j                  t         jJ                  j                  t         j                  j                   t         jJ                  j"                  t         j                  j$                  t         jJ                  j&                  t         j                  j(                  t         jJ                  j*                  t         j                  j,                  t         jJ                  j.                  t         j                  j0                  t         jJ                  j2                  t         j                  j4                  t         jJ                  jB                  t         j                  jD                  t         jJ                  jF                  t         j                  jH                  i t         j                  j                  dt         j                  j                  dt         j                  j                  dt         j                  j                  dt         j                  j                  dt         j                  j                  dt         j                  j                   dt         j                  j$                  dt         j                  j(                  d	t         j                  j,                  d
t         j                  j0                  dt         j                  j4                  dt         j                  j8                  dt         j                  j<                  dt         j                  j@                  dt         j                  jD                  d fd}|S )Nzcv.gapi.CV_BOOLzcv.gapi.CV_INTzcv.gapi.CV_INT64zcv.gapi.CV_UINT64zcv.gapi.CV_DOUBLEzcv.gapi.CV_FLOATzcv.gapi.CV_STRINGzcv.gapi.CV_POINTzcv.gapi.CV_POINT2Fzcv.gapi.CV_POINT3Fzcv.gapi.CV_SIZEzcv.gapi.CV_RECTzcv.gapi.CV_SCALARzcv.gapi.CV_MATzcv.gapi.CV_GMATzcv.gapi.CV_DRAW_PRIMc                     s$t        dj                   j                              s$t        dj                   j                              t              D ][  \  }}|t        j
                  t        j                  gvs-t        dj                   j                  |j                  |              	fd} _        t        |       _	         S )Nz,{} operation should have at least one input!z-{} operation should have at least one output!z.{} unsupported output type: {} in position: {}c                     t        
      t        |       k7  r-t        dj                  t        
      t        |                   t        t	        
|             D ]  \  }\  }}|v rt        |t        j                        sRt        dj                  j                  |t        j                  j                  t        |      j                              |j                         |   k7  st        dj                  j                  ||      |j                                        |	v rt        |t        j                        sRt        dj                  j                  |t        j                  j                  t        |      j                              |j                         	|   k7  sWt        dj                  j                  |	|      |j                                        |t        |      k7  st        dj                  j                  ||j                  t        |      j                               t        j                  j                  j                  g|  }g }t              D ]  \  }}|t        j                  k(  r |j                  |j!                                9|t        j"                  k(  r |j                  |j%                                l|	v r$|j                  |j'                  	|                |v r$|j                  |j)                  |                t        dj                  j                  |j                  |             t        |      dk7  rt+        |      S |d   S )	Nz:Invalid number of input elements!
Expected: {}, Actual: {}z9{} invalid type for argument {}.
Expected: {}, Actual: {}zA{} invalid GArrayT type for argument {}.
Expected: {}, Actual: {}zA{} invalid GOpaque type for argument {}.
Expected: {}, Actual: {}z?{} invalid input type for argument {}.
Expected: {}, Actual: {}zMIn {}: G-API operation can't produce the output with type: {} in position: {}   r   )len	Exceptionformat	enumeratezip
isinstancer   r   r   typer-   r5   __opoutMetar   appendgetGMatGScalar
getGScalar
getGOpaque	getGArraytuple)r   itar   
out_protosout_typer/   garray_typesgopaque_typesin_typesop_id	out_typestype2strs          r   onz&op.<locals>.op_with_params.<locals>.on  s   8}D	) ]Hs4y9; ; 's8T':; X	6Aq$%a4'(d!'a9L9LdSTgN^N^!_a a \!_4'(l!'a,q/9RT\]^]c]c]eTf!gi i -'%a5'(d!'a9M9MtTUwO_O_!`b b ]1%55'(l!'a-PQBR9SU]^_^d^d^fUg!hj j DG|'(j!'aT!WEUEU!VX X+X0 eS[[848BJ(3 I8rww&%%bjjl3+%%bmmo6.%%bmmM(4K&LM-%%bll<3I&JK#$w#VCLL(2C2CQGI II ),J1(<5$O*Q-Or   )
r   r   r   r   r   r   r   idstaticmethodr   )
r/   r   r   r   r   r   r   r   r   r   s
   `   r   op_with_paramszop.<locals>.op_with_params   s    JQQRUR^R^_``KRRSVS_S_`aai( 	ADAq"**L|LmLL"#S"F3<<Q?A A	A
-	P -	P` b!
r   )&r   r   r=   r5   r6   rD   rB   rK   rI   rR   rP   rX   rW   r]   r\   rb   ra   rg   rf   rm   rk   rs   rr   rx   rw   r}   r|   r   r   r   r   r   r   r   r   r   r   r+   )r   r   r   r   r   r   r   s   ``` @@@r   r   r      sa   IINNrwwIIMMrww~~ IIOOrww// IIrww00	
 IIrww00 IIOOrww// IIrww00 IIOOrww// IIrww11 IIrww11 IINNrww IINNrww IIrww00 IIMMrww~~ IINNrww  IINNrww33!" IIMMrww~~#L(JJOOJJOO JJOO JJNN	
 JJ 0 0 JJ 1 1 JJ 1 1 JJ 0 0 JJ 1 1 JJ 0 0 JJ 2 2 JJ 2 2 JJOO JJOO JJOO 4 4  JJNN!M&
/
. 	0 	1	
 	1 	0 	1 	0 	2 	2 	/ 	/ 	1 	. 	/  	4!H(> >@ r   c                       fd}|S )Nc                 L    j                   | _         j                  | _        | S r   )r   r   )r/   op_clss    r   kernel_with_paramsz"kernel.<locals>.kernel_with_params:  s    iinn
r   r   )r   r   s   ` r   r   r   8  s     r   )__all__r   r    r   r   r   r   r"   r%   r'   r)   r+   r   r   r   gapi_wip_gst_GStreamerPipeliner5   wipGStreamerPipeliner   r   r   <module>r      s  
 
  
*A A 
*+ + 
%  
%  
%  
*  
%</ </ </| 
%H- H- H-X}@ !# A A r   