Image feature extraction method and system based on target detection and perspective change
Through the image feature extraction method based on object detection and perspective changes, the water meter image is preprocessed and trained using neural network model, which solves the accuracy of character area extraction in water meter images, and realizes clear extraction and accuracy of character area of water meter Identify.
Patent Information
- Application Number
- CN202411256007.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-09
- Publication Date
- 2025-01-10
- Estimated Expiration
- 2044-09-09
AI Technical Summary
The prior art is difficult to accurately extract character areas in water meter images, especially when the image is affected by the difference in shooting angles and background interference.
Using an image feature extraction method based on object detection and perspective changes, the water meter image is preprocessed and trained through a neural network model, position information is obtained and perspective transformation is performed, redundant background information is eliminated, and character areas of the water meter are extracted.
It effectively overcomes the problem of image perspective distortion caused by shooting angle differences and distance changes, improves the accuracy of image extraction, and ensures the clarity and accuracy of the character area of the water meter.
Smart Images

Figure CN119296087A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing, and in particular to an image feature extraction method and system based on target detection and perspective change. Background Art
[0002] With the development of current computer technology, communication technology and metering technology, the automatic meter reading system has become more and more mature. It can automatically read meter data and comprehensively process the water, electricity and gas usage information of urban residents, reduce the workload of meter readers, and reduce the impact of human factors on meter reading errors. However, due to problems such as water meter installation and camera shooting angle, the acquired water meter image is usually tilted, which may cause the water meter pointer or digital shape to be distorted; at the same time, the actual water meter image often contains a lot of interference, such as the background of the water meter, water meter dial numbers, letters, etc. These factors may make it difficult for the recognition algorithm to accurately read and count. The existing method of extracting water meter character areas must go through a tilt correction stage, otherwise the extracted character area may contain redundant background information, thereby affecting the accuracy of the final recognition algorithm. Summary of the invention
[0003] The present invention can effectively overcome the image perspective distortion problem caused by factors such as shooting angle differences and distance changes, and effectively improve the accuracy of image extraction.
[0004] In order to solve the above technical problems, an embodiment of the present invention provides an image feature extraction method based on target detection and perspective change, the method comprising:
[0005] Acquire a water meter image, and preprocess the water meter image to obtain a preprocessed data set;
[0006] Inputting the preprocessed data set into a preset neural network model for training until the neural network model converges to a preset training standard;
[0007] Extract information from the water meter image to be extracted through the trained neural network model, and output the extracted position information; wherein the position information includes four position coordinates of lower left, upper left, lower right and upper right;
[0008] Performing perspective transformation on the water meter image to be extracted according to the position information, and extracting the water meter character area of the water meter image to be extracted;
[0009] The image corresponding to the water meter character area is output as the final extraction result.
[0010] Preferably, performing perspective transformation on the water meter image to be extracted according to the position information to extract the water meter character area of the water meter image to be extracted includes:
[0011] Sort the position coordinates according to lower left, lower right, upper left, and upper right;
[0012] According to the sorted position coordinates, the water meter image to be extracted is acted on by perspective transformation, and redundant parts are removed to obtain the water meter character area.
[0013] Preferably, the preprocessing of the water meter image to obtain a preprocessed data set includes:
[0014] Dividing the data set into a training set, a validation set, and a test set according to a preset ratio;
[0015] The training set and the verification set are annotated; after the annotating, the sizes of the four annotation boxes of each image in the training set and the verification set are equal, and the rectangle formed by the center points of the four annotation boxes corresponds to the water meter character area.
[0016] Preferably, the step of inputting the preprocessed data set into a preset neural network model for training until the neural network model converges to a preset training standard comprises:
[0017] Inputting the labeled training set and the validation set into a preset neural network model for training;
[0018] The preset neural network model is iteratively trained through the back-propagation algorithm, and the neural network model obtained after each iterative training is verified using the labeled verification set. When the preset training standard is met, the iterative training is stopped to obtain a trained neural network model.
[0019] Preferably, the preset training standard includes at least one of the following:
[0020] The number of iterative training reaches the preset iteration number threshold;
[0021] Determine the convergence of the neural network model during the iterative training process.
[0022] Preferably, the verification of the neural network model obtained after each iterative training comprises the following steps:
[0023] Input each image in the labeled training set into the neural network model obtained from the previous training to obtain the current calculation result of each image in the labeled training set;
[0024] Compare the current calculated result of each image with the true result to determine the current loss value of each image;
[0025] According to the loss value of each current image, it is determined whether the neural network model obtained by the previous training has converged.
[0026] Preferably, the neural network model is one of a YOLOv3 model, a YOLOv5 model, a YOLOv8 model or a Faster-RCNN model.
[0027] The present invention discloses an image feature extraction method and system based on target detection and perspective change, comprising: acquiring a water meter image, and preprocessing the water meter image to obtain a preprocessed data set; inputting the preprocessed data set into a preset neural network model for training until the neural network model converges to a preset training standard; extracting information from the water meter image to be extracted through the trained neural network model, and outputting the extracted position information; wherein the position information includes four position coordinates of lower left, upper left, lower right and upper right; performing perspective transformation on the water meter image to be extracted according to the position information, and extracting the water meter character area of the water meter image to be extracted; and outputting the image corresponding to the water meter character area as the final extraction result. By inputting the preprocessed water meter image into a preset neural network model, the model automatically learns through the input data, calculates the learning result, and then compares the calculated result with the real result to obtain the loss, and then updates the model parameters through the back propagation algorithm to reduce the loss, and finally iterates the above steps until the model converges or reaches a preset number of iterations, and then extracts the position information of the water meter image to be extracted through the trained neural network model, and finally obtains the extracted water meter character area map through perspective transformation according to the position information; therefore, the present invention can effectively overcome the image perspective distortion problem caused by factors such as shooting angle differences and distance changes, and effectively improve the extraction accuracy.
[0028] In order to solve the above technical problems, an embodiment of the present invention further provides an image feature extraction system based on target detection and perspective change, comprising:
[0029] Data processing module: used for acquiring water meter images and preprocessing the water meter images to obtain preprocessed data sets;
[0030] Training module: used for inputting the preprocessed data set into a preset neural network model for training until the neural network model converges to a preset training standard;
[0031] Information extraction module: extract information from the water meter image to be extracted through the trained neural network model, and output the extracted position information; wherein the position information includes four coordinates: lower left, upper left, lower right and upper right;
[0032] A perspective transformation module: used for performing perspective transformation on the water meter image to be extracted according to the position information, and extracting the water meter character area of the water meter image to be extracted;
[0033] Output module: used to output the image corresponding to the water meter character area as the final extraction result.
[0034] Preferably, performing perspective transformation on the water meter image to be extracted according to the position information to extract the water meter character area of the water meter image to be extracted includes:
[0035] Sort the position coordinates according to lower left, lower right, upper left, and upper right;
[0036] According to the sorted position coordinates, the water meter image to be extracted is acted on by perspective transformation, and redundant parts are removed to obtain the water meter character area.
[0037] Preferably, the preprocessing of the water meter image to obtain a preprocessed data set includes:
[0038] Dividing the data set into a training set, a validation set, and a test set according to a preset ratio;
[0039] The training set and the verification set are annotated; after the annotating, the sizes of the four annotation boxes of each image in the training set and the verification set are equal, and the rectangle formed by the center points of the four annotation boxes corresponds to the water meter character area.
[0040] Preferably, the step of inputting the preprocessed data set into a preset neural network model for training until the neural network model converges to a preset training standard comprises:
[0041] Inputting the labeled training set and the validation set into a preset neural network model for training;
[0042] The preset neural network model is iteratively trained through the back-propagation algorithm, and the neural network model obtained after each iterative training is verified using the labeled verification set. When the preset training standard is met, the iterative training is stopped to obtain a trained neural network model.
[0043] Preferably, the preset training standard includes at least one of the following:
[0044] The number of iterative training reaches the preset iteration number threshold;
[0045] Determine the convergence of the neural network model during the iterative training process.
[0046] Preferably, the verification of the neural network model obtained after each iterative training comprises the following steps:
[0047] Input each image in the labeled training set into the neural network model obtained from the previous training to obtain the current calculation result of each image in the labeled training set;
[0048] Compare the current calculated result of each image with the true result to determine the current loss value of each image;
[0049] According to the loss value of each current image, it is determined whether the neural network model obtained by the previous training has converged.
[0050] Preferably, the neural network model is one of a YOLOv3 model, a YOLOv5 model, a YOLOv8 model or a Faster-RCNN model.
[0051] In order to solve the above technical problems, an embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored, characterized in that when the computer program is executed by a processor, it implements any of the above-mentioned image feature extraction methods based on target detection and perspective change.
[0052] In order to solve the above technical problems, an embodiment of the present invention also provides a computer device, characterized in that it includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, and when the processor executes the computer program, it implements any one of the above-mentioned image feature extraction methods based on target detection and perspective change. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] Figure 1 It is a flowchart of an image feature extraction method based on target detection and perspective change provided by an embodiment of the present invention;
[0054] Figure 2 It is a structural block diagram of an image feature extraction based on target detection and perspective change provided by an embodiment of the present invention;
[0055] Figure 3 is a structural schematic diagram of an embodiment of a computer device provided by an embodiment of the present invention;
[0056] Figure 4 This is a rendering of a water meter character area after extraction provided by this embodiment;
[0057] Figure 5 This is a water meter image annotated effect diagram provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0058] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0059] In the description of this application, the terms "first", "second", "third", etc. are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first", "second", "third", etc. may explicitly or implicitly include one or more of the feature. In the description of this application, unless otherwise specified, "plurality" means two or more.
[0060] In the description of this application, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in this application can be understood according to specific circumstances.
[0061] In the description of this application, it should be noted that, unless otherwise defined, all technical and scientific terms used in the present invention have the same meaning as those commonly understood by those skilled in the art. The terms used in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. For those of ordinary skill in the art, the specific meanings of the above terms in this application can be understood by specific circumstances.
[0062] The embodiment of the present invention discloses an image feature extraction method based on target detection and perspective change, see Figure 1 , is a flow chart of an image feature extraction method based on target detection and perspective change provided by an embodiment of the present invention, comprising steps S11 to S15:
[0063] S11, acquiring a water meter image, and preprocessing the water meter image to obtain a preprocessed data set;
[0064] S12, inputting the preprocessed data set into a preset neural network model for training, until the neural network model converges to a preset training standard;
[0065] S13, extracting information from the water meter image to be extracted through the trained neural network model, and outputting the extracted position information; wherein the position information includes four position coordinates of lower left, upper left, lower right and upper right;
[0066] S14, performing perspective transformation on the water meter image to be extracted according to the position information, and extracting a water meter character area of the water meter image to be extracted;
[0067] S15, outputting the image corresponding to the water meter character area as the final extraction result.
[0068] The present invention discloses an image feature extraction method and system based on target detection and perspective change, comprising: acquiring a water meter image, and preprocessing the water meter image to obtain a preprocessed data set; inputting the preprocessed data set into a preset neural network model for training until the neural network model converges to a preset training standard; extracting information from the water meter image to be extracted through the trained neural network model, and outputting the extracted position information; wherein the position information includes four position coordinates of lower left, upper left, lower right and upper right; performing perspective transformation on the water meter image to be extracted according to the position information, and extracting the water meter character area of the water meter image to be extracted; and outputting the image corresponding to the water meter character area as the final extraction result. By inputting the preprocessed water meter image into a preset neural network model, the model automatically learns through the input data, calculates the learning result, and then compares the calculated result with the real result to obtain the loss, and then updates the model parameters through the back propagation algorithm to reduce the loss, and finally iterates the above steps until the model converges or reaches a preset number of iterations, and then extracts the position information of the water meter image to be extracted through the trained neural network model, and finally obtains the extracted water meter character area map through perspective transformation according to the position information; therefore, the present invention can effectively overcome the image perspective distortion problem caused by factors such as shooting angle differences and distance changes, and effectively improve the extraction accuracy.
[0069] In another embodiment of the present invention, the performing perspective transformation on the water meter image to be extracted according to the position information to extract the water meter character area of the water meter image to be extracted includes:
[0070] Sort the position coordinates according to lower left, lower right, upper left, and upper right;
[0071] According to the sorted position coordinates, the water meter image to be extracted is acted on by perspective transformation, and redundant parts are removed to obtain the water meter character area.
[0072] In the specific implementation of this embodiment, it can be understood that perspective transformation is an image processing technology used to project an image from one perspective to another perspective. It is usually used in computer vision and image processing, especially in geometric correction and image correction. In this step, we read the coordinates of the four points predicted by each water meter image, and then arrange the four coordinates in the order of lower left, lower right, upper left, and upper right. Finally, according to the coordinates of these four points, perspective transformation is used to act on the corresponding water meter image to extract the water meter character area. See Figure 4 , is a rendering of the water meter character area after extraction provided by this embodiment. It can be seen that we have completely extracted the water meter character area without any extra background interference. It also effectively overcomes the image perspective distortion problem caused by factors such as shooting angle differences and distance changes, ensuring accurate alignment of the image in the horizontal and vertical directions, making the final effect more natural.
[0073] In another embodiment of the present invention, the preprocessing of the water meter image to obtain a preprocessed data set includes:
[0074] Dividing the data set into a training set, a validation set, and a test set according to a preset ratio;
[0075] The training set and the verification set are annotated; after the annotating, the sizes of the four annotation boxes of each image in the training set and the verification set are equal, and the rectangle formed by the center points of the four annotation boxes corresponds to the water meter character area.
[0076] In the specific implementation of this embodiment, labeling the image is a prerequisite for using the target detection model and an important step to improve the performance of the algorithm. The embodiment of the present invention uses the LabelImg tool to manually label the data set. The tool can be downloaded directly in the computer control panel using the pip install labelimg command, and then directly enter labelimg in the control panel to activate it. It is an open source tool for image annotation, which supports multiple annotation formats such as ASCAL VOC, YOLO and Create ML (this example uses the YOLO format to annotate pictures), which can help users create and edit annotation boxes on images for tasks such as target detection and image segmentation. Usually, the data set is divided into a training set, a validation set and a test set according to a preset ratio of 6:1:3, of which the training set and the validation set need to be labeled. In the process of labeling, be sure to ensure that the sizes of the four annotation boxes are equal, and try to make the rectangles formed by the center points of the four annotation boxes correspond to the character area of the water meter. This annotation method can improve the accuracy of algorithm learning and help predict the positions of subsequent key points. See. Figure 5 , is a water meter image annotated effect diagram provided by an embodiment of the present invention.
[0077] In another embodiment provided by the present invention, the step of inputting the preprocessed data set into a preset neural network model for training until the neural network model converges to a preset training standard comprises:
[0078] Inputting the labeled training set and the validation set into a preset neural network model for training;
[0079] The preset neural network model is iteratively trained through the back-propagation algorithm, and the neural network model obtained after each iterative training is verified using the labeled verification set. When the preset training standard is met, the iterative training is stopped to obtain a trained neural network model.
[0080] In the specific implementation of this embodiment, model training is to use a neural network to optimize the parameters of the model using annotated data sets to improve the accuracy of the model in classification, recognition or prediction of new data. Through training, the model gradually learns the features and patterns in the data and has the ability to handle real-world scenes. Model training can not only improve the accuracy and robustness of the model, but also optimize the computational efficiency and accelerate the reasoning speed of the model on new data. In general, model training is to make the model better adapt to practical applications and show higher performance on unseen data. Specifically, taking the YOLOv5 model as an example, this step is to put the labeled training set and validation set data into the YOLOv5 model. The model will automatically learn through the input data, calculate the learning results, and then compare the calculated results with the real results to obtain the loss, and then update the model parameters through the back propagation algorithm to reduce the loss, and finally iterate the above steps repeatedly until the model converges or reaches the preset number of iterations. Through training, the model gradually learns the features and patterns in the data and has the ability to handle real-world scenes. Model training can not only improve the accuracy and robustness of the model, but also optimize the computational efficiency and accelerate the reasoning speed of the model on new data. In addition, model validation and model training are carried out simultaneously, and it is also an automated process. After each round of model training, a result will be output, and then this result will be applied to the validation set data to evaluate the performance of the model through various evaluation indicators such as accuracy, precision, recall, etc. After the training is completed, the weight file of the round with the best evaluation index in the training will be automatically saved. Due to the instability of deep learning, the embodiment of the present invention can perform multiple trainings and retain the weight file of the best experimental result of the model on the validation set.
[0081] In another embodiment provided by the present invention, the preset training standard includes at least one of the following: the number of iterative training reaches a preset threshold of the number of iterations; and the neural network model is determined to converge during the iterative training process.
[0082] When this embodiment is implemented, by setting a preset threshold of the number of iterations, it is possible to ensure that the neural network model is fully trained and to avoid underfitting. When the number of training times of the neural network model reaches the preset threshold, the model will usually better capture the patterns and regularities in the data set, improve the generalization ability, and thus perform better on the test data. It is also very important to determine whether the neural network model has converged during the training process. By monitoring the changing trends of the training error and the verification error, it is possible to determine whether the model has achieved optimal performance and avoid overfitting. Stopping training in time can save computing resources and avoid overfitting of the model on the training data, thereby improving the generalization ability of the model.
[0083] In another embodiment provided by the present invention, the verification of the neural network model obtained after each iterative training comprises the following steps:
[0084] Input each image in the labeled training set into the neural network model obtained from the previous training to obtain the current calculation result of each image in the labeled training set;
[0085] Compare the current calculated result of each image with the true result to determine the current loss value of each image;
[0086] According to the loss value of each current image, it is determined whether the neural network model obtained by the previous training has converged.
[0087] In another embodiment provided by the present invention, the neural network model is one of a YOLOv3 model, a YOLOv5 model, a YOLOv8 model or a Faster-RCNN model.
[0088] When this embodiment is implemented, a suitable neural network model can be selected according to the characteristics of different data, thereby better fitting the data and reducing training time and resource consumption.
[0089] The embodiment of the present invention also provides an image feature extraction system based on target detection and perspective change, see Figure 2 , is a structural block diagram of an image feature extraction system based on target detection and perspective change provided in an embodiment of the present invention, comprising:
[0090] Data processing module 20: used to obtain a water meter image and preprocess the water meter image to obtain a preprocessed data set;
[0091] Training module 21: used to input the preprocessed data set into a preset neural network model for training until the neural network model converges to a preset training standard;
[0092] Information extraction module 22: extract information from the water meter image to be extracted through the trained neural network model, and output the extracted position information; wherein the position information includes four coordinates of lower left, upper left, lower right and upper right;
[0093] Perspective transformation module 23: used for performing perspective transformation on the water meter image to be extracted according to the position information, and extracting the water meter character area of the water meter image to be extracted;
[0094] Output module 24: used for outputting the image corresponding to the water meter character area as the final extraction result.
[0095] The system and modules can implement all the processes of an image feature extraction method based on target detection and perspective change described in any of the above embodiments. The functions of each module and unit in the system and the technical effects achieved are respectively the same as the functions and technical effects achieved by the image feature extraction method based on target detection and perspective change described in the above embodiments, and will not be repeated here.
[0096] An embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the image feature extraction method based on target detection and perspective change described in any one of the above are implemented.
[0097] An embodiment of the present invention also provides a computer device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, the steps of the image feature extraction method based on target detection and perspective change are implemented as described in any one of the above items.
[0098] See also Figure 3 The computer device of this embodiment includes: a processor 301, a memory 302, and a computer program stored in the memory 302 and executable on the processor 301, such as an image tilt correction program. When the processor 301 executes the computer program, the steps in the above-mentioned various image tilt correction method embodiments are implemented, such as Figure 1 Steps S1-S3 are shown.
[0099] Exemplarily, the computer program may be divided into one or more modules / units, which are stored in the memory 302 and executed by the processor 301 to implement the present invention. The one or more modules / units may be a series of computer program instruction segments capable of implementing specific functions, which are used to describe the execution process of the computer program in the computer device.
[0100] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may include, but is not limited to, a processor 301 and a memory 302. Those skilled in the art will appreciate that the schematic diagram is merely an example of a computer device and does not constitute a limitation on the computer device. The computer device may include more or fewer components than shown in the diagram, or may combine certain components, or different components. For example, the computer device may also include input and output devices, network access devices, buses, etc.
[0101] The processor 301 may be a central processing unit (CPU), or other general-purpose processors 301, digital signal processors 301 (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor 301 may be a microprocessor 301 or any conventional processor 301, etc. The processor 301 is the control center of the computer device, and uses various interfaces and lines to connect various parts of the entire computer device.
[0102] The memory 302 can be used to store the computer program and / or module. The processor 301 implements various functions of the computer device by running or executing the computer program and / or module stored in the memory 302 and calling the data stored in the memory 302. The memory 302 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.); the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.). In addition, the memory 302 can include a high-speed random access memory 302, and can also include a non-volatile memory 302, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage 302, a flash memory device, or other volatile solid-state storage 302.
[0103] Wherein, if the module / unit integrated in the computer device 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 such an understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor 301. Wherein, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory 302, read-only memory 302 (ROM, Read-Only Memory), random access memory 302 (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium, etc.
[0104] In summary, the present invention discloses an image feature extraction method and system based on target detection and perspective change, including: obtaining a water meter image, and preprocessing the water meter image to obtain a preprocessed data set; inputting the preprocessed data set into a preset neural network model for training until the neural network model converges to a preset training standard; extracting information from the water meter image to be extracted through the trained neural network model, and outputting the extracted position information; wherein the position information includes four position coordinates of lower left, upper left, lower right and upper right; performing perspective transformation on the water meter image to be extracted according to the position information, and extracting the water meter character area of the water meter image to be extracted; outputting the image corresponding to the water meter character area as the final extraction result. It can effectively overcome the image perspective distortion problem caused by factors such as shooting angle differences and distance changes, and effectively improve the extraction accuracy.
[0105] Through the description of the above implementation methods, those skilled in the art can clearly understand that the present invention can be implemented by means of software plus a necessary hardware platform, and of course can also be implemented entirely by hardware. Based on such an understanding, all or part of the contribution of the technical solution of the present invention to the background technology can be embodied in the form of a software product, and the computer software product can be stored in a storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present invention or certain parts of the embodiments.
[0106] The above is a preferred embodiment of the present invention. It should be pointed out that a person skilled in the art can make several improvements and modifications without departing from the principle of the present invention. These improvements and modifications are also considered to be within the scope of protection of the present invention.
Claims
1. An image feature extraction method based on target detection and perspective change, characterized in that: The method comprises: Acquire a water meter image, and preprocess the water meter image to obtain a preprocessed data set; Inputting the preprocessed data set into a preset neural network model for training until the neural network model converges to a preset training standard; Extract information from the water meter image to be extracted through the trained neural network model, and output the extracted position information; wherein the position information includes four position coordinates: lower left, upper left, lower right and upper right; Performing perspective transformation on the water meter image to be extracted according to the position information, and extracting the water meter character area of the water meter image to be extracted; The image corresponding to the water meter character area is output as the final extraction result.
2. The image feature extraction method based on target detection and perspective change according to claim 1, characterized in that: The step of performing perspective transformation on the water meter image to be extracted according to the position information to extract the water meter character area of the water meter image to be extracted includes: Sort the position coordinates according to lower left, lower right, upper left, and upper right; According to the sorted position coordinates, the water meter image to be extracted is acted on by perspective transformation, and redundant parts are removed to obtain the water meter character area.
3. The image feature extraction method based on target detection and perspective change according to claim 1, characterized in that: The preprocessing of the water meter image to obtain a preprocessed data set includes: Dividing the data set into a training set, a validation set, and a test set according to a preset ratio; The training set and the verification set are annotated; after the annotating, the sizes of the four annotation boxes of each image in the training set and the verification set are equal, and the rectangle formed by the center points of the four annotation boxes corresponds to the water meter character area.
4. The image feature extraction method based on target detection and perspective change as claimed in claim 3, characterized in that: The step of inputting the preprocessed data set into a preset neural network model for training until the neural network model converges to a preset training standard comprises: Inputting the labeled training set and the validation set into a preset neural network model for training; The preset neural network model is iteratively trained through the back-propagation algorithm, and the neural network model obtained after each iterative training is verified using the labeled verification set. When the preset training standard is met, the iterative training is stopped to obtain a trained neural network model.
5. The image feature extraction method based on target detection and perspective change according to claim 1, characterized in that: The preset training standard includes at least one of the following: The number of iterative training reaches the preset iteration number threshold; Determine the convergence of the neural network model during the iterative training process.
6. The image feature extraction method based on target detection and perspective change according to claim 4, characterized in that: The verification of the neural network model obtained after each iterative training includes the following steps: Input each image in the labeled training set into the neural network model obtained from the previous training to obtain the current calculation result of each image in the labeled training set; Compare the current calculated result of each image with the true result to determine the current loss value of each image; According to the loss value of each current image, it is determined whether the neural network model obtained by the previous training has converged.
7. The image feature extraction method based on target detection and perspective change according to claim 1, characterized in that: The neural network model is one of a YOLOv3 model, a YOLOv5 model, a YOLOv8 model or a Faster-RCNN model.
8. An image feature extraction system based on target detection and perspective change, characterized in that: include: Data processing module: used for acquiring water meter images and preprocessing the water meter images to obtain preprocessed data sets; Training module: used for inputting the preprocessed data set into a preset neural network model for training until the neural network model converges to a preset training standard; Information extraction module: extract information from the water meter image to be extracted through the trained neural network model, and output the extracted position information; wherein the position information includes four coordinates: lower left, upper left, lower right and upper right; A perspective transformation module: used for performing perspective transformation on the water meter image to be extracted according to the position information, and extracting the water meter character area of the water meter image to be extracted; Output module: used to output the image corresponding to the water meter character area as the final extraction result.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for extracting image features based on target detection and perspective change as described in any one of claims 1 to 7 is implemented.
10. A computer device, characterized in that: It comprises a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, an image feature extraction method based on target detection and perspective change as described in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Image super-resolution reconstruction method
CN107481188A
Vehicle image accurate retrieval method based on big data
CN108491797A
Automatic water meter detection method based on Faster-rcnn
CN109029641A
Pointer type instrument inclination correction method and system
CN111488874A
Digital dial plate identification method based on Mask R-CNN and CRNN
CN113378812A