Panoramic image multi-path splicing and AES encryption system and method
Through the multi-channel stitching of panoramic images and AES encryption system, the problem that the existing technology cannot meet the multi-channel stitching and data encryption at the same time is solved, and efficient and secure panoramic image processing is achieved, which is suitable for a variety of application scenarios, including monitoring systems and virtualization Reality.
Patent Information
- Application Number
- CN202411143562.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-20
- Publication Date
- 2025-01-07
AI Technical Summary
Existing image processing software cannot meet the needs of multiple stitching and data encryption when processing panoramic images. The encryption algorithm is complex, and the key generation method and image encryption block size are single, making it difficult to ensure data while ensuring image processing speed. Security cannot adapt to efficient and secure image processing application scenarios such as surveillance systems, virtual reality, and medical images.
Provide a panoramic image multi-channel stitching and AES encryption system. Through reasonable system architecture and efficient algorithm design, it realizes efficient stitching and data security processing of panoramic images, including image input module, IP setting module, operation parameter setting module, parameter display Module, multiple image selection module, image operation module and image display module, supports multiple stitching parameters and encryption modes, adopts automatic or manual feature point registration, cylinder projection and pixel point fusion, uses AES symmetric encryption algorithm, supports local and the loading and saving of remote keys.
Significantly improve the efficiency and security of panoramic image processing, generate high-quality panoramic stitching images, reduce geometric distortion and stitching traces, ensure data security and reliability, and provide real-time performance evaluation functions, suitable for monitoring systems, virtual reality, Medical imaging and other areas that require efficient and secure image processing.
Smart Images

Figure CN119276472A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to a system and method for performing multi-functional preprocessing, splicing and encryption on multi-channel panoramic images. Background Art
[0002] With the development of image processing and data encryption technology, panoramic images have been widely used in monitoring, virtual reality, medical imaging and other fields. However, the image processing software currently on the market usually cannot meet the needs of multi-channel stitching and data encryption at the same time when processing panoramic images; secondly, these software also lack the optimization settings of stitching parameters, making it difficult to improve the stitching effect, such as the inability to customize the feature point calibration and image preprocessing required for stitching; in addition, the existing encryption algorithm is highly complex, and the key generation method and image encryption block size are single, making it difficult to ensure data security while ensuring image processing speed. This limitation makes it difficult for existing software to adapt to application scenarios such as monitoring systems, virtual reality, and medical imaging, which have strict requirements for efficient and secure image processing. Summary of the invention
[0003] The present invention provides a panoramic image multi-channel stitching and AES encryption system and related methods, which can achieve efficient stitching and data security processing of panoramic images through reasonable system architecture and efficient algorithm design, and provide users with a convenient and fast image processing solution.
[0004] The panoramic image multi-channel stitching and AES encryption system provided by the present disclosure mainly includes:
[0005] Image input module, used to load multi-channel panoramic image data;
[0006] The IP setting module is used for the uplink and downlink communication of the system, including: transmitting stitching parameters and generating keys to the remote server for remote stitching, encryption and decryption; transmitting the stitched panoramic image or encrypted image to the remote server for remote display or storage; and sending the image data to be stitched or the key from the remote server to the local for processing;
[0007] An operation parameter setting module is used to set image stitching parameters and encryption parameters;
[0008] Parameter display module, used to display the status and information of current parameter settings;
[0009] Parameter loading and saving module, used to save and load the parameters set by the user during the splicing process, as well as save the generated encryption key or load the local key;
[0010] A multi-channel image selection module is used to select which channels of images to be spliced and encrypted;
[0011] An image operation module, used to perform image preprocessing, adjacent image feature point registration, image stitching and / or AES image encryption and decryption on the selected multi-channel images according to the set or loaded operation parameters;
[0012] The image display module is used to display the original input image of each input channel, two adjacent images to be stitched, and the panoramic stitching image.
[0013] Further, the stitching parameters include: fusion width, input image length and width, stitching image length and width, input image field of view adjustment, zoom, roll, pitch angle, projection H matrix parameters, fusion mode, stitching acceleration mode, and one or more of adjacent image registration feature points; the fusion mode is used to set the pixel fusion weights of different areas; the stitching acceleration mode is set by adjusting the sampling interpolation rate;
[0014] The encryption parameters include: one or more of: key generation method, encrypted image block size setting, and AES encryption mode related parameters, wherein:
[0015] The key generation methods include: one or more of a fixed key, a random key, and a hash value key based on the image content; the size of the image encryption block ranges from 16 bytes to a maximum of 256 bytes; the AES encryption mode includes: one or more of AES-CBC, AES-OFB, AES-ECB, and AES-CFB.
[0016] Furthermore, the image operation module performs registration by automatically or manually selecting feature points of two adjacent images.
[0017] Furthermore, the image display module includes at least three display areas, which are respectively used to display the following contents:
[0018] The reduced original input image of each input channel;
[0019] The reduced final panoramic stitched image or encrypted image;
[0020] Enlarged custom two adjacent images for manual selection of image registration feature points; or enlarged panoramic stitching image.
[0021] Furthermore, the system further comprises: an image output module and / or an operation time recording module, wherein:
[0022] Image output module, used to save the stitched panoramic image or encrypted image and specify the output file name and location;
[0023] The operation time module is used to record the time consumption of the splicing or encryption process and provide real-time performance evaluation and optimization reference.
[0024] An image stitching method for the above system comprises the following steps:
[0025] Stitching parameter setting: Set the stitching parameters according to the requirements, including fusion width, stitching speed, and fusion mode; in addition, automatically or manually select feature points of adjacent images for registration;
[0026] Calculation and registration of global coordinates of reference points: Calculation and registration of relative positions of multiple images based on the selected reference point coordinates;
[0027] Coordinate transformation: Based on the matched feature points, perform cylindrical projection on each image and map each pixel point to the global cylindrical coordinate system. The projection formula is as follows:
[0028]
[0029] The above formula converts the original image coordinates (x, y) into cylindrical coordinates (θ, h);
[0030] Fusion of global coordinate reference points and pixels: Based on the global coordinate reference points, pixel fusion is performed on multiple images, where the weight is calculated based on the distance of each pixel from the reference point. The closer the distance to the reference point, the greater the weight. Then, based on the weight, the pixel values of the pixels to be fused are weighted averaged to achieve seamless splicing.
[0031] An AES image encryption and decryption method for the above system mainly includes the following steps:
[0032] Generate a key and an initial vector IV. IV is used to ensure that the same plaintext produces a different ciphertext each time it is encrypted.
[0033] Encryption block size setting;
[0034] Encryption and decryption mode settings;
[0035] Generate the corresponding ciphertext according to the set encryption and decryption mode; or use the same key and initial vector for decryption.
[0036] Compared with the prior art, the beneficial effects of the present disclosure are as follows: (1) the software system provided integrates a variety of image processing and encryption functions, adopts efficient algorithms and optimized processing procedures, and can quickly complete the preprocessing, splicing, encryption, and decryption of multiple images, significantly improving the efficiency and security of panoramic image processing, and providing users with a better user experience and a wider range of application scenarios;
[0037] (2) Through automatic and manual feature point registration, cylindrical projection, and pixel fusion, the system can generate high-quality panoramic stitching images with reduced geometric distortion and stitching artifacts;
[0038] (3) Adopts AES symmetric encryption algorithm, supports multiple encryption modes and key generation methods, and ensures data security and reliability;
[0039] (4) The system supports loading and saving local and remote keys. Users can choose different key management methods according to their needs, which enhances the flexibility and security of the system.
[0040] (5) The system provides real-time performance evaluation function, and users can monitor the time consumption of splicing and encryption process in real time, which is convenient for performance optimization and adjustment;
[0041] (6) The system is not only suitable for monitoring systems, virtual reality, and medical imaging, but can also be applied to other fields that require efficient and safe image processing, such as drone aerial photography, geographic information systems, and construction engineering. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] The above and other objects, features and advantages of the present disclosure will become more apparent through a more detailed description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, wherein like reference numerals generally represent like components throughout the exemplary embodiments of the present disclosure.
[0043] Figure 1 The system software startup interface of the exemplary embodiment, a is the overall interface, b is the enlarged parameter setting part interface;
[0044] Figure 2 is an overall framework diagram of an exemplary system;
[0045] Figure 3 It is the software image display area;
[0046] Figure 4 For system software splicing and encryption and decryption processes;
[0047] Figure 5 To complete the effect of splicing for system software;
[0048] Figure 6 To encrypt the system software to achieve the effect;
[0049] Figure 7 Decryption completion effect for system software;
[0050] Figure 8 The system software decryption fails when the loaded key is different from the generated key. DETAILED DESCRIPTION
[0051] The preferred embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the preferred embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to make the present disclosure more thorough and complete, and to fully convey the scope of the present disclosure to those skilled in the art.
[0052] Since existing image processing software has certain limitations in panoramic image stitching, multi-function preprocessing and data security, it often cannot meet multiple stitching encryption requirements at the same time. Therefore, the present disclosure provides a panoramic image multi-channel stitching and AES encryption processing software system, which can realize the two key technologies of image panoramic stitching and encryption. The software has the ability to stitch multiple images with different shooting angles into a complete panoramic image and display them in the screen area, and supports multiple key generation methods and AES encryption modes for encryption and decryption. Users can choose to automatically or manually rotate, translate, align and fuse images to generate high-quality panoramic stitching images, and finally encrypt them with AES.
[0053] In an exemplary embodiment, the interface when the system software is started is as shown in the attached Figure 1 As shown, the current state is set to 8-way image stitching and panoramic image encryption.
[0054] 1. System architecture
[0055] In this embodiment, the overall framework of the system is shown in the attached figure. Figure 2 As shown, a layered architecture is adopted, which is divided into data layer, processing layer and display layer. The modules set in each layer include: image input module, IP setting module, image display module, operation parameter setting module, parameter display module, parameter loading and saving module, image operation module, multi-channel image selection module, image output module, operation time recording module, etc. Among them:
[0056] The data layer consists of image input modules, which are mainly responsible for storing and managing data. In this system, image data is the core data;
[0057] The processing layer is responsible for data processing and business logic. In this system, IP setting, splicing parameter setting, encryption parameter setting, splicing parameter display, splicing encryption parameter loading and saving, image operation, multi-channel image selection, operation time recording and other functional modules all belong to data processing and business logic;
[0058] The presentation layer is responsible for interacting with users. In this system, image display and image output are the main ways of interacting with users, so it mainly includes image display module, image output module and parameter display module.
[0059] The system software is developed using Visual Studio, with C++ as the main language, and the image processing library is mainly implemented by OpenCV and OpenSSL.
[0060] 2. System core module design
[0061] 2.1 Image Input Module
[0062] The image input module is responsible for obtaining image data from various sources, such as multiple cameras or local file systems for storing images. It uses the Opencv interface, supports multi-format image conversion, and reduces the source image by a certain ratio according to the number of input images and pushes it to the image display module;
[0063] 2.2IP Setting Module
[0064] The IP setting module is responsible for the uplink and downlink communications of the system software. Considering the lightweight and real-time characteristics of the UDP protocol, this module uses the UDP protocol to establish a connection and implements the following functions:
[0065] (1) Downlink communication: Transmit stitching parameters and generate keys to the remote server for remote stitching and AES encryption and decryption; transmit the stitched panoramic image or encrypted image to the remote server for remote display or storage.
[0066] (2) Uplink communication: The image data or key to be stitched is sent from the remote server to the local server for processing.
[0067] The communication process of the IP setting module is as follows: establish a UDP connection between the local and remote servers; send data as needed; the receiver receives the data and processes it; and finally disconnect the UDP connection. The IP setting module provides the following parameter settings: the IP address of the local server, the IP address of the remote server, the port number of the UDP protocol, and the maximum size of the UDP data packet.
[0068] 2.3 Image Display Module
[0069] The image display module contains three display areas, which are used to display the following contents in order from top to bottom:
[0070] (1) The original input image after reduction.
[0071] (2) Enlarged stitched image (supports displaying different areas of the panoramic stitched image through a slider or drag function), or enlarged custom adjacent two images (used to select custom feature points).
[0072] (3) The reduced final panoramic stitched image or encrypted image.
[0073] Display area such as Figure 3 As shown (taking 8-channel image stitching as an example).
[0074] 2.4 Operation parameter setting module
[0075] The operation parameter setting module allows users to set stitching parameters and AES encryption parameters. Stitching parameters include fusion width, input image length and width, stitching image length and width, input image field of view adjustment, zoom, roll, pitch angle, projection H matrix parameters, fusion mode, stitching acceleration mode, custom feature point selection (identifying adjacent image feature points through image magnification area), etc. AES encryption parameters include key generation method, encrypted image block size setting, AES encryption mode related parameters, etc.
[0076] 2.5 Parameter display module
[0077] In the designated area, the parameter display module displays the parameter values used in the current stitching process in real time with floating point numbers so that users can understand the processing process, including fusion width, input image length and width, stitching image length and width, input image field of view adjustment, zoom, roll, pitch angle, projection H matrix parameters, fusion mode, stitching acceleration, etc., as well as parameter size input box.
[0078] 2.6 Parameter loading and saving module
[0079] The parameter loading and saving module allows users to save and load the parameters used in the stitching process in text file (.txt) format, as well as save the generated encryption key or load the local key for reuse or sharing settings, and can specify parameters uplink and downlink via the UDP protocol. Parameters are read in and written out in a predefined format, including but not limited to the following: adjacent image reference point position, camera focal length, input image scaling and rotation, H matrix parameters, fusion width, encryption key, initialization vector, etc.
[0080] 2.7 Image Operation Module
[0081] (1) Provide image preprocessing function: The system supports operations such as zooming, translation, pitching, and rotation to optimize the image stitching process. Users can choose to automatically or manually select feature points of two adjacent images for registration.
[0082] (2) Provide image stitching function: After inputting the image and setting the stitching parameters, the user only needs to click the "Stitching" button in the main function area to start the stitching process.
[0083] (3) Provide image encryption / decryption function: After the image stitching is completed, the user can customize three key generation modes: fixed key, random key, and hash value key based on image content. The user can also read the specified key file locally as the master key. The system supports four mainstream AES encryption modes: AES-CBC, AES-OFB, AES-ECB and AES-CFB, and allows users to select image encryption blocks from 16 bytes to a maximum of 256 bytes (the system uses a random key and 16-byte AES-CBC encryption mode by default). After the parameters are set, the user only needs to click the "Encrypt" button in the main function area to start image encryption, and click the "Decrypt" button to start image decryption. Figure 4 The system software splicing and encryption and decryption processes are shown in detail.
[0084] 2.8 Multi-channel image selection module
[0085] The multi-channel image selection module allows users to select the image channel to be operated from multiple input images for local or global image processing. Each operation channel is distinguished by a different input identifier, so that users can easily select and operate the required image channel as needed. This flexibility enables users to perform targeted processing in multi-channel image data to better meet the needs of various application scenarios.
[0086] 2.9 Image Output Module
[0087] The Image Output module allows users to save stitched panoramic images or encrypted images. Users can specify the saved file name and output it to the target location. This feature not only provides flexible naming options, but also allows users to save the results to the target location of their choice for subsequent use or sharing. With this feature, users can easily save the original stitched panoramic image or encrypted image for subsequent use and sharing.
[0088] 2.10 Operation time recording module
[0089] After clicking the "Stitching" button, the operation time module will record the time consumption of the stitching process and push the time data to the specified area in real time. After the stitching is completed, the area will display the "map over" prompt, providing a reference for performance evaluation and optimization. Similarly, after clicking the "Encrypt" or "Decrypt" button to complete the image encryption or decryption, the area will display the "encrypt over" and "decrypt over" prompts and the corresponding time consumption respectively. This functional module not only enables users to understand the time consumed by the stitching and encryption and decryption processes in real time, but also provides them with reference indicators for evaluating performance and optimizing.
[0090] 3. Algorithm and encryption process
[0091] This system mainly includes two core algorithms, namely, multi-channel panoramic image stitching algorithm and AES-based symmetric encryption and decryption algorithm. The specific introduction is as follows:
[0092] 3.1 Implementation process of multi-channel panoramic image stitching algorithm
[0093] (1) Image preprocessing: First, users can perform preprocessing operations on the images of the specified channel according to their needs, including image scaling, translation, pitch, and rotation. The degree of operation is determined by the values entered by the user, and the algorithm processes the image accordingly based on these values to optimize the subsequent stitching effect.
[0094] (2) Stitching parameter setting: Users can set stitching parameters according to their needs, including fusion width, stitching speed (by adjusting the sampling interpolation rate), fusion mode (using pixel fusion weights in different areas), etc. In addition, users can choose to automatically or manually select feature points of two adjacent images for registration to improve stitching accuracy.
[0095] (3) Calculation and alignment of global coordinates of reference points: Calculate and align the relative positions of multiple images based on the coordinates of the reference points selected by the user.
[0096] (4) Coordinate transformation: Based on the matched feature points, perform cylindrical projection on each image and map each pixel into the global cylindrical coordinate system. This step reduces the geometric distortion during the stitching process and makes the stitched panoramic image more natural. The projection formula is as follows:
[0097]
[0098] The above formula converts the original image coordinates (x, y) into cylindrical coordinates (θ, h).
[0099] (5) Fusion of global coordinate reference points and pixels: Based on the global coordinate reference point, pixel fusion is performed on multiple images. The weight is calculated based on the distance of each pixel from the reference point. The closer the distance to the reference point, the greater the weight. Then, based on the weight, the pixel values of the pixels to be fused are weighted averaged to achieve seamless splicing.
[0100] 3.2AES encryption and decryption algorithm implementation process
[0101] 3.2.1 Key Generation
[0102] (1) Fixed key generation: that is, using the system preset 16-byte fixed key.
[0103] (2) Random key generation: The system uses a pseudo-random number generator to generate a random 16-byte sequence as the key through the OpenSSL library function RAND_bytes. Similarly, it uses it to generate a random 16-byte initialization vector IV to enhance encryption.
[0104] (3) Hash key generation based on image content: The system uses a hash function method to map image content to a key. The specific steps are as follows:
[0105] ① Loading image data: First, load the panoramic stitching image data that needs to be encrypted.
[0106] ② Calculate the hash value of the image: 1. Initialize the SHA-256 hash algorithm context: Create a SHA-256 algorithm instance and prepare to start hash calculation. 2. Input image data: Input the image data into the SHA-256 algorithm and update the hash context. 3. Calculate the SHA-256 hash value: After processing the image data, calculate and obtain the SHA-256 hash value of the image.
[0107] ③Generate AES key and IV: 1. Extract AES key: Extract the AES key from the first 16 bytes of the SHA-256 hash value. 2. Extract the initial vector (IV): Extract the initial vector (IV) from the last 16 bytes of the SHA-256 hash value.
[0108] ④ Output key and IV: The generated key and IV will be used for subsequent encryption and decryption operations.
[0109] In the encryption process, the initialization vector (IV) is a key technology to enhance the strength of the algorithm. IV is a random number of fixed length, which is used together with the key to initialize the encryption algorithm. The main function of IV is to ensure that the same plaintext produces different ciphertext each time it is encrypted, thereby improving the security of the password. If the same key and IV are used for each encryption, the ciphertext may be the same even if the plaintext is different, making it vulnerable to attacks.
[0110] Usually, the length of IV is the same as the block size, for example, the IV length of AES algorithm is 128 bits (16 bytes). During encryption and decryption, IV must be passed along with the key and kept consistent during encryption and decryption. In encrypted communication, IV is usually sent to the recipient along with the ciphertext for decryption. The recipient uses the same IV and key to restore the plaintext during decryption.
[0111] 3.2.2 Encryption block size setting
[0112] In this system software, users can select the block size of the AES encryption algorithm, which supports selections from 16 bytes to 256 bytes. Among them, the 16-byte block size is usually the default block size of the AES algorithm, which has high execution efficiency and encryption performance and is suitable for most application scenarios. In some specific scenarios, appropriately increasing the block size can improve encryption speed and efficiency, but it may also increase system resource consumption. For encryption processing of large-scale data, choosing a larger block size may improve encryption efficiency, but it may also increase memory usage and computing burden, which requires a trade-off.
[0113] 3.2.3 Encryption and decryption mode settings and ciphertext generation
[0114] This system supports four mainstream AES encryption and decryption modes, namely AES-CBC, AES-OFB, AES-ECB and AES-CFB.
[0115] (1)AES-CBC (Cipher Block Chaining)
[0116] Each plaintext block is XORed with the previous ciphertext block before being encrypted:
[0117] ① The initial vector IV is XORed with the first plaintext block P1:
[0118]
[0119] ② Each subsequent plaintext block P i With the previous ciphertext block C i-1 Perform an XOR operation:
[0120]
[0121] (2) AES-OFB (Output Feedback)
[0122] Use the output of the encryption algorithm as the input for the next plaintext block, suitable for stream ciphers:
[0123] ① The initial vector IV is input as the first encryption block:
[0124] O1=E k (IV)
[0125] ② Each plaintext block P i With output block O i Perform an XOR operation:
[0126]
[0127] ③Output block O i As the next input block:
[0128] O i+1 =E k (O i )
[0129] (3)AES-ECB (Electronic Codebook)
[0130] That is, using each plaintext block P i Independent encryption:
[0131] C i =E k (P i )
[0132] (4) AES-CFB (Cipher Feedback)
[0133] Take the previous ciphertext block as the input of the next plaintext block, and XOR it with the current plaintext block after encryption:
[0134] ① The initial vector IV is input as the first encryption block:
[0135] O1=E k (IV)
[0136] ② Each plaintext block P i With output block O i Perform an XOR operation:
[0137]
[0138] ③Ciphertext block C i As the next input block:
[0139] O i+1 =E k (C i )
[0140] Through the above encryption parameter settings, AES flexible encryption based on panoramic stitching images can be completed. Since AES is a symmetric encryption algorithm, the same key and initial vector are used for decryption, so the decryption process is similar to the encryption step. Through the above detailed description, panoramic image stitching and AES encryption algorithms are efficiently implemented, and flexible parameter settings and operation options are provided in a user-friendly interface.
[0141] 4. User interface and operation process
[0142] (1) Preparation: The user installs the system software and prepares the multi-channel images to be spliced and encrypted.
[0143] (2) Software settings: After the user opens the software, enter the main interface. Under "Image loading", click the "Load saved image" button. Then, select the multiple input images to be loaded in the specified path. After successful loading, the input images will be displayed in the following areas: "Channel 1", "Channel 2", "Channel 3", "Channel 4", "Channel 5", "Channel 6", "Channel 7", and "Channel 8" image display areas. In this way, the user can intuitively view the image data obtained by each channel.
[0144] (3) Parameter settings: The software startup panel provides the specific names of various parameters and parameter value input, including fusion width ("fusion width"), input image length and width ("small image length", "small image width"), stitching image length and width ("large image length", "large image width"), various rotation and scaling functions of the input image, corresponding to left and right rotation ("rotation"), scaling ("scaling"), translation ("roll"), up and down rotation ("pitch angle"), projection H matrix parameters (a total of nine projection parameters from "H00" to "H22"), stitching mode selection ("gradual fusion" or "half-value fusion"), stitching acceleration multiples ("acceleration 1", "acceleration 2" After the user selects a channel (select one from "1", "2", "3", "4", "5", "6", "7", "8" in "Image Channel Selection"), he can click the corresponding parameter operation button. Then, the user can select the parameter value for parameter import (for example, "10", "1", "0.1", "0.01"), or adjust the parameter through the "Increase" or "Decrease" button. In addition, the user can also import locally saved parameters for fast parameter assignment, which is achieved through the "Load Parameters" function. If the user does not set the stitching parameters, this system software will use the built-in default parameters for stitching.
[0145] (4) Start stitching: After the stitching parameters are set, the user can click the stitching button to start stitching. During the stitching process, the stitching time will be displayed in real time in the specific display area of the software so that the user can understand the time consumption of the stitching process.
[0146] (5) Stitching completed: After stitching is completed, the software's specific display area will display a "map over" prompt, indicating that the stitching has been successfully completed. At the same time, the software display area will present an enlarged stitched image and a reduced final panoramic stitched image. Users can view the panoramic stitched image of different areas by dragging the slider to observe the stitching effect and conduct detailed inspections. Figure 5 It shows the effect when the software stitching is completed.
[0147] (6) Adjusting parameters: If the stitching effect is not satisfactory, the user can re-stitch by adjusting the parameter settings. In addition, the user can also customize the selection of adjacent feature points. The specific operation is as follows: the user clicks the "Reference Point 1" button, and the software will enter the feature point selection mode; the central display area will present a large picture of the adjacent images of the selected image channel; the user uses the mouse to mark a pair of reference points of the adjacent images; click the "Reference Point 1" button again to calibrate the selected reference points; after adjusting the parameters, the user can click the stitching button again to stitch.
[0148] (7) Parameter saving and downloading: After the splicing is completed, the user can perform the following operations: Save parameters, that is, the user can click the "Save parameters" button to save the current splicing parameters to a local file; Parameter download: The user can download the splicing parameters through UDP, and click the "Parameter download" button to send the splicing parameters to the specified remote server. Under "IP settings", the user needs to set the following parameters: local IP, remote IP, port number. After the settings are completed, the user clicks "UDP distributed connection" to establish a connection and realize the transmission of parameters.
[0149] (8) Image encryption and decryption: After the stitching is completed, the user can select the key generation mode, image encryption mode, and image encryption block size according to the button text prompts of the system software to perform encryption in different modes. Taking the 16-byte AES-CBC encryption mode of random value as an example, after clicking the "Encrypt" button, the encryption effect is as follows Figure 6 After clicking the "Decrypt" button, it can be decrypted into the original panoramic mosaic. The decryption effect is as follows Figure 7 shown.
[0150] (9) Key preservation: The system software supports loading different local keys or downloading remote keys via UDP, and can save the currently generated keys. When the same key is used for encryption and decryption, the system can complete image decryption normally; if the keys used for encryption and decryption are inconsistent, the system will not be able to display the original panoramic stitching image. Figure 8 Shows the effect of decryption failing when the keys do not match.
[0151] The above technical scheme is only an exemplary embodiment of the present invention. For those skilled in the art, it is easy to make various types of improvements or modifications based on the application methods and principles disclosed in the present invention, and it is not limited to the method described in the above specific embodiment of the present invention. Therefore, the method described above is only preferred and does not have a restrictive meaning.
Claims
1. A panoramic image multi-channel stitching and AES encryption system, characterized in that: include: Image input module, used to load multi-channel panoramic image data; The IP setting module is used for the uplink and downlink communication of the system, including: transmitting stitching parameters and generating keys to the remote server for remote stitching, encryption and decryption; transmitting the stitched panoramic image or encrypted image to the remote server for remote display or storage; and sending the image data to be stitched or the key from the remote server to the local for processing; An operation parameter setting module is used to set image stitching parameters and encryption parameters; Parameter display module, used to display the status and information of current parameter settings; Parameter loading and saving module, used to save and load the parameters set by the user during the splicing process, as well as save the generated encryption key or load the local key; A multi-channel image selection module is used to select which channels of images to be spliced and encrypted; An image operation module, used to perform image preprocessing, adjacent image feature point registration, image stitching and / or AES image encryption and decryption on the selected multi-channel images according to the set or loaded operation parameters; The image display module is used to display the original input image of each input channel, two adjacent images to be stitched, and the panoramic stitching image.
2. The system according to claim 1, characterized in that The stitching parameters include: fusion width, input image length and width, stitching image length and width, input image field of view adjustment, zoom, roll, pitch angle, projection H matrix parameters, fusion mode, stitching acceleration mode, and one or more of adjacent image registration feature points; the fusion mode is used to set the pixel fusion weights of different areas; the stitching acceleration mode is set by adjusting the sampling interpolation rate; The encryption parameters include: one or more of: key generation method, encrypted image block size setting, and AES encryption mode related parameters, wherein: The key generation methods include: one or more of a fixed key, a random key, and a hash value key based on the image content; the size of the image encryption block ranges from 16 bytes to a maximum of 256 bytes; the AES encryption mode includes: one or more of AES-CBC, AES-OFB, AES-ECB, and AES-CFB.
3. The system according to claim 1, characterized in that The image operation module automatically or manually selects feature points of two adjacent images for registration.
4. The system according to claim 3, characterized in that The image display module includes at least three display areas, which are used to display the following contents: The reduced original input image of each input channel; The reduced final panoramic stitched image or encrypted image; Enlarged custom two adjacent images for manual selection of image registration feature points; or enlarged panoramic stitching image.
5. The system according to any one of claims 1 to 4, characterized in that: Also includes: An image output module and / or an operation time recording module, wherein: Image output module, used to save the stitched panoramic image or encrypted image and specify the output file name and location; The operation time module is used to record the time consumption of the splicing or encryption process and provide real-time performance evaluation and optimization reference.
6. An image stitching method for the system according to any one of claims 1 to 5, comprising the following steps: Stitching parameter setting: Set the stitching parameters according to the requirements, including fusion width, stitching speed, and fusion mode; in addition, automatically or manually select feature points of adjacent images for registration; Calculation and registration of global coordinates of reference points: Calculation and registration of relative positions of multiple images based on the selected reference point coordinates; Coordinate transformation: Based on the matched feature points, perform cylindrical projection on each image and map each pixel point to the global cylindrical coordinate system. The projection formula is as follows: The above formula converts the original image coordinates (x, y) into cylindrical coordinates (θ, h); Fusion of global coordinate reference points and pixels: Based on the global coordinate reference points, pixel fusion is performed on multiple images, where the weight is calculated based on the distance of each pixel from the reference point. The closer the distance to the reference point, the greater the weight. Then, based on the weight, the pixel values of the pixels to be fused are weighted averaged to achieve seamless splicing.
7. An AES image encryption and decryption method for the system according to any one of claims 1 to 5, comprising the following steps: Generate a key and an initial vector IV. IV is used to ensure that the same plaintext produces a different ciphertext each time it is encrypted. Encryption block size setting; Encryption and decryption mode settings; Generate the corresponding ciphertext according to the set encryption and decryption mode; or use the same key and initial vector for decryption.
8. The method according to claim 7, characterized in that The step of generating the key and the initial vector IV includes any one of the following three methods: a. Fixed key generation: Use the system preset 16-byte fixed key; b. Random key generation: The system uses a pseudo-random number generator to generate a random 16-byte sequence as the key through the OpenSSL library function RAND_bytes. Similarly, it uses it to generate a random 16-byte initialization vector IV to enhance encryption; c. Hash key generation based on image content: A hash function that maps image content to a key is used. The specific steps include: c1, load image data: load the panoramic stitching image data that needs to be encrypted; c2, calculates the hash value of the image, including: Initialize the SHA-256 hash algorithm context; Create a SHA-256 algorithm instance and prepare to start hash calculation; Input image data: Input the image data into the SHA-256 algorithm and update the hash context; Calculate SHA-256 hash value: After processing the image data, calculate and get the SHA-256 hash value of the image; c3, generate AES key and IV, specifically including: extract AES key: extract AES key from the first 16 bytes of SHA-256 hash value; extract initial vector IV: extract initial vector IV from the last 16 bytes of SHA-256 hash value; c4, output key and IV: The generated key and IV are used for subsequent encryption and decryption operations.
9. The method according to claim 7, characterized in that: The step of generating corresponding ciphertext according to the set encryption and decryption mode specifically includes: (1) AES-CBC mode Each plaintext block is XORed with the previous ciphertext block before being encrypted: ① The initial vector IV is XORed with the first plaintext block P1: ② Each subsequent plaintext block P i With the previous ciphertext block C i-1 Perform an XOR operation: (2) AES-OFB mode Use the output of the encryption algorithm as the input for the next plaintext block, suitable for stream ciphers: ① The initial vector IV is input as the first encryption block: O1=E k (IV) ② Each plaintext block P i With output block O i Perform an XOR operation: ③Output block O i As the next input block: THE i+1 =And k (THE i ); (3) AES-ECB mode That is, using each plaintext block P i Independent encryption: C i =E k (P i ); (4) AES-CFB mode Take the previous ciphertext block as the input of the next plaintext block, and XOR it with the current plaintext block after encryption: ① The initial vector IV is input as the first encryption block: O1=E k (IV) ② Each plaintext block P i With output block O i Perform an XOR operation: ③Ciphertext block C i As the next input block: THE i+1 =And k (W i ) By setting the above encryption parameters, AES encryption based on panoramic stitching images can be completed.