Camera data correction method and device and nonvolatile storage medium

By acquiring the application requirements data of the camera, presetting the distortion type and matching the correction algorithm, the problem of complex camera data correction methods in the prior art resulting in large resource consumption and low efficiency is solved, and efficient and accurate image data correction is achieved.

CN119477769APending Publication Date: 2025-02-18E SURFING VISION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411495143.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-24
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

The existing camera data correction methods are too complex, resulting in high resource consumption and low efficiency, and cannot effectively solve the problem of image distortion.

Method used

By obtaining the application requirements data of the target camera, determining the requirement feature set, and presetting the distortion type and keywords based on the requirement feature set, quantifying the degree of impact of each distortion type on the business type, and matching the corresponding distortion correction algorithm for image data correction.

Benefits of technology

Efficient and accurate image data correction is achieved, resource consumption is reduced, correction efficiency is improved, and the accuracy and visual effect of image data is ensured.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119477769A_ABST
    Figure CN119477769A_ABST
Patent Text Reader

Abstract

The invention discloses a camera data correction method and device and a nonvolatile storage medium. The method comprises the steps that application demand data corresponding to a target camera are acquired, a demand feature set is determined according to the application demand data, and the application demand data comprise a service type and a correction target corresponding to the target camera; determining a demand type vector according to the demand feature set, a preset distortion type and a keyword corresponding to the preset distortion type; determining a distortion correction algorithm matched with the demand type vector, and correcting image data collected by the target camera by using the distortion correction algorithm; and carrying out distortion detection on the corrected image data so as to determine a correction quality index of the image data, and outputting the corrected image data under the condition that the correction quality index is determined to be not less than a preset index threshold value. The technical problems of high resource consumption and low efficiency caused by a complex correction method are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of camera data transmission, and in particular to a camera data correction method, device and non-volatile storage medium. Background Art

[0002] Image distortion is a significant issue in real-world applications. For example, in medical imaging, distortion in X-rays or MRI scans can cause doctors to misjudge the size or location of a lesion, affecting diagnosis and treatment planning. In addition, cameras used in driverless cars are also susceptible to lens distortion, which can cause the vehicle to misidentify the location of road signs or obstacles, affecting safe driving decisions. Therefore, for these applications, accurately understanding and correcting image distortion is a critical step to ensure system performance and accuracy. Image distortion has a significant impact on both accuracy and visual effects. It can cause shape distortions and distort spatial relationships in the image, making measurement and analysis difficult, while affecting the viewer's understanding and visual experience of the image. Therefore, it is crucial to effectively correct and manage distortion during image acquisition and processing. Existing correction methods are too comprehensive and complex, resulting in high correction resource consumption and low efficiency.

[0003] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention

[0004] The embodiments of the present application provide a camera data correction method, device and non-volatile storage medium to at least solve the technical problems of high resource consumption and low efficiency caused by the complexity of the correction method.

[0005] According to one aspect of an embodiment of the present application, a camera data correction method is provided, including: obtaining application requirement data corresponding to a target camera, and determining a requirement feature set based on the application requirement data, wherein the application requirement data includes a business type and a correction target corresponding to the target camera; determining a requirement type vector based on the requirement feature set, a preset distortion type and a keyword corresponding to the preset distortion type, wherein the requirement type vector is used to quantify the degree of influence of each preset distortion type on the business type corresponding to the target camera; determining a distortion correction algorithm that matches the requirement type vector, and correcting image data collected by the target camera using the distortion correction algorithm; performing distortion detection on the corrected image data to determine a correction quality index of the image data, and outputting the corrected image data when it is determined that the correction quality index is not less than a preset index threshold.

[0006] Optionally, the application requirement data includes application requirement text data; determining the requirement feature set based on the application requirement data includes: preprocessing the application requirement text data; converting the preprocessed application requirement text data into an application requirement vector using a bag-of-words model; clustering the application requirement vectors, and obtaining the requirement feature set based on the clustering results.

[0007] Optionally, preprocessing the application requirement text data includes: performing word segmentation on the application requirement text data and deleting stop words and special characters obtained after the word segmentation; converting the remaining words after the deletion into a preset form, wherein the words converted into the same preset form have the same semantics.

[0008] Optionally, using a bag-of-words model to convert preprocessed application requirement text data into an application requirement vector includes: establishing a vocabulary, wherein the vocabulary includes words converted into a preset form, and the number of occurrences of the words converted into the preset form; using the number of words in the vocabulary as the number of application requirement vectors, and using the number of occurrences of each word in the vocabulary as the element value in the application requirement vector, to obtain the application requirement vector.

[0009] Optionally, determining the demand type vector based on the demand feature set, the preset distortion type and the keywords corresponding to the preset distortion type includes: inputting the demand feature set into the demand assessment model, and obtaining the demand type vector output by the demand assessment model, wherein the demand assessment model is a back-propagation multi-layer feedforward neural network model, the demand assessment model includes an input layer and an output layer, the number of nodes in the input layer matches the dimension of the demand feature set, and the number of nodes in the output layer matches the dimension of the demand type vector.

[0010] Optionally, the elements in the demand type vector correspond one-to-one to the preset distortion types, and the values ​​of the elements are positively correlated with the degree of influence of the preset distortion type on the business type corresponding to the target camera; determining the distortion correction algorithm matching the demand type vector includes: determining the processing priority of each preset distortion type based on the demand type vector; determining the resource occupancy priority corresponding to each preset distortion type based on the processing priority, and determining the distortion correction algorithm corresponding to each preset distortion type based on the resource occupancy priority.

[0011] Optionally, the correction quality index includes at least one of the following: structural similarity index, peak signal-to-noise ratio, and mean square error.

[0012] According to another aspect of an embodiment of the present application, a camera data correction device is also provided, including: a first processing module, used to obtain application requirement data corresponding to a target camera, and determine a requirement feature set based on the application requirement data, wherein the application requirement data includes a business type and a correction target corresponding to the target camera; a second processing module, used to determine a requirement type vector based on the requirement feature set, a preset distortion type and a keyword corresponding to the preset distortion type, wherein the requirement type vector is used to quantify the degree of influence of each preset distortion type on the business type corresponding to the target camera; a third processing module, used to determine a distortion correction algorithm matching the requirement type vector, and use the distortion correction algorithm to correct image data collected by the target camera; a fourth processing module, used to perform distortion detection on the corrected image data, thereby determining a correction quality index of the image data, and outputting the corrected image data when it is determined that the correction quality index is not less than a preset index threshold.

[0013] According to another aspect of an embodiment of the present application, a non-volatile storage medium is further provided, in which a program is stored, wherein when the program is running, a device where the non-volatile storage medium is located is controlled to execute a camera data correction method.

[0014] According to another aspect of an embodiment of the present application, there is further provided an electronic device, including: a memory and a processor, wherein the processor is used to run a program stored in the memory, wherein the camera data correction method is executed when the program is run.

[0015] According to another aspect of an embodiment of the present application, a computer program product is also provided, including a computer program, and when the computer program is executed by a processor, a camera data correction method is implemented.

[0016] In an embodiment of the present application, application demand data corresponding to a target camera is obtained, and a demand feature set is determined based on the application demand data, wherein the application demand data includes a business type and a correction target corresponding to the target camera; a demand type vector is determined based on the demand feature set, a preset distortion type and a keyword corresponding to the preset distortion type, wherein the demand type vector is used to quantify the degree of influence of each preset distortion type on the business type corresponding to the target camera; a distortion correction algorithm matching the demand type vector is determined, and the distortion correction algorithm is used to correct the image data collected by the target camera; distortion detection is performed on the corrected image data to determine a correction quality index of the image data, and when it is determined that the correction quality index is not less than a preset index threshold, the corrected image data is output. This method is a comprehensive method for processing camera application demand data through a bag-of-words model, thereby achieving the purpose of accurately matching the distortion correction algorithm, thereby achieving the technical effect of efficiently and accurately correcting the distortion, and further solving the technical problems of high resource consumption and low efficiency caused by the complexity of the correction method. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0018] Figure 1 It is a structural schematic diagram of a computer terminal (mobile device) provided according to an embodiment of the present application;

[0019] Figure 2 is a flowchart of a camera data correction method provided according to an embodiment of the present application;

[0020] Figure 3 It is a structural schematic diagram of a camera data correction device provided according to an embodiment of the present invention. DETAILED DESCRIPTION

[0021] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0022] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0023] In the related art, there are the following problems:

[0024] 1. Some correction methods rely on complex mathematical models and algorithms, which consume a lot of computing resources, which may not perform well in real-time applications or resource-constrained environments;

[0025] 2. Existing methods may face the problem of reduced accuracy or low operating efficiency when processing large amounts of data, especially when processing high-resolution images or large-scale data sets, which may cause image delays;

[0026] 3. Different images have different problems and correction requirements, but the actual image distortion correction algorithms are often too comprehensive, resulting in a waste of computing power.

[0027] In order to solve the above problems, relevant solutions are provided in the embodiments of the present application, which are described in detail below.

[0028] According to an embodiment of the present application, a method embodiment of a camera data correction method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0029] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 1 FIG. 1 shows a hardware structure block diagram of a computer terminal (or mobile device) for implementing a camera data correction method. Figure 1 As shown, the computer terminal 10 (or mobile device 10) may include one or more (102a, 102b, ..., 102n are used to illustrate) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission module 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0030] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer terminal 10 (or mobile device). As described in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).

[0031] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the camera data correction method in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, the above-mentioned camera data correction method is realized. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0032] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0033] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 (or mobile device).

[0034] In the above operating environment, the embodiment of the present application provides a camera data correction method, such as Figure 2 As shown, the method comprises the following steps:

[0035] Step S202, obtaining application requirement data corresponding to the target camera, and determining a requirement feature set according to the application requirement data, wherein the application requirement data includes a business type and a correction target corresponding to the target camera;

[0036] Optionally, the application requirement data is subjected to text clustering based on a bag-of-words model to obtain a requirement feature set, wherein the application requirement data of the camera at least includes the business type and correction target in the image involved, and the bag-of-words model is a commonly used method for representing text in natural language processing. It regards text as an unordered set of words, ignores the order and grammatical structure of words in the text, and only focuses on the frequency of occurrence of each word; specifically, the bag-of-words model first establishes a vocabulary containing words that have appeared in all documents, and then represents the document by calculating the number of occurrences of each word in each document or using other statistics. It should be noted that for vectorizing the initial application requirement data, commonly used methods include the bag-of-words model and the word embedding model; the bag-of-words model regards the text as a set of words, and counts the number of occurrences or frequency of each word in the document, thereby constructing a feature vector of the document; this method is simple and intuitive, and is applicable to many tasks based on word frequency statistics, such as text classification and information retrieval; while the word embedding model (such as Word2Vec, GloVe, etc.) maps each word to a continuous vector space by learning the distributed representation of words in the context, thereby capturing the semantic relationship between words. This method can better express the meaning and semantic information of words, and is suitable for tasks that require understanding of semantic relationships, such as semantic search and recommendation systems. Choosing a suitable vectorization method depends on the specific application scenario and data characteristics to ensure that the vectorized data can effectively support subsequent analysis and application needs.

[0037] Optionally, the business type is used to indicate key elements or technical requirements that directly affect the image processing results and application effects; for example, for a security monitoring system, the business type may include the clarity and resolution of the image to ensure that details can be accurately captured to facilitate the identification and tracking of pedestrians or vehicles; in industrial inspection, the business type may involve the precise measurement of the geometry and size of the image to ensure that the product meets specifications and quality standards; in agricultural image processing, the business type may include the color and brightness adjustment of the image to support the application of precision agriculture technology, such as crop growth monitoring and fertilization optimization; in short, the business type points to those key technical requirements and data characteristics in various image processing applications, which directly determine the performance of the image processing system and the actual application effect.

[0038] Optionally, the correction target in the field of image processing refers to a specific goal or technical task achieved by processing and analyzing images; for example, in a security monitoring system, the correction target may include real-time detection and identification of abnormal behavior or specific objects to enhance safety and monitoring effects; in autonomous driving technology, the correction target may be the detection and identification of road signs, pedestrians, and vehicles to support vehicle autonomous navigation and obstacle avoidance; in quality inspection, the correction target may include detecting product defects, measuring dimensional accuracy and surface quality to ensure that the product meets quality standards; in short, the correction target describes the specific purpose or requirement achieved through image processing, and these goals directly guide and influence the design of image processing algorithms and the selection of application scenarios.

[0039] In the technical solution provided in step S202, the application requirement data includes application requirement text data; determining the requirement feature set based on the application requirement data includes: preprocessing the application requirement text data; converting the preprocessed application requirement text data into an application requirement vector using a bag-of-words model; clustering the application requirement vectors, and obtaining the requirement feature set based on the clustering results.

[0040] First, determine the number of clusters, that is, use all the mentioned keywords as the number of clusters. The keywords are the corresponding business types and correction targets affected by the principle of distortion type. They are words or phrases associated with each distortion type that have a significant impact on the image processing business type and correction target. These keywords describe the degree of influence of a specific distortion type on image quality, visual effects or functional requirements when processing images. All the influencing keywords corresponding to the distortion type are used as the number of clusters, and the business points and solution targets are represented as clusters of the clustering algorithm respectively. The bag-of-words representation is clustered based on K-means clustering to obtain the demand feature set for subsequent analysis and processing.

[0041] The K-means clustering uses Euclidean distance to measure the similarity between text vectors, specifically:

[0042]

[0043] In the formula, d(e i , e j ) is e i Text and e j The Euclidean distance of the text, n is the dimension of the text vector, e is ik is e in the k direction i A text value.

[0044] In the technical solution provided in step S202, the preprocessing of the application requirement text data includes: performing word segmentation on the application requirement text data, and deleting stop words and special characters obtained after the word segmentation; converting the remaining words after deletion into a preset form, where the words converted into the same preset form have the same semantics.

[0045] Optionally, the word segmentation process includes splitting the text into words or phrases and removing punctuation marks and special characters. Remove stop words from the application requirement data after the word segmentation process. Here, stop words refer to words that frequently appear in the text but contribute little to the text theme, such as "de", "he", "zai", etc. These words are often deleted in text analysis to reduce noise and improve efficiency. Special characters may include punctuation marks, numbers, symbols, etc. These are usually irrelevant to the text theme and also need to be filtered out. Converting the remaining words after deletion into a preset form includes performing stemming or lemmatization. Stemming is to simplify the word into its root form, and lemmatization is, on the basis of stemming, considering the semantics of the word and converting the word into its basic form (i.e., the preset form). For example, both "running" and "run" are converted to "run". This helps to ensure that words with the same semantics are uniformly processed in the model, improving the consistency of features and the effect of the model.

[0046] In the technical solution provided in step S202, converting the preprocessed application requirement text data into an application requirement vector using the bag-of-words model includes: establishing a vocabulary table, where the vocabulary table includes words converted into the preset form and the occurrence times of the words converted into the preset form; using the number of words in the vocabulary table as the number of elements in the application requirement vector, and using the occurrence times of each word in the vocabulary table as the element values in the application requirement vector to obtain the application requirement vector.

[0047] Optionally, for each document, the bag-of-words model creates a vector of a fixed length, and the vector length is equal to the size of the vocabulary table. Each position (i.e., index) in the vector corresponds to a word in the vocabulary table. Then, count the occurrence times of each word in the document. These frequency data will be filled into the corresponding vector positions. For example, if "clarity" in the vocabulary table is in the 10th position and "clarity" appears 3 times in the document, then the 10th element of the vector will be set to 3. Finally, we get a vector, where each element value represents the occurrence times of the corresponding word in the vocabulary table in the document. This application requirement vector is the representation of the document by the bag-of-words model.

[0048] The above steps use a text clustering method based on the bag-of-words model, which has the following benefits and advantages:

[0049] 1. Comprehensively capture demand information: Through word segmentation and stop word removal, the business types and correction targets of camera applications can be effectively extracted and sorted; this ensures that the clustering process can be based on comprehensive and accurate demand data;

[0050] 2. Simple and intuitive: The implementation of the bag-of-words model is relatively simple, easy to understand and deploy; it uses vocabulary and word frequency to represent text without considering grammatical structure and word order, and is suitable for most text clustering tasks;

[0051] 3. Adapt to diverse needs: All keywords are used as cluster numbers in the clustering process, ensuring that diverse needs are fully considered and processed; this method can effectively handle different types and quantities of business types and correction targets;

[0052] 4. Efficient processing of large amounts of data: Despite the need to process large amounts of text data and build large vocabularies, once vectorization is complete, subsequent clustering operations are usually efficient; the K-means clustering algorithm performs well when processing large amounts of data and can handle high-dimensional bag-of-words representations;

[0053] 5. Extract the demand feature set: The final set of demand feature sets reflects the similarities and correlations between different demands, and provides a basis and guidance for further demand analysis, product design or system optimization.

[0054] In summary, the text clustering method based on the bag-of-words model can effectively process the demand data of camera applications, extract and organize the key demand feature sets, and provide strong support for the subsequent division of requirements and the selection of appropriate distortion correction algorithms.

[0055] Step S204, determining a demand type vector according to the demand feature set, the preset distortion type and the keyword corresponding to the preset distortion type, wherein the demand type vector is used to quantify the influence of each preset distortion type on the service type corresponding to the target camera;

[0056] Optionally, the preset distortion types include radial distortion, tangential distortion and perspective distortion, and the keywords are words or phrases associated with each distortion type and having a significant impact on the image processing business type and correction target.

[0057] In the technical solution provided in step S204, determining the demand type vector based on the demand feature set, the preset distortion type and the keywords corresponding to the preset distortion type includes: inputting the demand feature set into the demand assessment model, and obtaining the demand type vector output by the demand assessment model, wherein the demand assessment model is a multi-layer feedforward neural network model of back propagation, and the demand assessment model includes an input layer and an output layer, the number of nodes in the input layer matches the dimension of the demand feature set, and the number of nodes in the output layer matches the dimension of the demand type vector.

[0058] Optionally, the demand assessment model includes a bp neural network algorithm model, including an input layer, a hidden layer, and an output layer;

[0059] The number of nodes in the input layer should correspond to the dimension of the required feature set; the number of nodes in the output layer should correspond to the number of preset distortion types (i.e., the dimension of the required type vector);

[0060] Initialize the bp neural network model to obtain an initialized demand assessment model;

[0061] Obtain image data of several cameras, obtain a required feature set of the image data of the cameras, and splice it with the distortion type corresponding to the keyword to obtain several training data;

[0062] The training data is input into the input layer, passed through the hidden layer, and output from the output layer. Back propagation is performed based on the preset loss function to adjust the weights and biases of the initialized demand assessment model, and continuous iteration and optimization are performed.

[0063] When the maximum number of iterations is reached or the loss function is minimized, the iteration is stopped and the trained model is obtained as the demand evaluation model;

[0064] The corresponding requirement type vectors include radial distortion, tangential distortion and perspective distortion and their corresponding vector values.

[0065] It should be noted that the calculation formulas for each layer are as follows:

[0066] f t =σ(W f ×[h t-1 ,x t +b f ])

[0067] i t =σ(W i ×[h t-1 ,x t +b i ])

[0068]

[0069] h t =0 t ⊙tanh

[0070] In the formula, f t Represents the activation value of the forgetting layer, which determines which information in the cell state needs to be forgotten, W f is the weight matrix of the forgetting layer, [h t-1 ,x t ] represents the concatenation of the hidden state of the previous time step and the input of the current time step, b f represents the bias vector of the forgetting layer, σ is the Sigmoid activation function, which limits the value between 0 and 1; i t Represents the activation value of the input layer, which determines how much of the current input information needs to be written into the cell state, W i Represented as the weight matrix of the input layer, b i Represented as the bias vector of the input layer; is the candidate cell state, indicating the candidate cell state of the current time step, W C Represented as the weight matrix of the candidate cell state, b C represents the bias vector of the candidate cell state, tanh represents the hyperbolic tangent activation function, and limits the value to between -1 and 1; C t represents the cell state at the current time step, C t-1 represents the cell state at the previous time step; o t Represents the activation value of the output layer, which determines how much of the cell state is output to the hidden state, W o Represented as the weight matrix of the output layer, b o is the bias vector of the output layer, and ⊙ is element-wise multiplication.

[0071] It should be noted that the size of the vector value is the importance of the impact of the distortion type on the target project.

[0072] Step S206, determining a distortion correction algorithm that matches the required type vector, and using the distortion correction algorithm to correct the image data collected by the target camera;

[0073] Optionally, the distortion correction algorithm includes polynomial distortion correction, homography correction, perspective distortion correction and lens distortion correction. Determining the distortion correction algorithm that matches the required type vector includes:

[0074] Polynomial distortion correction: When the radial distortion requirement is low, the polynomial used for polynomial distortion correction is simplified to first and second order to approximate the correction;

[0075] Perspective distortion correction: When the need for perspective distortion is high and the need for radial distortion and tangential distortion is low, horizontal or vertical perspective distortion is corrected by directly applying translation and scaling transformations instead of solving the full homography matrix;

[0076] Lens distortion correction: When the requirements for perspective distortion and tangential distortion are high and the requirements for radial distortion are low, the original pixel coordinates of the image data are corrected through a low-order Brown-Conrady model.

[0077] In the technical solution provided in step S206, the elements in the demand type vector correspond one-to-one to the preset distortion types, and the values ​​of the elements are positively correlated with the degree of influence of the preset distortion type on the business type corresponding to the target camera; determining the distortion correction algorithm matching the demand type vector includes: determining the processing priority of each preset distortion type according to the demand type vector; determining the resource occupancy priority corresponding to each preset distortion type according to the processing priority, and determining the distortion correction algorithm corresponding to each preset distortion type according to the resource occupancy priority.

[0078] Optionally, determining a distortion correction algorithm that matches the required type vector includes:

[0079] Polynomial distortion correction: When the radial distortion requirement is low, it is determined that the polynomial used for polynomial distortion correction is simplified to first and second orders for approximate correction;

[0080] Perspective distortion correction: When the need for perspective distortion is high and the need for radial distortion and tangential distortion is low, it is determined that horizontal or vertical perspective distortion is corrected by directly applying translation and scaling transformations instead of solving the full homography matrix;

[0081] Lens distortion correction: When the requirements for perspective distortion and tangential distortion are high and the requirements for radial distortion are low, it is determined that the original pixel coordinates of the image data are corrected through a low-order Brown-Conrady model.

[0082] Specifically, polynomial distortion correction: When the radial distortion requirement is low, the polynomial used for polynomial distortion correction is simplified to first-order and second-order to approximate the correction including:

[0083] Use first-order polynomials for linear distortion correction to adjust the overall scaling and translation of the image;

[0084] Use the second-order polynomial to increase finer adjustment capability based on the first-order to handle mild radial and tangential distortion;

[0085] The calculation formula of the first-order polynomial correction is as follows:

[0086]

[0087] The calculation formula of the second-order polynomial correction is as follows:

[0088]

[0089] In the formula, x crd is the x coordinate of the corrected image, y crd is the y coordinate of the corrected image, x is the horizontal coordinate of the uncorrected image, y is the vertical coordinate of the uncorrected image, U1 is the distortion correction parameter for controlling the first-order intensity, U2 is the distortion correction parameter for controlling the second-order intensity, and g is the distance from the pixel of the image to the optical center.

[0090] It should be noted that the distortion correction parameters affect both the degree and direction. The distortion correction parameters that control the first-order intensity affect the degree of first-order distortion and are usually used to adjust the overall magnification or reduction effect of the image. The distortion correction parameters that control the second-order intensity affect the degree of second-order distortion and are used to handle more complex radial distortions, such as circular deformation or stretching or compression of the center part.

[0091] Choosing a first-order or second-order polynomial for distortion correction depends on the specifics of the distortion and the requirements. A first-order polynomial is suitable for mild radial distortion and can quickly and effectively correct the entire image, while a second-order polynomial is suitable for more complex distortion situations, such as those that require fine adjustment or distortion in the center.

[0092] Through mathematical derivation or specific examples, it can be explained how to use the first-order or second-order polynomial formula to correct the image coordinates under the distortion correction parameters, so as to intuitively understand the effect and application scenarios of polynomial distortion correction.

[0093] Specifically, perspective distortion correction: When the requirement for perspective distortion is high and the requirement for radial distortion and tangential distortion is low, correcting horizontal or vertical perspective distortion by directly applying translation and scaling transformations instead of solving the full homography matrix includes:

[0094] Perform perspective distortion analysis on the image to determine the deformation of the plane objects in the image caused by the change of viewing angle, and observe the parallel lines and boundaries in the deformed part of the image;

[0095] Based on observing the parallel lines and boundaries in the deformed part of the image, the areas affected by perspective distortion are identified in the preprocessing stage;

[0096] By measuring the geometric shape and spatial position relationship of the region, the type and degree of perspective distortion in the image are determined.

[0097] Perspective distortion can be expressed by the homography matrix, specifically:

[0098]

[0099] Where H is the homography matrix, w cr d is the scaling factor in the normalized coordinate system.

[0100] Furthermore, lens distortion correction: when the requirements for perspective distortion and tangential distortion are high and the requirements for radial distortion are low, the original pixel coordinates of the image data are corrected through a low-order Brown-Conrady model, specifically:

[0101] Calculate the distance from each pixel to the center of distortion;

[0102] Calculate the radius after distortion correction according to the radial distortion model;

[0103] Calculate the corrected pixel coordinates using the tangential distortion model;

[0104] Apply the corrected pixel coordinates combined with the corrected radius to the image to complete the distortion correction;

[0105] The tangential distortion correction formula is as follows:

[0106]

[0107] In the formula, Δx crd is the amount of tangential distortion in the x direction, Δy crd is the amount of tangential distortion in the y direction, j1 and j2 are the tangential distortion coefficients, and r is the distance from the pixel to the center of distortion.

[0108] It should be noted that the advantage of polynomial distortion correction is that it can effectively correct the radial distortion produced by the camera lens, especially when the distortion requirement is relatively low; by simplifying the polynomial distortion model into first-order and second-order polynomials, the computational complexity and resource consumption in the correction process can be significantly reduced, thereby improving the real-time performance and efficiency of the correction; first-order and second-order polynomials can better approximate the radial distortion effects in most practical applications while maintaining sufficient correction accuracy, so that the correction results are still reliable and effective in visual tasks and measurement applications.

[0109] It should be noted that the benefit of perspective distortion correction is that it can effectively correct the distortion caused by the perspective effect when a camera or camcorder takes an image, especially when the requirements for perspective distortion are high but the requirements for radial and tangential distortion are low; by directly applying translation and scaling transformations, the correction process can be simplified, avoiding the calculation and application of complex homography matrices, thereby significantly improving the real-time and efficiency of the correction; using translation and scaling transformations for perspective distortion correction is usually suitable for distortion correction in the horizontal or vertical direction; this method not only reduces the computational cost, but also maintains a high correction accuracy, making perspective distortion correction easier and more practical in applications in fields such as visual navigation, architectural measurement, and virtual reality.

[0110] It should be noted that when highly accurate perspective and tangential distortion correction is required, but the demand for radial distortion is low, it is significantly advantageous to use a low-order Brown-Conrady model to correct the original pixel coordinates of the image data. The Brown-Conrady model is a commonly used distortion model that can effectively handle complex perspective and tangential distortion effects. At the same time, compared with high-order distortion models, it has lower computational cost and is easier to implement. Through the Brown-Conrady model, the perspective and tangential distortion in the image can be corrected by simple parameter adjustment. These parameters usually include the main perspective distortion parameters (such as focal length, principal point offset) and tangential distortion parameters (such as tangential distortion coefficients). During the correction process, there is no need to solve complex high-order polynomials or homography matrices, thereby reducing the computational burden and processing time, and improving real-time performance and processing efficiency.

[0111] This method is particularly suitable for application scenarios with high requirements for perspective distortion and tangential distortion, such as robot visual navigation, scene reconstruction in virtual reality, and camera tracking. It can ensure that the image data remains accurate and reliable during subsequent processing and analysis.

[0112] Step S208, performing distortion detection on the corrected image data to determine a correction quality index of the image data, and outputting the corrected image data when it is determined that the correction quality index is not less than a preset index threshold.

[0113] In the technical solution provided in step S208, the correction quality index includes at least one of the following: structural similarity index, peak signal-to-noise ratio, and mean square error.

[0114] Optionally, the correction quality indicator includes a structural similarity index (SSIM): SSIM is an indicator that measures the structural similarity of two images, which takes into account the brightness, contrast and structural information of the images. The value of SSIM usually ranges from -1 to 1, and the closer the value is to 1, the more similar the structures of the two images are. In the present application, SSIM is used to evaluate the structural similarity between the corrected image and the image before correction or with the ideal undistorted image. SSIM can more accurately reflect the human eye's perception of image quality by comparing the local structure of the image, and is suitable for evaluating the degree of improvement of the image structure by distortion correction.

[0115] Optionally, the correction quality indicator includes a peak signal-to-noise ratio (PSNR): PSNR is a commonly used indicator in image quality assessment, which is used to measure the noise and distortion of an image. It is calculated based on the mean square error (MSE), and the higher the PSNR value, the better the image quality. In this application, PSNR is used to quantify the difference between the corrected image and the reference image, which is suitable for evaluating the correction algorithm's ability to retain image details and the noise introduced during the correction process.

[0116] Optionally, the correction quality indicator includes peak signal-to-noise ratio mean square error (MSE): MSE is one of the most basic image quality assessment indicators, which measures the difference between two images by calculating the average square difference between their pixel values. The lower the MSE value, the more similar the two images are. MSE is used to directly quantify the difference in pixel values ​​between the corrected image and the image before correction or the ideal image. It is a simple and direct image similarity measurement method, which is suitable for evaluating the accuracy and effect of the distortion correction algorithm.

[0117] Optionally, the distortion detection of the corrected camera data further includes: dividing the image before correction and the image after correction into a plurality of regions respectively; calculating the gray level histogram of each region; measuring the similarity of the image histograms before and after correction based on the Bhattacharyya distance to obtain the correction quality;

[0118] The specific calculation method of the correction quality is as follows:

[0119]

[0120] Where ZL is the calibration mass, H before (i) is the histogram value of the image at the i-th gray level before correction, H after (i) is the histogram value of the corrected image at the i-th gray level.

[0121] Optionally, when the correction quality is greater than a preset quality threshold, it is considered that the corrected image data can be used to analyze the business point, and the corrected camera data is output to the output end; when the correction quality is less than the preset quality threshold, it is considered that the corrected image data cannot be used to analyze the business point, and further secondary correction is performed.

[0122] The correction quality is evaluated by performing distortion detection on the corrected camera data and using grayscale histogram and Bhattacharyya distance to ensure that the corrected image can accurately reflect the actual scene. Secondly, when the correction quality reaches the preset threshold, it automatically decides whether to output the corrected data to ensure that the data quality meets the business analysis requirements, thereby improving the efficiency and accuracy of data processing.

[0123] The above formulas are all dimensionless and numerical calculations. The formula is a formula for the most recent real situation obtained by collecting a large amount of data and performing software simulation. The preset parameters in the formula are set by technicians in this field according to actual conditions.

[0124] Through the above steps, a comprehensive method for processing camera application demand data using a bag-of-words model can be implemented; this method effectively extracts and classifies business points and solution goals from camera application requirements; through the bag-of-words model, firstly, word segmentation and stop words are removed, and then vectorization is performed to create a word frequency representation; these representations are clustered using the K-means algorithm to form clusters representing business points and solution goals; the Euclidean distance is used to ensure the similarity measurement between text vectors, and the clustering effect of similar requirements is optimized; this method not only simplifies the understanding and deployment of camera application requirements, but also effectively manages large-scale data. The above steps perform distortion detection on the corrected camera data, and use grayscale histograms and Bhattacharyya distances to evaluate the correction quality, so as to ensure that the image can accurately reflect the actual scene after correction; secondly, when the correction quality reaches a preset threshold, it automatically determines whether to output the corrected data to ensure that the data quality meets the business analysis requirements, thereby improving the efficiency and accuracy of data processing.

[0125] The present application embodiment provides a camera data correction device, Figure 3 is a schematic diagram of the structure of the device, such as Figure 3As shown, the device includes: a first processing module 30, which is used to obtain application demand data corresponding to the target camera, and determine a demand feature set based on the application demand data, wherein the application demand data includes a business type and a correction target corresponding to the target camera; a second processing module 32, which is used to determine a demand type vector based on the demand feature set, a preset distortion type and a keyword corresponding to the preset distortion type, wherein the demand type vector is used to quantify the degree of influence of each preset distortion type on the business type corresponding to the target camera; a third processing module 34, which is used to determine a distortion correction algorithm matching the demand type vector, and use the distortion correction algorithm to correct the image data collected by the target camera; a fourth processing module 36, which is used to perform distortion detection on the corrected image data, thereby determining a correction quality index of the image data, and output the corrected image data when it is determined that the correction quality index is not less than a preset index threshold.

[0126] In some embodiments of the present application, application requirement data includes application requirement text data; determining a requirement feature set based on the application requirement data includes: preprocessing the application requirement text data; converting the preprocessed application requirement text data into an application requirement vector using a bag-of-words model; clustering the application requirement vectors, and obtaining a requirement feature set based on the clustering results.

[0127] In some embodiments of the present application, the first processing module 30 preprocesses the application requirement text data, including: performing word segmentation on the application requirement text data, and deleting stop words and special characters obtained after the word segmentation; converting the remaining words after the deletion into a preset form, wherein the words converted into the same preset form have the same semantics.

[0128] In some embodiments of the present application, the first processing module 30 uses a bag-of-words model to convert preprocessed application requirement text data into an application requirement vector, including: establishing a vocabulary, wherein the vocabulary includes words converted into a preset form, and the number of occurrences of the words converted into the preset form; using the number of words in the vocabulary as the number of application requirement vectors, and using the number of occurrences of each word in the vocabulary as the element value in the application requirement vector, to obtain the application requirement vector.

[0129] In some embodiments of the present application, the second processing module 32 determines the demand type vector based on the demand feature set, the preset distortion type and the keyword corresponding to the preset distortion type, including: inputting the demand feature set into the demand assessment model, and obtaining the demand type vector output by the demand assessment model, wherein the demand assessment model is a multi-layer feedforward neural network model of back propagation, and the demand assessment model includes an input layer and an output layer, the number of nodes in the input layer matches the dimension of the demand feature set, and the number of nodes in the output layer matches the dimension of the demand type vector.

[0130] In some embodiments of the present application, the elements in the demand type vector correspond one-to-one to the preset distortion types, and the values ​​of the elements are positively correlated with the degree of influence of the preset distortion type on the business type corresponding to the target camera; determining the distortion correction algorithm that matches the demand type vector includes: determining the processing priority of each preset distortion type based on the demand type vector; determining the resource occupancy priority corresponding to each preset distortion type based on the processing priority, and determining the distortion correction algorithm corresponding to each preset distortion type based on the resource occupancy priority.

[0131] In some embodiments of the present application, the correction quality index includes at least one of the following: structural similarity index, peak signal-to-noise ratio, and mean square error.

[0132] It should be noted that the various modules in the above-mentioned camera data correction device can be program modules (for example, a set of program instructions that implement a certain specific function) or hardware modules. For the latter, it can be expressed in the following forms, but is not limited to this: the expression form of each of the above-mentioned modules is a processor, or the functions of each of the above-mentioned modules are implemented by a processor.

[0133] An embodiment of the present application provides a non-volatile storage medium, in which a program is stored, wherein when the program is running, the device where the non-volatile storage medium is located is controlled to execute the following camera data correction method: obtaining application requirement data corresponding to a target camera, and determining a requirement feature set based on the application requirement data, wherein the application requirement data includes a business type and a correction target corresponding to the target camera; determining a requirement type vector based on the requirement feature set, a preset distortion type and a keyword corresponding to the preset distortion type, wherein the requirement type vector is used to quantify the degree of influence of each preset distortion type on the business type corresponding to the target camera; determining a distortion correction algorithm matching the requirement type vector, and using the distortion correction algorithm to correct image data collected by the target camera; performing distortion detection on the corrected image data, thereby determining a correction quality index of the image data, and outputting the corrected image data when it is determined that the correction quality index is not less than a preset index threshold.

[0134] An embodiment of the present application provides an electronic device, comprising: a memory and a processor, the processor being used to run a program stored in the memory, wherein the following camera data correction method is executed when the program is running: obtaining application requirement data corresponding to a target camera, and determining a requirement feature set based on the application requirement data, wherein the application requirement data includes a business type and a correction target corresponding to the target camera; determining a requirement type vector based on the requirement feature set, a preset distortion type and a keyword corresponding to the preset distortion type, wherein the requirement type vector is used to quantify the degree of influence of each preset distortion type on the business type corresponding to the target camera; determining a distortion correction algorithm matching the requirement type vector, and using the distortion correction algorithm to correct image data collected by the target camera; performing distortion detection on the corrected image data, thereby determining a correction quality index of the image data, and outputting the corrected image data when it is determined that the correction quality index is not less than a preset index threshold.

[0135] An embodiment of the present application provides a computer program product, including a computer program, which implements the following camera data correction method when executed by a processor: obtaining application requirement data corresponding to a target camera, and determining a requirement feature set based on the application requirement data, wherein the application requirement data includes a business type and a correction target corresponding to the target camera; determining a requirement type vector based on the requirement feature set, a preset distortion type and a keyword corresponding to the preset distortion type, wherein the requirement type vector is used to quantify the degree of influence of each preset distortion type on the business type corresponding to the target camera; determining a distortion correction algorithm that matches the requirement type vector, and using the distortion correction algorithm to correct image data collected by the target camera; performing distortion detection on the corrected image data to determine a correction quality index of the image data, and outputting the corrected image data when it is determined that the correction quality index is not less than a preset index threshold.

[0136] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0137] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0138] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0139] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0140] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0141] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the relevant technology or all or part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk, etc. Various media that can store program codes.

[0142] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A camera data correction method, characterized in that: include: Acquire application requirement data corresponding to the target camera, and determine a requirement feature set according to the application requirement data, wherein the application requirement data includes a business type and a correction target corresponding to the target camera; Determine a demand type vector according to the demand feature set, the preset distortion type and the keyword corresponding to the preset distortion type, wherein the demand type vector is used to quantify the influence of each preset distortion type on the service type corresponding to the target camera; Determining a distortion correction algorithm that matches the required type vector, and using the distortion correction algorithm to correct image data collected by the target camera; The corrected image data is subjected to distortion detection to determine a correction quality index of the image data, and when it is determined that the correction quality index is not less than a preset index threshold, the corrected image data is output.

2. The camera data correction method according to claim 1, characterized in that: The application requirement data includes application requirement text data; and determining the requirement feature set based on the application requirement data includes: Preprocessing the application requirement text data; Using a bag-of-words model to convert the preprocessed application requirement text data into an application requirement vector; The application demand vectors are clustered, and the demand feature set is obtained according to the clustering result.

3. The camera data correction method according to claim 2, characterized in that: Preprocessing the application requirement text data includes: Performing word segmentation processing on the application requirement text data, and deleting stop words and special characters obtained after the word segmentation processing; The remaining words after the deletion are converted into a preset form, wherein the words converted into the same preset form have the same semantics.

4. The camera data correction method according to claim 3, characterized in that: Using the bag-of-words model to convert the preprocessed application requirement text data into an application requirement vector includes: Establishing a vocabulary, wherein the vocabulary includes words converted into the preset form and the number of occurrences of the words converted into the preset form; The application requirement vector is obtained by taking the number of words in the vocabulary as the number of the application requirement vector and taking the number of occurrences of each word in the vocabulary as the element value in the application requirement vector.

5. The camera data correction method according to claim 1, characterized in that: Determining a demand type vector according to the demand feature set, the preset distortion type and the keyword corresponding to the preset distortion type includes: The demand feature set is input into a demand assessment model, and a demand type vector output by the demand assessment model is obtained, wherein the demand assessment model is a back-propagation multi-layer feedforward neural network model, and the demand assessment model includes an input layer and an output layer, the number of nodes in the input layer matches the dimension of the demand feature set, and the number of nodes in the output layer matches the dimension of the demand type vector.

6. The camera data correction method according to claim 1, characterized in that: The elements in the demand type vector correspond to the preset distortion types one by one, and the values ​​of the elements are positively correlated with the degree of influence of the preset distortion type on the service type corresponding to the target camera; Determining a distortion correction algorithm that matches the requirement type vector includes: Determining the processing priority of each of the preset distortion types according to the demand type vector; The resource occupation priority corresponding to each of the preset distortion types is determined according to the processing priority, and the distortion correction algorithm corresponding to each of the preset distortion types is determined according to the resource occupation priority.

7. The camera data correction method according to claim 1, characterized in that: The correction quality index includes at least one of the following: structural similarity index, peak signal-to-noise ratio, and mean square error.

8. A camera data correction device, characterized in that: include: A first processing module is used to obtain application requirement data corresponding to a target camera, and determine a requirement feature set according to the application requirement data, wherein the application requirement data includes a business type and a correction target corresponding to the target camera; A second processing module is used to determine a demand type vector according to the demand feature set, the preset distortion type and the keyword corresponding to the preset distortion type, wherein the demand type vector is used to quantify the influence of each preset distortion type on the business type corresponding to the target camera; A third processing module, used to determine a distortion correction algorithm that matches the required type vector, and use the distortion correction algorithm to correct the image data collected by the target camera; The fourth processing module is used to perform distortion detection on the corrected image data to determine a correction quality index of the image data, and output the corrected image data when it is determined that the correction quality index is not less than a preset index threshold.

9. A non-volatile storage medium, characterized in that: The non-volatile storage medium stores a program, wherein when the program is running, the device where the non-volatile storage medium is located is controlled to execute the camera data correction method according to any one of claims 1 to 7.

10. An electronic device, characterized in that: include: A memory and a processor, wherein the processor is used to run a program stored in the memory, wherein the camera data correction method described in any one of claims 1 to 7 is executed when the program is run.

11. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the camera data correction method described in any one of claims 1 to 7 are implemented.