Instrument panel recognition reading method and device
By identifying and constructing a single-channel diagram of the instrument panel and determining the position of the pointer and scale, the problem of instrument panel reading accuracy in the presence of illumination changes and interference in the existing technology is solved, and stable and accurate automatic readings under complex conditions are achieved.
Patent Information
- Application Number
- CN202410890584.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-04
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2044-07-04
AI Technical Summary
Existing mechanical instrument panel reading recognition algorithms have weak anti-interference capabilities and low accuracy when faced with illumination changes, large shadow interference, elliptical outer circles and uneven scales, which can easily lead to reading errors and calculation errors.
By intercepting the dashboard image in the input image, identify the scale numbers and measurement units, construct a pointer single-channel chart, a tick mark single-channel chart, and a key tick mark single-channel chart, determine the pointer vertex position and scale position, and combine the scale numbers and measurement units Take readings to improve positioning accuracy and anti-interference capabilities.
It achieves stable and accurate automatic reading of instrument panels in complex environments, reduces manual reading errors and low efficiency, and improves the accuracy of real-time reading of mechanical instrument panel data in factory workshops.
Smart Images

Figure CN118429953B
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of intelligent identification of instruments and meters, and in particular to a method and device for identifying and reading instrument panels, as well as a computing device and a computer-readable storage medium. Background Art
[0002] Mechanical pointer instruments are simple in structure, easy to maintain and low in price. They are widely used in industrial production and are an important means of equipment status monitoring. However, due to the scattered installation locations of mechanical pointer instruments, inspection and monitoring are time-consuming and inefficient. In addition, the installation locations of some mechanical pointer instruments are limited by the mechanical structure, and manual reading is required, which can easily cause reading errors and even accidents.
[0003] In order to improve the efficiency of manual inspection readings in factories, avoid losses caused by manual reading errors and inefficiency, and avoid accidents, the mechanical instrument panel reading recognition algorithm came into being to automatically read the mechanical pointer instruments. The mechanical instrument panel reading recognition algorithm uses computer vision analysis technology to achieve dial positioning, pointer positioning, and instrument reading recognition, and then read the data of the mechanical instrument panel in the factory workshop in real time.
[0004] The existing mechanical instrument panel reading recognition algorithms include: 1. Calibration method, which obtains the dial positioning by calibrating the prior information of the instrument after installing the system, roughly positioning the pointer by combining the connected area screening, and then integrating the Hough transform method and edge clustering to achieve precise positioning of the instrument pointer edge; 2. Automatic recognition method based on Snake algorithm, which is divided into Hough transform rough positioning circular features and Snake algorithm precise positioning circular features for dial positioning, Hough transform detection of straight line features, which is suitable for instrument pointer detection under constant lighting conditions; 3. Automatic instrument reading method based on Hough transform, which calculates the instrument reading by measuring the angle between the pointer straight line and the zero scale straight line; 4. Silhouette method, which performs difference operation on two pointer instrument images at different times, and then obtains the pointer position and deflection angle to achieve reading recognition. In addition, it also includes a pointer instrument reading method based on visual saliency area detection, which uses visual saliency detection prior knowledge to extract the pointer area, then finds the maximum value of the horizontal coordinate projection by rotating the image, calculates the pointer rotation angle, and converts it into instrument readings using a fitted linear function; the contour tracking method realizes the regional segmentation of the dial and the pointer, and uses an image transformation algorithm to detect the pointer orientation, obtain the linear position parameters of the pointer, determine the scale line spacing relationship and the maximum range of the instrument; the instrument reading recognition method and process based on yolox detection detects the deflection angle of the pointer relative to the left and right adjacent digits to determine the reading.
[0005] However, the above mechanical instrument panel reading recognition algorithms have traditional algorithms that run fast but have poor flexibility, weak anti-interference ability, and high requirements for image quality. The silhouette method is suitable for obtaining the image pointer position under sufficient lighting conditions, but the silhouette method is not ideal for environments with large lighting changes and shadow interference. The Hough line detection is not robust to elliptical pointers and is easily interfered by other straight lines that are not scale lines. The circular feature is used to locate the dial, which is easily affected by environmental interference, such as the small circle in the center of the pointer, the circle of the dial base and other circles in the environmental background, and the outer circle of the instrument are elliptical rather than circular in the image, resulting in large errors in pointer detection or instrument area positioning, which in turn leads to reading recognition errors.
[0006] Moreover, when the outer circle of the instrument is elliptical in the image (the camera is not facing the dial) and when the scale of the instrument is uneven, whether it is the traditional method or the deep learning method, as long as the angle between the pointer line and other scales is used for calculation, the accuracy of the instrument reading will be significantly reduced. The method based on deep learning segmentation determines the range of change by detecting the scale value. The scale value occupies a very small area. Some deep learning segmentation models are not capable of feature extraction and decoding. For blurred images, drastic changes in lighting, and changes in angles, they are prone to miss the scale value and cause final calculation errors.
[0007] In addition, based on the angle calculator, the center point of the located instrument panel area is usually selected as the center of the circle for calculating the angle. Due to the limitations of target detection itself, dial positioning based on target detection is often not accurate enough, resulting in inaccurate center position; when the outer circle of the instrument is elliptical in the image, it is inaccurate to use the center point based on the instrument panel positioning center point or the center point based on geometric relationship regression as the center of the circle, which will lead to large errors in the predicted readings. In actual usage scenarios, the instrument scale is uneven, especially the phenomenon that the initial two scale lines near the stop nail are very close. In this case, the segmentation model based on deep learning is easy to segment the two scale lines as the same, which leads to the final calculation error. Summary of the invention
[0008] In view of this, the present application provides a dashboard recognition and reading method to solve the technical defects existing in the prior art. The present application also provides a dashboard recognition and reading device, a computing device, and a computer-readable storage medium.
[0009] According to a first aspect of the present application, a method for identifying and reading an instrument panel is provided, comprising:
[0010] Intercepting a dashboard image contained in an input image, and identifying scale numbers and measurement units contained in the dashboard image;
[0011] Determine the center of the instrument panel based on the instrument panel picture, and construct a pointer single-channel graph, a scale line single-channel graph, and a key scale line single-channel graph according to the instrument panel picture;
[0012] Determine the position of the pointer vertex according to the center of the instrument panel and the pointer single-channel graph, and determine the scale position according to the center of the instrument panel, the scale line single-channel graph and the key scale line single-channel graph;
[0013] The input image is read according to the scale position, the scale number, the measurement unit and the pointer vertex position.
[0014] Optionally, the intercepting of the dashboard image contained in the input image includes:
[0015] Based on a preset target detection algorithm, locate the position of the instrument panel in the input image;
[0016] According to the position of the dashboard, a dashboard image included in the input image is captured.
[0017] Optionally, the identifying scale numbers and measurement units contained in the dashboard image includes:
[0018] Using a preset target detection algorithm, locate the scale digits and measurement unit positions in the instrument panel image;
[0019] Based on the position of the scale digits, the scale digits are determined by a preset character recognition algorithm;
[0020] Based on the position of the measurement unit, the measurement unit is determined by the character recognition algorithm.
[0021] Optionally, determining the center of the dashboard based on the dashboard image includes:
[0022] Segmenting the circular fixed axis contained in the dashboard image using a preset segmentation algorithm;
[0023] The geometric center of the circular fixed axis is determined as the center of the instrument panel.
[0024] Optionally, constructing a pointer single-channel graph, a scale line single-channel graph, and a key scale line single-channel graph according to the instrument panel image includes:
[0025] According to a preset segmentation algorithm, the pointer contained in the instrument panel image is segmented to obtain the pointer single-channel image;
[0026] According to the segmentation algorithm, the scale lines in the instrument panel image that do not correspond to the scale numbers are segmented to obtain the scale line single-channel image;
[0027] According to the segmentation algorithm, the scale lines corresponding to the scale numbers in the instrument panel image are segmented to obtain the key scale line single-channel image.
[0028] Optionally, determining the position of the pointer vertex according to the center of the instrument panel and the pointer single-channel graph includes:
[0029] Scanning the pointer single channel diagram around the center of the instrument panel to generate a pointer rectangular diagram;
[0030] Based on a preset vertical projection method, compressing the pointer rectangular map into a pointer one-dimensional array;
[0031] The maximum value position in the one-dimensional array of pointers is determined as the pointer vertex position.
[0032] Optionally, scanning the pointer single-channel image around the center of the instrument panel to generate a pointer rectangular image includes:
[0033] Determine a bounding rectangle including the tick marks and key tick marks in the instrument panel image;
[0034] The maximum vertical distance between the center of the instrument panel and each side of the circumscribed rectangle is used as the scanning radius;
[0035] Superimposing the scale line single-channel graph and the key scale line single-channel graph to obtain a superimposed graph;
[0036] Determine a blank area in the overlay image, and select a scanning starting point in the blank area;
[0037] The pointer single channel diagram is scanned clockwise through the scanning starting point and the scanning radius to obtain the pointer rectangular diagram.
[0038] Optionally, determining the scale position according to the center of the instrument panel, the scale line single-channel diagram and the key scale line single-channel diagram comprises:
[0039] Scanning the scale line single channel diagram around the center of the instrument panel to generate a scale line rectangular diagram;
[0040] Scanning the key scale line single channel diagram around the center of the instrument panel to generate a key scale line rectangular diagram;
[0041] Based on a preset vertical projection method, compressing the scale line rectangular diagram into a scale line one-dimensional array, and compressing the key scale line rectangular diagram into a key scale line one-dimensional array;
[0042] The scale position is determined based on the one-dimensional array of scale lines and the one-dimensional array of key scale lines.
[0043] Optionally, determining the scale position based on the scale line one-dimensional array and the key scale line one-dimensional array comprises:
[0044] Determine a first scale line group including a plurality of scale line positions according to the one-dimensional array of scale lines;
[0045] Determine a second scale line group of multiple key scale line positions according to the one-dimensional array of key scale lines;
[0046] Determine a first mode of position differences between two adjacent scale lines in the first scale line group, and interpolate the first scale line group based on the first mode to obtain a first target scale line group;
[0047] Determine a second mode of the position difference between two adjacent key scale lines in the second scale line group, and interpolate the second scale line group based on the second mode to obtain a second target scale line group, wherein the first target scale line group and the second target scale line group constitute the scale position.
[0048] Optionally, the reading the input image according to the scale position, the scale number, the measurement unit and the pointer vertex position includes:
[0049] Determine the scale line value corresponding to the pointer vertex position according to the pointer vertex position and the scale position;
[0050] According to the scale line value and the scale number, the pointer value is determined, the measurement unit is combined, and the reading of the instrument panel image contained in the input image is read.
[0051] According to a second aspect of the present application, a dashboard identification reading device is provided, comprising:
[0052] The interception module is configured to intercept the dashboard image contained in the input image and identify the scale numbers and measurement units contained in the dashboard image;
[0053] A single-channel graph construction module is configured to determine the center of the instrument panel based on the instrument panel picture, and to construct a pointer single-channel graph, a scale line single-channel graph, and a key scale line single-channel graph according to the instrument panel picture;
[0054] a position determination module configured to determine the position of the pointer vertex according to the center of the instrument panel and the pointer single-channel graph, and to determine the scale position according to the center of the instrument panel, the scale line single-channel graph and the key scale line single-channel graph;
[0055] The reading module is configured to read the input image according to the scale position, the scale number, the measurement unit and the pointer vertex position.
[0056] According to a third aspect of the present application, there is provided a computing device, including:
[0057] Memory and processor;
[0058] The memory is used to store computer executable instructions, and the processor can implement the steps of the instrument panel identification and reading method when executing the computer executable instructions.
[0059] According to a fourth aspect of the present application, a computer-readable storage medium is provided, which stores computer-executable instructions, and when the instructions are executed by a processor, the steps of the instrument panel recognition and reading method are implemented.
[0060] According to a fifth aspect of the present application, a chip is provided, which stores a computer program, and when the computer program is executed by the chip, the steps of the instrument panel identification and reading method are implemented.
[0061] The instrument panel recognition and reading method provided by the present application intercepts the instrument panel image contained in the input image, and recognizes the scale numbers and measurement units contained in the instrument panel image; determines the center of the instrument panel based on the instrument panel image, and constructs a pointer single-channel map, a scale line single-channel map, and a key scale line single-channel map according to the instrument panel image; determines the pointer vertex position according to the instrument panel center and the pointer single-channel map, and determines the scale position according to the instrument panel center, the scale line single-channel map, and the key scale line single-channel map; reads the input image according to the scale position, the scale numbers, the measurement units, and the pointer vertex position. The positioning of the instrument panel in the input image and the distinction of adjacent scale lines are realized, ensuring stable and accurate automatic reading. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0063] Figure 1 This is a flow chart of a method for identifying and reading an instrument panel provided in one embodiment of the present application;
[0064] Figure 2 It is a flow chart of a method for identifying and reading an instrument panel provided in one embodiment of the present application;
[0065] Figure 3 This is a post-processing flow chart of a dashboard recognition reading method provided by an embodiment of the present application;
[0066] Figure 4 It is a structural schematic diagram of a dashboard identification and reading device provided by an embodiment of the present application;
[0067] Figure 5 It is a structural block diagram of a computing device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0068] Many specific details are described in the following description to facilitate a full understanding of the present application. However, the present application can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of the present application, so the present application is not limited by the specific implementation disclosed below.
[0069] The terms used in one or more embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of the present application. The singular forms of "a", "said" and "the" used in one or more embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of the present application refers to and includes any or all possible combinations of one or more associated listed items.
[0070] It should be understood that, although the terms first, second, etc. may be used to describe various information in one or more embodiments of the present application, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of the present application, the first may also be referred to as the second, and similarly, the second may also be referred to as the first.
[0071] First, the terms involved in one or more embodiments of the present invention are explained.
[0072] Stop pin: The small pin that blocks the pointer at the zero point of the instrument panel and prevents the pointer from running below zero is also called a stop pin.
[0073] Euclidean distance: is a commonly used distance definition, which is the true distance between two points in m-dimensional space.
[0074] R-CNN: Regions with CNN features, which first generates potential bounding boxes using region proposal methods such as selective search, then uses a convolutional neural network (CNN) to extract features, and finally uses a SVM classifier for classification.
[0075] Fast R-CNN: It extracts features by performing only one forward propagation through the entire image, and then uses ROIPooling to quickly extract the required regional features from the feature map.
[0076] Faster R-CNN: Introduced the Region Proposal Network (RPN) to generate high-quality region proposals for Fast R-CNN.
[0077] YOLO: You Only Look Once is a real-time target detection system that treats target detection as a regression problem, divides the input image into multiple regions at one time, and directly predicts the bounding box and category probability in the output layer.
[0078] SSD: Single Shot MultiBox Detector, combines the speed of YOLO and the accuracy of Faster R-CNN by directly predicting bounding boxes and category probabilities using filters of different sizes on feature maps of different resolutions.
[0079] RetinaNet: It solves the problem of extreme foreground-background class imbalance through its designed Focal loss, which makes it more effective in detecting small objects and objects in complex scenes.
[0080] In the present application, a method for identifying and reading an instrument panel is provided. The present application also relates to an instrument panel identifying and reading device, a computing device, and a computer-readable storage medium, which are described in detail one by one in the following embodiments.
[0081] Figure 1 A flow chart of a method for identifying and reading an instrument panel according to an embodiment of the present application is shown, which specifically includes the following steps:
[0082] Step S102: intercepting a dashboard image contained in the input image, and identifying scale numbers and measurement units contained in the dashboard image;
[0083] Step S104: determining the center of the instrument panel based on the instrument panel picture, and constructing a pointer single-channel graph, a scale line single-channel graph, and a key scale line single-channel graph according to the instrument panel picture;
[0084] Step S106: determining the position of the pointer vertex according to the center of the instrument panel and the pointer single-channel graph, and determining the scale position according to the center of the instrument panel, the scale line single-channel graph and the key scale line single-channel graph;
[0085] Step S108: reading the input image according to the scale position, the scale number, the measurement unit and the pointer vertex position.
[0086] An image sensor is arranged near a dashboard that needs to be identified, and an input image containing a dashboard image is collected by the image sensor.
[0087] Based on this, Figure 2 As shown in the flow chart of a method for identifying and reading an instrument panel, an input image is first obtained, and then an instrument panel target is detected on the input image, the instrument panel image in the input image is located, and then the instrument panel image is intercepted according to the positioning result; the scale value and measurement unit target are located in the instrument panel image, and the OCR character recognition is performed to determine the scale number and measurement unit; and after segmenting and post-processing the instrument panel image, the instrument panel reading is output, that is, the instrument panel image is divided into a pointer single-channel image, a scale line single-channel image and a key scale line single-channel image, and the input image is read according to the division result.
[0088] Furthermore, the process of capturing the dashboard image contained in the input image is specifically implemented as follows in this embodiment:
[0089] Based on a preset target detection algorithm, the position of the instrument panel in the input image is located; and according to the position of the instrument panel, the instrument panel image contained in the input image is intercepted.
[0090] Among them, the choice of target detection algorithm is not unique, such as R-CNN, Fast R-CNN, Faster R-CNN, YOLO, SSD, RetinaNet, etc. The specific target detection algorithm type is determined by the actual use scenario and is not limited in this embodiment. In addition, the target detection algorithm can improve the accuracy of positioning through pre-training.
[0091] Furthermore, the process of identifying the scale numbers and measurement units contained in the dashboard image is specifically implemented as follows in this embodiment:
[0092] The scale numeral positions and measurement unit positions in the instrument panel image are located by a preset target detection algorithm; based on the scale numeral positions, the scale numerals are determined by a preset character recognition algorithm; based on the measurement unit positions, the measurement units are determined by the character recognition algorithm.
[0093] Among them, by adopting the target detection algorithm, the positions of the scale numbers and measurement units in the dashboard image are located, and then the scale numbers and measurement units are identified by the character recognition algorithm. It should be noted that the choice of character recognition algorithm is not unique, such as template matching algorithm, support vector machine, Bayesian classification algorithm, neural network algorithm, etc. The specific character recognition algorithm type selection is determined by the actual usage scenario, and this embodiment does not limit it.
[0094] Furthermore, the process of determining the center of the dashboard based on the dashboard image is specifically implemented as follows in this embodiment:
[0095] The circular fixed axis contained in the instrument panel image is segmented by a preset segmentation algorithm; and the geometric center of the circular fixed axis is determined as the center of the instrument panel.
[0096] Among them, Figure 3 As shown in the post-processing flow chart of a dashboard recognition and reading method provided, the center point of the center circle is determined by segmenting the center circle single channel image.
[0097] Specifically, a segmentation algorithm is used to segment the circular portion of the upper surface of the circular fixed axis located at the inherent center of the instrument panel, and the geometric center point of this portion is used as the center of the instrument panel. It should be noted that the choice of segmentation algorithm is not unique, such as threshold-based segmentation, region growing-based segmentation, watershed algorithm, edge detection-based segmentation, image semantic segmentation, image instance segmentation, etc. The specific segmentation algorithm type selection is determined by the actual usage scenario, and this embodiment does not limit it.
[0098] Furthermore, the process of constructing a pointer single-channel diagram, a scale line single-channel diagram, and a key scale line single-channel diagram according to the instrument panel picture is specifically implemented as follows in this embodiment:
[0099] According to a preset segmentation algorithm, the pointer contained in the instrument panel image is segmented to obtain the pointer single-channel image; according to the segmentation algorithm, the scale lines in the instrument panel image that do not correspond to the scale numbers are segmented to obtain the scale line single-channel image; according to the segmentation algorithm, the scale lines in the instrument panel image that correspond to the scale numbers are segmented to obtain the key scale line single-channel image.
[0100] Among them, through the segmentation algorithm, the pointer, the scale lines not corresponding to the scale numbers, and the scale lines corresponding to the scale numbers in the instrument panel picture are segmented respectively to obtain the pointer single-channel map, the scale line single-channel map, and the key scale line single-channel map.
[0101] Furthermore, the process of determining the position of the pointer vertex according to the center of the instrument panel and the pointer single-channel graph is specifically implemented as follows in this embodiment:
[0102] Scan the pointer single channel diagram around the center of the instrument panel to generate a pointer rectangular diagram; based on a preset vertical projection method, compress the pointer rectangular diagram into a pointer one-dimensional array; determine the maximum value position in the pointer one-dimensional array as the pointer vertex position.
[0103] Furthermore, the process of scanning the pointer single channel image around the center of the instrument panel to generate the pointer rectangular image is specifically implemented as follows in this embodiment:
[0104] Determine a circumscribed rectangle containing the scale lines and key scale lines in the instrument panel image; use the maximum vertical distance between the center of the instrument panel and each side of the circumscribed rectangle as a scanning radius; superimpose the scale line single-channel image and the key scale line single-channel image to obtain an overlay image; determine a blank area in the overlay image, and select a scanning starting point in the blank area; scan the pointer single-channel image clockwise using the scanning starting point and the scanning radius to obtain the pointer rectangle image.
[0105] Among them, Figure 3 As shown in the post-processing flow chart of a method for identifying and reading an instrument panel, based on the segmented pointer single-channel image, the single-channel image is expanded into a rectangle with the midpoint of the center circle as the center; based on the segmented scale single-channel image, the single-channel image is expanded into a rectangle with the midpoint of the center circle as the center; based on the segmented key scale single-channel image, the single-channel image is expanded into a rectangle with the midpoint of the center circle as the center.
[0106] Specifically, in the process of scanning the pointer single-channel image around the center of the instrument panel to obtain the pointer rectangular image, the minimum circumscribed rectangle including all segmented pixels of the two scale lines can be first obtained, and the maximum vertical distance from the center of the instrument to the four sides of the circumscribed rectangle is taken as the scanning radius to ensure that the pointer in the instrument panel is completely included in the subsequent scanning process to avoid omission; then the single-channel images of the two scale lines are superimposed, and the obtained superimposed image is equally divided with the center of the instrument panel as the center. For example, if it is divided at 15°, a total of 24 segments can be obtained. The segments without internal scale lines are recorded as blank blocks, and the average value of the fan-shaped midline angles of all blank blocks is taken as the scanning starting point. The single-channel image is scanned in a clockwise direction for one circle, and each is mapped into a rectangular image, namely, the pointer rectangular image.
[0107] In addition, if Figure 3 As shown in the post-processing flow chart of a dashboard recognition and reading method provided, after the relevant single-channel image is expanded into a rectangular form, it can also be converted into a one-dimensional array through binarization, noise reduction, and vertical projection, and the pointer area, scale area, and key scale area are processed separately; as for the separated pointer area, it is necessary to filter out noise with a width that is too narrow and a height below a threshold to achieve the positioning of the pointer tip.
[0108] Specifically, after obtaining the pointer rectangular map, the image noise can be reduced through binarization and noise reduction processing, and then the preprocessed pointer rectangular map is compressed into a one-dimensional array, i.e., the pointer one-dimensional array, through the vertical projection method, wherein, in the pointer one-dimensional array, the continuous area with non-zero value is the candidate pointer area; in the pointer one-dimensional array, the noise that is too narrow is filtered, i.e., the width of the candidate area is lower than the threshold, and then the noise that is too short is filtered, i.e., the maximum value of the candidate area is lower than the threshold. After two filterings, the location area of the pointer is separated, and the maximum value position of the area is the exact position of the pointer vertex, i.e., the pointer vertex position.
[0109] Furthermore, the process of determining the scale position according to the center of the instrument panel, the scale line single-channel diagram and the key scale line single-channel diagram is specifically implemented as follows in this embodiment:
[0110] Scan the scale line single-channel diagram around the center of the instrument panel to generate a scale line rectangular diagram; scan the key scale line single-channel diagram around the center of the instrument panel to generate a key scale line rectangular diagram; based on a preset vertical projection method, compress the scale line rectangular diagram into a one-dimensional array of scale lines, and compress the key scale line rectangular diagram into a one-dimensional array of key scale lines; determine the scale position based on the one-dimensional array of scale lines and the one-dimensional array of key scale lines.
[0111] Furthermore, based on the one-dimensional array of scale lines and the one-dimensional array of key scale lines, the process of determining the scale position is specifically implemented as follows in this embodiment:
[0112] Determine a first scale line group including multiple scale line positions based on the one-dimensional array of scale lines; determine a second scale line group including multiple key scale line positions based on the one-dimensional array of key scale lines; determine a first mode of the position difference between two adjacent scale lines in the first scale line group, and interpolate the first scale line group based on the first mode to obtain a first target scale line group; determine a second mode of the position difference between two adjacent key scale lines in the second scale line group, and interpolate the second scale line group based on the second mode to obtain a second target scale line group, wherein the first target scale line group and the second target scale line group constitute the scale positions.
[0113] The process of scanning the scale line single-channel diagram and the key scale line single-channel diagram around the center of the instrument panel to obtain the corresponding scale line rectangular diagram and the key scale line rectangular diagram can refer to the process of scanning the scale line single-channel diagram around the center of the instrument panel to obtain the pointer rectangular diagram, and Figure 3 A post-processing flow chart of a dashboard recognition and reading method is provided, which will not be repeated in this implementation.
[0114] Based on this, Figure 3As shown in the post-processing flow chart of the instrument panel recognition reading method provided, after separating the scale area and the key scale area, it is also necessary to locate the center line of each scale and the center line of each key scale, and to adaptively interpolate the missing scale lines by merging the two channels of the scale lines.
[0115] Specifically, the obtained scale line rectangular diagram and key scale line rectangular diagram are compressed into a one-dimensional array through the vertical projection method to obtain a scale line one-dimensional array and a key scale line one-dimensional array. In these two one-dimensional arrays, the continuous area with non-zero values is the relevant scale line area. In the actual application scenario, there is a situation where the scale lines are missing or blocked in the collected instrument panel image. Therefore, it is necessary to separate each scale line and the key scale line area, and determine the position of the center of each line in the one-dimensional array. The mode of the position difference between two adjacent scale lines is counted as the standard scale line distance. For two scale lines greater than the distance, adaptive interpolation is performed according to the multiple relationship of the distance with the marked scale line, so as to complete the missed scale position.
[0116] Furthermore, the process of reading the input image according to the scale position, scale number, measurement unit and pointer vertex position is specifically implemented as follows in this embodiment:
[0117] According to the pointer vertex position and the scale position, determine the scale line value corresponding to the pointer vertex position; according to the scale line value and the scale number, determine the pointer value, combine the measurement units, and read the dashboard image contained in the input image.
[0118] Among them, first, it is necessary to determine the scale line value corresponding to the pointer vertex, query the two scale lines adjacent to the pointer vertex position, record the adjacent scale line on the left as the mth scale line, and locate its center index position in the one-dimensional array as a, and record the adjacent scale line on the right as the m+1th scale line, and locate its center index position in the one-dimensional array as b. In addition, the end position index of the pointer vertex in the one-dimensional array is recorded as c, and the scale line value corresponding to the pointer vertex is specified as s. Then the calculation formula of the scale line value s is as follows:
[0119] ,
[0120] Based on this, the pointer value corresponding to the pointer vertex is determined according to the scale numbers and scale line values, and the measurement unit is matched to automatically obtain the instrument panel reading.
[0121] It should be noted that the matching process is as follows Figure 3As shown in the post-processing flow chart of a method for identifying and reading an instrument panel, the center point of the scale value block is determined according to the scale line target detection result, and then each key scale line is matched with the corresponding scale value according to the nearest distance matching. The distance here can adopt Euclidean distance, etc. The specific type of algorithm used to determine the nearest distance is determined by the actual usage scenario, and this embodiment does not limit it.
[0122] Corresponding to the above method embodiment, the present application also provides an instrument panel recognition reading device embodiment, Figure 4 FIG. 1 is a schematic diagram showing the structure of a dashboard recognition and reading device provided by an embodiment of the present application. Figure 4 As shown, the device comprises:
[0123] The interception module 402 is configured to intercept the dashboard image contained in the input image, and identify the scale numbers and measurement units contained in the dashboard image;
[0124] A construction module 404 is configured to determine the center of the instrument panel based on the instrument panel picture, and to construct a pointer single-channel graph, a scale line single-channel graph, and a key scale line single-channel graph according to the instrument panel picture;
[0125] The positioning module 406 is configured to determine the position of the pointer vertex according to the center of the instrument panel and the pointer single-channel map, and determine the scale position according to the center of the instrument panel, the scale line single-channel map and the key scale line single-channel map;
[0126] The reading module 408 is configured to read the input image according to the scale position, the scale number, the measurement unit and the pointer vertex position.
[0127] In an optional embodiment, the interception module 402 is further configured to:
[0128] Based on a preset target detection algorithm, the position of the instrument panel in the input image is located; and according to the position of the instrument panel, the instrument panel image contained in the input image is intercepted.
[0129] In an optional embodiment, the interception module 402 is further configured to:
[0130] The scale numeral positions and measurement unit positions in the instrument panel image are located by a preset target detection algorithm; based on the scale numeral positions, the scale numerals are determined by a preset character recognition algorithm; based on the measurement unit positions, the measurement units are determined by the character recognition algorithm.
[0131] In an optional embodiment, the construction module 404 is further configured to:
[0132] The circular fixed axis contained in the instrument panel image is segmented by a preset segmentation algorithm; and the geometric center of the circular fixed axis is determined as the center of the instrument panel.
[0133] In an optional embodiment, the construction module 404 is further configured to:
[0134] According to a preset segmentation algorithm, the pointer contained in the instrument panel image is segmented to obtain the pointer single-channel image; according to the segmentation algorithm, the scale lines in the instrument panel image that do not correspond to the scale numbers are segmented to obtain the scale line single-channel image; according to the segmentation algorithm, the scale lines in the instrument panel image that correspond to the scale numbers are segmented to obtain the key scale line single-channel image.
[0135] In an optional embodiment, the positioning module 406 is further configured to:
[0136] Scan the pointer single channel diagram around the center of the instrument panel to generate a pointer rectangular diagram; based on a preset vertical projection method, compress the pointer rectangular diagram into a pointer one-dimensional array; determine the maximum value position in the pointer one-dimensional array as the pointer vertex position.
[0137] In an optional embodiment, the positioning module 406 is further configured to:
[0138] Determine a circumscribed rectangle containing the scale lines and key scale lines in the instrument panel image; use the maximum vertical distance between the center of the instrument panel and each side of the circumscribed rectangle as a scanning radius; superimpose the scale line single-channel image and the key scale line single-channel image to obtain an overlay image; determine a blank area in the overlay image, and select a scanning starting point in the blank area; scan the pointer single-channel image clockwise using the scanning starting point and the scanning radius to obtain the pointer rectangle image.
[0139] In an optional embodiment, the positioning module 406 is further configured to:
[0140] Scan the scale line single-channel diagram around the center of the instrument panel to generate a scale line rectangular diagram; scan the key scale line single-channel diagram around the center of the instrument panel to generate a key scale line rectangular diagram; based on a preset vertical projection method, compress the scale line rectangular diagram into a one-dimensional array of scale lines, and compress the key scale line rectangular diagram into a one-dimensional array of key scale lines; determine the scale position based on the one-dimensional array of scale lines and the one-dimensional array of key scale lines.
[0141] In an optional embodiment, the positioning module 406 is further configured to:
[0142] Determine a first scale line group including multiple scale line positions based on the one-dimensional array of scale lines; determine a second scale line group including multiple key scale line positions based on the one-dimensional array of key scale lines; determine a first mode of the position difference between two adjacent scale lines in the first scale line group, and interpolate the first scale line group based on the first mode to obtain a first target scale line group; determine a second mode of the position difference between two adjacent key scale lines in the second scale line group, and interpolate the second scale line group based on the second mode to obtain a second target scale line group, wherein the first target scale line group and the second target scale line group constitute the scale positions.
[0143] In an optional embodiment, the reading module 408 is further configured to:
[0144] According to the pointer vertex position and the scale position, determine the scale line value corresponding to the pointer vertex position; according to the scale line value and the scale number, determine the pointer value, combine the measurement units, and read the dashboard image contained in the input image.
[0145] The instrument panel recognition and reading device provided by the present application intercepts the instrument panel image contained in the input image and recognizes the scale numbers and measurement units contained in the instrument panel image; determines the center of the instrument panel based on the instrument panel image, and constructs a pointer single-channel map, a scale line single-channel map, and a key scale line single-channel map according to the instrument panel image; determines the pointer vertex position according to the instrument panel center and the pointer single-channel map, and determines the scale position according to the instrument panel center, the scale line single-channel map, and the key scale line single-channel map; reads the input image according to the scale position, the scale numbers, the measurement units, and the pointer vertex position. The center of the instrument panel is located, adjacent scale lines are distinguished, and the instrument panel reading is fully automatically recognized.
[0146] The above is a schematic scheme of an instrument panel identification and reading device of the present embodiment. It should be noted that the technical scheme of the instrument panel identification and reading device belongs to the same concept as the technical scheme of the instrument panel identification and reading method. For details not described in detail in the technical scheme of the instrument panel identification and reading device, please refer to the description of the technical scheme of the instrument panel identification and reading method. In addition, each component in the device embodiment should be understood as a functional module that must be established to implement each step of the program flow or each step of the method, and each functional module is not an actual functional division or separation definition. The device claim defined by such a group of functional modules should be understood as a functional module architecture that mainly implements the solution through a computer program recorded in the specification, and should not be understood as a physical device that mainly implements the solution through hardware.
[0147] Figure 5 The block diagram of a computing device 500 provided according to an embodiment of the present application is shown. The components of the computing device 500 include but are not limited to a memory 510 and a processor 520. The processor 520 is connected to the memory 510 via a bus 530, and the database 550 is used to store data.
[0148] The computing device 500 also includes an access device 540 that enables the computing device 500 to communicate via one or more networks 560. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 540 may include one or more of any type of network interface (e.g., a network interface card (NIC)) that is wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a World Wide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like.
[0149] In one embodiment of the present application, the above components of the computing device 500 and Figure 5 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Figure 5 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of the present application. Those skilled in the art may add or replace other components as needed.
[0150] Computing device 500 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or PC. Computing device 500 may also be a mobile or stationary server.
[0151] The processor 520 is used to execute computer executable instructions for each step of the instrument panel identification and reading method.
[0152] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the above-mentioned instrument panel recognition and reading method belong to the same concept, and the details not described in detail in the technical scheme of the computing device can be referred to the description of the technical scheme of the above-mentioned instrument panel recognition and reading method.
[0153] An embodiment of the present application further provides a computer-readable storage medium storing computer instructions, which are used to execute the steps of the instrument panel identification and reading method when executed by a processor.
[0154] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the instrument panel recognition and reading method described above are of the same concept, and the details not described in detail in the technical scheme of the storage medium can be referred to the description of the technical scheme of the instrument panel recognition and reading method described above.
[0155] An embodiment of the present application further provides a chip storing a computer program, which implements the steps of the instrument panel recognition and reading method when executed by the chip.
[0156] The above describes specific embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0157] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0158] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described action sequence, because according to the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0159] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0160] The preferred embodiments of the present application disclosed above are only used to help explain the present application. The optional embodiments do not describe all the details in detail, nor do they limit the invention to the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the present application. The present application selects and specifically describes these embodiments in order to better explain the principles and practical applications of the present application, so that those skilled in the art can understand and use the present application well. The present application is only limited by the claims and their full scope and equivalents.
Claims
1. A method for identifying and reading an instrument panel, characterized in that: include: Intercepting a dashboard image contained in an input image, and identifying scale numbers and measurement units contained in the dashboard image; The center of the instrument panel is determined based on the instrument panel picture, and a pointer single-channel map, a scale line single-channel map and a key scale line single-channel map are constructed according to the instrument panel picture. Specifically, according to a preset segmentation algorithm, the pointer contained in the instrument panel picture is segmented to obtain the pointer single-channel map; according to the segmentation algorithm, the scale lines in the instrument panel picture that do not correspond to the scale numbers are segmented to obtain the scale line single-channel map; according to the segmentation algorithm, the scale lines in the instrument panel picture that correspond to the scale numbers are segmented to obtain the key scale line single-channel map; According to the center of the instrument panel and the single-channel diagram of the pointer, the position of the pointer vertex is determined, and according to the center of the instrument panel, the single-channel diagram of the scale lines and the single-channel diagram of the key scale lines, the scale position is determined. Specifically, the single-channel diagram of the scale lines is scanned around the center of the instrument panel to generate a rectangular diagram of scale lines; the single-channel diagram of the key scale lines is scanned around the center of the instrument panel to generate a rectangular diagram of key scale lines; based on a preset vertical projection method, the rectangular diagram of scale lines is compressed into a one-dimensional array of scale lines, and the rectangular diagram of key scale lines is compressed into a one-dimensional array of key scale lines; the scale position is determined based on the one-dimensional array of scale lines and the one-dimensional array of key scale lines; The input image is read according to the scale position, the scale number, the measurement unit and the pointer vertex position.
2. The method according to claim 1, characterized in that: The intercepting of the dashboard image contained in the input image includes: Based on a preset target detection algorithm, locate the position of the instrument panel in the input image; According to the position of the dashboard, a dashboard image included in the input image is captured.
3. The method according to claim 1, characterized in that The identifying the scale numbers and measurement units contained in the dashboard image includes: Using a preset target detection algorithm, locate the scale digits and measurement unit positions in the instrument panel image; Based on the position of the scale digits, the scale digits are determined by a preset character recognition algorithm; Based on the position of the measurement unit, the measurement unit is determined by the character recognition algorithm.
4. The method according to claim 1, characterized in that The determining the center of the dashboard based on the dashboard image includes: Segmenting the circular fixed axis contained in the dashboard image using a preset segmentation algorithm; The geometric center of the circular fixed axis is determined as the center of the instrument panel.
5. The method according to claim 1, characterized in that Determining the position of the pointer vertex according to the center of the instrument panel and the pointer single-channel graph includes: Scanning the pointer single channel diagram around the center of the instrument panel to generate a pointer rectangular diagram; Based on a preset vertical projection method, compressing the pointer rectangular map into a pointer one-dimensional array; The maximum value position in the one-dimensional array of pointers is determined as the pointer vertex position.
6. The method according to claim 5, characterized in that The step of scanning the pointer single channel graph around the center of the instrument panel to generate a pointer rectangular graph includes: Determine a bounding rectangle including the tick marks and key tick marks in the instrument panel image; The maximum vertical distance between the center of the instrument panel and each side of the circumscribed rectangle is used as the scanning radius; Superimposing the scale line single-channel graph and the key scale line single-channel graph to obtain a superimposed graph; Determine a blank area in the overlay image, and select a scanning starting point in the blank area; The pointer single channel diagram is scanned clockwise through the scanning starting point and the scanning radius to obtain the pointer rectangular diagram.
7. The method according to claim 1, characterized in that The determining the scale position based on the scale line one-dimensional array and the key scale line one-dimensional array includes: Determine a first scale line group including a plurality of scale line positions according to the one-dimensional array of scale lines; Determine a second scale line group of multiple key scale line positions according to the one-dimensional array of key scale lines; Determine a first mode of position differences between two adjacent scale lines in the first scale line group, and interpolate the first scale line group based on the first mode to obtain a first target scale line group; Determine a second mode of the position difference between two adjacent key scale lines in the second scale line group, and interpolate the second scale line group based on the second mode to obtain a second target scale line group, wherein the first target scale line group and the second target scale line group constitute the scale position.
8. The method according to claim 7, characterized in that The step of reading the input image according to the scale position, the scale number, the measurement unit and the pointer vertex position includes: Determine the scale line value corresponding to the pointer vertex position according to the pointer vertex position and the scale position; According to the scale line value and the scale number, the pointer value is determined, the measurement unit is combined, and the reading of the instrument panel image contained in the input image is read.
