o
    oi
	                     @   s   d Z ddlZddlmZ ddlZddlmZmZmZ ddl	m
Z
 ddlmZ ddlmZmZ d	ed
edeeejf fddZdS )z'Module to generate synthetic 3d scenes.    N)Dict)randstackwhere)axis_angle_to_rotation_matrix)transform_points   )projection_from_KRtrandom_intrinsics	num_views
num_pointsreturnc                 C   s.  t d|d}tdd}t | dtj d }t | d}|| tj|ddd }t|}t| dd	}t| dd	}t| d
d}	t	|||	gddd }
||
dd |
 }tj|dddf ddd }t|dk |	| d |	|
ddddf< t|||
}t||| dd}|||
|||dS )zGenerate 3d scene.r      g        g      Y@g       @T)dimkeepdimg      g      ?g      )r   ).NN   r   g      ?)KRtPpoints3dpoints2d)r   r
   torchmathpinormr   emptyuniform_r   	transposeminr   r	   r   expand)r   r   r   r   angrvecrot_mattxtytztvecpoints3d_transmin_distr   r    r,   R/home/ubuntu/.local/lib/python3.10/site-packages/kornia/geometry/epipolar/scene.pygenerate_scene    s    
&r.   )__doc__r   typingr   r   kornia.corer   r   r   kornia.geometry.conversionsr   kornia.geometry.linalgr   
projectionr	   r
   intstrTensorr.   r,   r,   r,   r-   <module>   s   $