%PDF- %PDF-
Direktori : /usr/share/hplip/base/__pycache__/ |
Current File : //usr/share/hplip/base/__pycache__/imageprocessing.cpython-312.pyc |
� = f� � �v � d dl mZmZ d dl� d dlZd dlZd dlZd dlZd dlZd dl Z d dl mZ d dl mZ dZ dZdZd � Zd � Zd� Zd� Zd � Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Z d� Z!d4d�Z"d� Z#d� Z$d� Z%d� Z&d � Z'd!� Z(d"� Z)d#� Z*d$� Z+d%� Z,d&� Z-d'� Z.d(� Z/d)� Z0d*� Z1d+� Z2d,� Z3d-� Z4d.� Z5d/� Z6d0� Z7d1� Z8d2� Z9d3� Z:y)5� )�utils�os_utils)�*N)�core_install)�dcheck�� �2 � c �8 � dd l }dd l} | j d | j d f}t |j |� dz � }|j |j ||d� g d�g� }|j |dd�dd�f � }|d dz }|d dz } |j | | g� |z j d |j || g� |z j d |j | | g� |z j d |j || g� |z j d g} | D �cg c] }|d �� }}|D � cg c] } | dkD s� | �� }} |D � cg c] } | dk s� | �� }} | D �cg c] }|d �� }}|D �cg c] }|dkD s� |�� }}|D �cg c] }|dk s� |�� }}t |� }t |� }t |� }t |� }t t ||z � � }t t ||z � � }|j ddt |dz |z � gddt |dz | z � gg d�g� }|j |� |j |� z dd�d d �f }|j | |||f|j �� }|S c c}w c c} w c c} w c c}w c c}w c c}w )Nr � � � �?)r r r � �?)�flags)�numpy�cv2�shape�tuple�array�vstack�getRotationMatrix2D�matrix�A�max�min�int�abs� warpAffine�INTER_LINEAR)�image�angle�npr � image_size�image_center�rot_mat�rot_mat_notranslate�image_w2�image_h2�rotated_coords�pt�x_coords�x�x_pos�x_neg�y_coords�y�y_pos�y_neg�right_bound� left_bound� top_bound� bot_bound�new_w�new_h� trans_mat� affine_mat�results �(/usr/share/hplip/base/imageprocessing.py�rotate_imager= 4 s� � ���� �+�+�a�.�%�+�+�a�.�1�J�����*�-��1�2�L� �i�i� � � ��u�c� :�I�F��G� �)�)�G�A�a�C��1��H�$5�6�� �!�}�s�"�H��!�}�s�"�H� ���H�9�x�(� )�,?� ?�B�B�1�E� ���H�x�(� )�,?� ?�B�B�1�E� ���H�9�x�i�(� )�,?� ?�B�B�1�E� ���H�x�i�(� )�,?� ?�B�B�1�E� �N� !/�/�"��1��/�H�/� �*�1�A��E�Q�*�E�*� �*�1�A��E�Q�*�E�*� .�/�"��1��/�H�/� �*�1�A��E�Q�*�E�*� �*�1�A��E�Q�*�E�*��e�*�K��U��J��E� �I��E� �I���K�*�,�-�.�E���I� �)�*�+�E� � � � �A�s�5�3�;��)�*�+� �A�s�5�3�;��)�*�+��� �I� �)�)�I�&����7�);�;�Q�q�S�!�V�D�J� �^�^� �� ������ � �F� �M��E 0��*��*��/��*��*s<