CN113469162B - Pointer instrument identification method, device, equipment and medium based on double-scale segmentation - Google Patents

Pointer instrument identification method, device, equipment and medium based on double-scale segmentation Download PDF

Info

Publication number
CN113469162B
CN113469162B CN202110615116.6A CN202110615116A CN113469162B CN 113469162 B CN113469162 B CN 113469162B CN 202110615116 A CN202110615116 A CN 202110615116A CN 113469162 B CN113469162 B CN 113469162B
Authority
CN
China
Prior art keywords
detected
foreground
region
angle
value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110615116.6A
Other languages
Chinese (zh)
Other versions
CN113469162A (en
Inventor
柳贵东
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Baiyun University
Original Assignee
Guangdong Baiyun University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Baiyun University filed Critical Guangdong Baiyun University
Priority to CN202110615116.6A priority Critical patent/CN113469162B/en
Publication of CN113469162A publication Critical patent/CN113469162A/en
Application granted granted Critical
Publication of CN113469162B publication Critical patent/CN113469162B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01DMEASURING NOT SPECIALLY ADAPTED FOR A SPECIFIC VARIABLE; ARRANGEMENTS FOR MEASURING TWO OR MORE VARIABLES NOT COVERED IN A SINGLE OTHER SUBCLASS; TARIFF METERING APPARATUS; MEASURING OR TESTING NOT OTHERWISE PROVIDED FOR
    • G01D18/00Testing or calibrating apparatus or arrangements provided for in groups G01D1/00 - G01D15/00
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/136Segmentation; Edge detection involving thresholding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/194Segmentation; Edge detection involving foreground-background segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Image Analysis (AREA)

Abstract

The application relates to a pointer instrument reading method and device based on double-scale segmentation, computer equipment and a storage medium. The application can: the instrument scale lines and the pointer parameters of the pointer instrument are gradually and finely read through the image segmentation of two different scales, and compared with the traditional mode of reading through naked eyes and manually recording the dial parameters, the accuracy and the reading efficiency of the pointer instrument parameter reading are further improved. The method comprises the following steps: obtaining a dial image, identifying basic geometric parameters of a dial from the dial image, dividing a plurality of areas to be detected representing dial components from the dial image based on the basic geometric parameters, and calculating center coordinates of foreground objects in the areas to be detected and angles of the foreground objects one by one.

Description

Pointer instrument identification method, device, equipment and medium based on double-scale segmentation
Technical Field
The application relates to the technical field of intelligent instrument metering detection, in particular to a pointer instrument reading method and device based on double-scale segmentation, computer equipment and a storage medium.
Background
The industrial pointer instrument has the advantages of visual reading, easy maintenance, low cost, strong anti-interference performance and the like, and is widely used in the fields of steel, electric power, petroleum, chemical industry, medicine, video, light industry, building materials, nuclear power, aerospace, military industry and the like.
According to the regulations of the national quality and technology administration, the industrial pointer instrument needs to be regularly calibrated, and if the calibration is not qualified, the industrial pointer instrument cannot be used. At present, in pointer instrument verification operation, the pointer instrument is generally recognized through human eyesight, and is influenced by factors such as self quality, standing position and light of personnel in the recognizing and reading process, so that certain recognizing and reading errors are caused, and the detecting precision is not high enough.
Disclosure of Invention
Based on the foregoing, it is necessary to provide a pointer instrument reading method, apparatus, computer device and storage medium based on double-scale segmentation.
A pointer instrument reading method based on double-scale segmentation, the method comprising:
acquiring a dial image, and identifying basic geometric parameters of a dial in the dial image from the dial image;
based on the basic geometric parameters, a plurality of areas to be detected for representing dial components are segmented from the dial images;
and calculating the center coordinates of the foreground class objects in the multiple areas to be detected and the angles of the foreground class objects one by one.
In one embodiment, the calculating, one by one, the center coordinates of the foreground class objects and the angles of the foreground class objects in the plurality of areas to be detected includes:
determining the center coordinates and angles of foreground objects in the last region to be detected;
calculating the central coordinate approximation value and the angle approximation value of the foreground class object in the next region to be detected according to the central coordinate and the angle of the foreground class object in the last region to be detected;
calculating an object searching range of the next to-be-detected area based on the central coordinate approximation value and the angle approximation value of the foreground object in the next to-be-detected area;
determining a first filtering condition and a second filtering condition of the next region to be detected according to a first gray average value of a foreground object of the last region to be detected and a second gray average value of a background object of the last region to be detected;
and in the object searching range of the next to-be-detected area, identifying foreground objects and background objects in the next to-be-detected area according to the first filtering condition, the second filtering condition and the gray values of all pixels in the next to-be-detected area.
In one embodiment, the determining the center coordinates and angles of the foreground objects in the last to-be-detected area includes:
when the last region to be detected is the first region to be detected, acquiring a first center coordinate and a first angle as the center coordinate and the angle of the foreground object in the last region to be detected; the first center coordinates and the first angles are calculated according to preset initial search conditions.
In one embodiment, the identifying, in the object search range of the next to-be-detected area, the foreground object and the background object in the next to-be-detected area according to the first filtering condition, the second filtering condition and each pixel gray value in the next to-be-detected area includes:
in the object searching range of the next region to be detected, calculating the gray value of each pixel one by one; if the gray value of the pixel meets a first filtering condition, judging that the pixel belongs to a foreground class; if the gray value of the pixel meets a second filtering condition, judging that the pixel belongs to a background class;
taking all pixels belonging to a foreground class in the object searching range of the next region to be detected as a foreground whole, and calculating gray level gravity center position coordinates of the foreground whole and gray level average values of the foreground whole;
determining the angle of the whole foreground by combining a preset angle calculation formula based on the gray-scale gravity center position coordinates of the whole foreground;
and taking the gray-scale gravity center position coordinate of the whole foreground as the center coordinate of the whole foreground.
In one embodiment, the method further comprises:
the average gray level value of the foreground object in the last area to be detected is approximately used as a first classification threshold value in the next area to be detected;
approximating the gray average value of the background class object in the last region to be detected as a second classification threshold value in the next region to be detected;
and determining the first filtering condition and the second filtering condition according to the first classification threshold and the second classification threshold.
In one embodiment, the calculating the center coordinate approximation and the angle approximation of the foreground object in the next area to be detected according to the center coordinate and the angle of the foreground object in the last area to be detected includes:
calculating the distance from the center of the foreground whole in the last region to be detected to the center of the instrument based on the center coordinates of the foreground whole in the last region to be detected, and taking the distance as a reference distance;
approximating the reference distance as a distance estimation value from the center of the foreground object in the next area to be detected to the center of the instrument;
calculating an angle estimated value of a foreground object in the next region to be detected according to the angle and the angle increment of the whole foreground in the previous region to be detected;
and calculating the central coordinate approximation value of the foreground object in the area to be detected according to the distance estimation value and the angle estimation value.
In one embodiment, the angle increment is calculated according to the angle of the whole foreground in the last to-be-detected area and the angle of the whole foreground in the adjacent last to-be-detected area.
A pointer instrument reader based on dual-scale segmentation, the device comprising:
the image acquisition module is used for acquiring a dial image and identifying basic geometric parameters of the dial in the dial image from the dial image;
the first scale segmentation module is used for segmenting a plurality of areas to be detected representing dial components from the dial image based on the basic geometric parameters;
the second scale segmentation module is used for segmenting a plurality of areas to be detected representing dial components from the dial image based on the basic geometric parameters.
A computer device comprising a memory storing a computer program and a processor implementing the steps of the two-scale segmentation based pointer instrument identification method embodiments described above when the computer program is executed.
A computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of the pointer meter reading method embodiments based on two-scale segmentation as described above.
The pointer instrument reading method, the device, the computer equipment and the storage medium based on the double-scale segmentation are characterized in that the basic geometric parameters of the dial are identified from the dial image by acquiring the dial image, the multiple areas to be detected representing the dial components are segmented from the dial image based on the basic geometric parameters, the first image segmentation is performed, and then the center coordinates of foreground objects and the angles of the foreground objects in the multiple areas to be detected are calculated one by one, and the second image segmentation is performed. According to the method, the instrument scale lines and the pointer parameters of the pointer instrument are read in a stepwise and refined mode through image segmentation of two different scales, and compared with a traditional mode of reading by naked eyes and manually recording dial parameters, the accuracy and the reading efficiency of the pointer instrument parameter reading are further improved.
Drawings
FIG. 1 is an application environment diagram of a pointer instrument identification method based on double-scale segmentation in one embodiment;
FIG. 2 is a flow chart of a pointer instrument reading method based on dual-scale segmentation in one embodiment;
FIG. 3 is a schematic diagram of the structure of a pointer instrument in one embodiment;
FIG. 4 is a schematic diagram of a second scale division process in one embodiment;
FIG. 5 is a block diagram of a pointer instrument reader based on dual scale segmentation in one embodiment;
fig. 6 is an internal structural diagram of a computer device in one embodiment.
Detailed Description
The present application will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present application more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
The pointer instrument reading method based on the double-scale segmentation can be applied to an application environment shown in fig. 1. Wherein the terminal 101 communicates with the server 102 via a network. The terminal 101 may be various devices with an imaging lens or a scanning device, and the server 102 may be implemented by a stand-alone server or a server cluster formed by a plurality of servers.
In one embodiment, as shown in fig. 2, a pointer instrument reading method based on dual-scale segmentation is provided, and the method is applied to the server 102 in fig. 1 for illustration, and includes the following steps:
step S201, obtaining a dial image, and identifying basic geometric parameters of a dial from the dial image;
the basic geometric parameters of the dial plate refer to parameters such as the central coordinates of the instrument, the diameter of the instrument, the angle spacing of scale marks and the like of the pointer instrument.
Specifically, the terminal 101 photographs or scans a dial image of a pointer-type meter, and then transmits the dial image to the server 102, and the server 102 recognizes basic geometric parameters of the dial, including a meter center coordinate, a meter diameter, a scale line angle pitch, and the like, from the dial image.
Step S202, dividing a plurality of areas to be detected for representing dial components from the dial image based on the basic geometric parameters;
the dial components refer to the scale marks and pointers of the pointer instrument.
Specifically, as shown in fig. 3, fig. 3 shows a schematic structural diagram of the pointer instrument, and the server 102 divides a plurality of areas to be detected from the dial image based on the basic geometric parameters by using an image double-scale division algorithm, where each area to be detected includes a dial component, for example, a rectangular frame including scale marks in fig. 3 is the area to be detected.
Step S203, calculating the center coordinates of the foreground class objects and the angles of the foreground class objects in the multiple areas to be detected one by one.
The foreground object refers to a scale line or a pointer in the dial image.
Specifically, the server 102 identifies the foreground objects, i.e. the graduation lines or pointers, from the to-be-detected area one by one through the second image segmentation, and calculates the center coordinates of the foreground objects and the angles of the foreground objects in the dial.
According to the embodiment, the instrument scale line and the pointer parameter of the pointer instrument are gradually and finely read through the image segmentation of two different scales, the dial parameter is read through naked eyes and manually recorded by a traditional reading method, the scale line can be regarded as a one-dimensional straight line under the visual angle of the human eyes, and the scale line can be regarded as a two-dimensional rectangle with a large number of pixels gathered under the visual angle of a computer, so that the central coordinate of the two-dimensional rectangle can be identified, and the method is finer than the reading of the pointer instrument parameter, and the accuracy and the reading efficiency of the pointer instrument parameter are further improved; the actual effect shows that the method can accurately read the pressure indication value, the indication value reading precision is 1/20 graduation value under the condition that the image pixels are 640 multiplied by 480, the limit precision of the vision reading instrument is 1/4 of the limit precision of the vision reading instrument, the instrument can be rapidly read, the reading speed can reach 0.02s, and the vision reading time is 1/20 of the vision reading time.
In an embodiment, as shown in fig. 4, fig. 4 is a schematic diagram of a second scale division process, and step S203 includes:
step S401, determining the center coordinates and angles of foreground objects in the last region to be detected;
specifically, when the last region to be detected is the first region to be detected, acquiring a first center coordinate and a first angle as the center coordinate and the angle of a foreground object in the first region to be detected; the first center coordinates and the first angles are calculated according to preset initial search conditions.
The following description will take the first area to be detected as an example: first, a foreground object such as a scale line L in a first region to be detected is obtained 0 Comprises: (1) the search range (x 0,min ,y 0,min ),(x 0,max ,y 0,max ) The method comprises the steps of carrying out a first treatment on the surface of the (2) A first classification threshold, i.e. the tick mark grey threshold T 0,scale The method comprises the steps of carrying out a first treatment on the surface of the (3) A second classification threshold, i.e. the background grey threshold T 0,background The method comprises the steps of carrying out a first treatment on the surface of the (4) The included angle of the adjacent graduation marks is delta theta; (5) the tick mark length is Deltal.
The current search conditions are: let the current scale mark search range be (x) now,min ,y now,min ),(x now,max ,y now,max ) The current first classification threshold (i.e., tick mark grey threshold) is T now,scale The current second classification threshold (i.e., background classification threshold) is T now,background
Assigning the preset initial search condition to the current search condition:
x now,min =x 0,min ,x now,max =x 0,max ,y now,min =y 0,min ,y now,max =y 0,max (1)
T now,scale =T 0,scale ,T now,background =T 0,background (2)
Will (x) now,min ,y now,min ),(x now,max ,y now,max ) The pixels in the determined rectangle (i.e. the region to be detected) are divided into two classes according to the difference of gray values, and are respectively defined as foreground CLASS objects CLASS now,scale (including pointers and tick marks) and a background CLASS object CLASS now,background For the ith pixel P in the area to be detected now.i If the gray value GV thereof now.i The first filtering condition is satisfied:
then it is determined that the pixel belongs to the foreground class:
wherein alpha is a scale mark or pointer filter factor, n now,scale To find out the object CLASS belonging to the foreground CLASS in the searching process of the current scale line or pointer now,scale Number of pixels.
If the gray value GV thereof now.i The second filtering condition is satisfied:
then it is determined that the pixel belongs to the background class:
where β is the background filter factor.
Computing foreground CLASS object CLASS now,scale Gray scale barycentric coordinates (x) now,G ,y now,G ) And a gray average GV scale,average Wherein, the method comprises the steps of, wherein,
wherein GV now.x,y Is pixel P now.i Is used for the gray-scale value of (c),will (x) now,G ,y now,G ) Coordinate approximation value approximately as foreground class object, for example, scale line center +.>
The angle of the current foreground object (scale line or pointer) in the coordinate system with the center of the instrument as the origin is theta now,scale
Wherein, (x) ins,center ,y ins,center ) Is the central coordinate of the dial plate.
Step S402, calculating a central coordinate approximation value and an angle approximation value of the foreground object in the next region to be detected according to the central coordinate and the angle of the foreground object in the last region to be detected.
Wherein the last region to be detected and the next region to be detected are two adjacent regions to be detected.
Specifically, the gray-scale barycentric coordinates (x next,G ,y next,G ) To the centre of the meter (x) center ,y center ) Is the distance estimation value of (2)D now Is the barycentric coordinates (x) of the foreground class object in the last region to be detected now,G ,y nowt,G ) To the centre of the meter (x) center ,y center ) I.e. the reference distance:
calculating the angle approximation value of the next foreground object in the coordinate system taking the center of the instrument as the originThe method comprises the following steps:
Δθ now =θ now,scaleformer,scale (12)
Wherein θ now,scale Is the angle of the last foreground class object, θ former,scale Is the angle of the last foreground class object.
Calculating the approximate value of the center coordinates of the next foreground objectThe method comprises the following steps:
step S403, calculating an object search range of a next to-be-detected area based on a center coordinate approximation value and an angle approximation value of a foreground object in the next to-be-detected area;
specifically, the object search range of the next region to be detected isWherein,,
wherein Deltal is the length of the graduation mark.
Step S404, determining a first filtering condition and a second filtering condition of a next region to be detected according to a first gray average value of a foreground object of the previous region to be detected and a second gray average value of a background object of the previous region to be detected;
specifically, a first classification threshold value in the next region to be detected is calculated first
Wherein GV scale,average The first gray average value of the foreground object in the last region to be detected;
calculating a second classification threshold value in the next region to be detected
Wherein GV background,average CLASS for the last background CLASS object now,background Is the pixel gray average value of (a):
in the above, GV now.x,y Is pixel P now.i Is used for the gray-scale value of (c),
according toThe first filter condition and the second filter condition are determined in combination with the above equations (3), (4).
In step S405, in the object search range of the next to-be-detected area, the foreground object and the background object in the next to-be-detected area are identified according to the first filtering condition, the second filtering condition and the gray values of each pixel in the next to-be-detected area.
Specifically, let:
x now,min =x next,min ,x now,max =x next,max ,y now,min =y next,min ,y now,max =y next,max (22)
T now,scale =T next,scale ,T now,background =T next,background (23)
And (3) calculating according to the formulas (3) - (9), identifying the foreground class object and the background class object in the next area to be detected, and calculating the center coordinates and angles of the foreground class object.
According to the embodiment, the first classification threshold and the second classification threshold of the to-be-detected area are calculated in each to-be-detected area, so that even if the light distribution of the dial image is uneven, the foreground objects and the background objects can be adaptively distinguished, and the automatic recognition efficiency of the dial is further improved.
In an embodiment, the step S405 includes: in the object searching range of the next region to be detected, calculating the gray value of each pixel one by one; if the gray value of the pixel meets the first filtering condition, judging that the pixel belongs to the foreground class; if the gray value of the pixel meets the second filtering condition, judging that the pixel belongs to the background class; taking all pixels belonging to foreground class in the object searching range of the next region to be detected as a foreground whole, and calculating gray level barycenter position coordinates of the foreground whole and gray level average value of the foreground whole; determining the angle of the whole foreground by combining a preset angle calculation formula based on the gray-scale gravity center position coordinates of the whole foreground; and taking the gray-scale gravity center position coordinate of the whole foreground as the center coordinate of the whole foreground.
The implementation process of this step is shown in the above formulas (3) - (9), and will not be described here again, wherein the preset angle calculation formula is shown in the above formula (9).
According to the embodiment, the gray-scale gravity center coordinates of the foreground object are calculated through the gray values in the region to be detected, and the gray-scale gravity center coordinates are used as the scale marks or the pointer centers, so that the pixel level search is realized, and the instrument reading precision is further improved.
In an embodiment, the method further includes: the average gray level value of the foreground object in the last region to be detected is approximately used as a first classification threshold value in the next region to be detected; the gray average value of the background class object in the last region to be detected is approximately used as a second classification threshold value in the next region to be detected; the first filtering condition and the second filtering condition are determined according to the first classification threshold and the second classification threshold.
The implementation process of this step is shown in formulas (19) - (21) and formulas (3) - (4), and will not be described here again.
According to the embodiment, the first classification threshold value and the second classification threshold value are dynamically planned, so that the scale marks and the pointers of different areas on the dial plate can be adaptively read, and the intelligent level of reading of the instrument is improved.
In an embodiment, the step S402 includes: calculating the distance from the center of the foreground whole in the last to-be-detected area to the center of the instrument based on the center coordinates of the foreground whole in the last to-be-detected area, and taking the distance as a reference distance; the reference distance is approximately used as a distance estimated value from the center of the foreground object in the next area to be detected to the center of the instrument; calculating an angle estimated value of a foreground object in the next region to be detected according to the overall angle and the angle increment of the foreground in the previous region to be detected; and calculating the central coordinate approximation value of the foreground object in the area to be detected according to the distance estimation value and the angle estimation value.
Specifically, the implementation of the above steps is shown in the above formulas (10) - (14), and will not be repeated here.
In the above embodiment, the geometric parameter approximation value of the next foreground object is estimated by the geometric parameter of the previous foreground object, so that the search range of the next region to be detected can be obtained, and a data pad is provided for further accurate search.
In an embodiment, the angle increment is calculated according to an angle of the whole foreground in the previous detection area and an angle of the whole foreground in an adjacent previous detection area of the previous detection area.
Specifically, the above angle increment is Δθ now The calculation process is shown in the formula (12), theta now,scale Is the angle of the last foreground class object, θ former,scale Is the angle of the last foreground class object.
The above embodiment provides a data base for further determining the search range of the next area to be detected by determining the angular approximation of the next tick mark or pointer using the angular increment.
It should be understood that, although the steps in the flowcharts of fig. 1-4 are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in FIGS. 1-4 may include multiple steps or stages that are not necessarily performed at the same time, but may be performed at different times, nor do the order in which the steps or stages are performed necessarily performed in sequence, but may be performed alternately or alternately with at least a portion of the steps or stages in other steps or other steps.
In one embodiment, as shown in fig. 5, there is provided a pointer instrument reading apparatus 500 based on dual-scale segmentation, including: an image acquisition module 501, a first scale segmentation module 502, and a second scale segmentation module 503, wherein:
the image acquisition module 501 is used for acquiring a dial image, and identifying basic geometric parameters of a dial from the dial image;
the first scale segmentation module 502 is configured to segment a plurality of areas to be detected, which characterize a dial component, from the dial image based on the basic geometric parameter;
and the second scale segmentation module 503 is configured to segment a plurality of areas to be detected, which characterize a dial component, from the dial image based on the basic geometric parameter.
In an embodiment, the second scale division module 503 is further configured to: determining the center coordinates and angles of foreground objects in the last region to be detected; calculating the central coordinate approximation value and the angle approximation value of the foreground class object in the next region to be detected according to the central coordinate and the angle of the foreground class object in the last region to be detected; calculating an object searching range of the next to-be-detected area based on the central coordinate approximation value and the angle approximation value of the foreground object in the next to-be-detected area; determining a first filtering condition and a second filtering condition of the next region to be detected according to a first gray average value of a foreground object of the last region to be detected and a second gray average value of a background object of the last region to be detected; and in the object searching range of the next to-be-detected area, identifying foreground objects and background objects in the next to-be-detected area according to the first filtering condition, the second filtering condition and the gray values of all pixels in the next to-be-detected area.
In an embodiment, the method further includes an initial search condition determining unit, configured to obtain, when the previous to-be-detected area is a first to-be-detected area, a first center coordinate and a first angle as a center coordinate and an angle of a foreground object in the previous to-be-detected area; the first center coordinates and the first angles are calculated according to preset initial search conditions.
In an embodiment, the second scale division module 503 is further configured to: in the object searching range of the next region to be detected, calculating the gray value of each pixel one by one; if the gray value of the pixel meets a first filtering condition, judging that the pixel belongs to a foreground class; if the gray value of the pixel meets a second filtering condition, judging that the pixel belongs to a background class; taking all pixels belonging to a foreground class in the object searching range of the next region to be detected as a foreground whole, and calculating gray level gravity center position coordinates of the foreground whole and gray level average values of the foreground whole; determining the angle of the whole foreground by combining a preset angle calculation formula based on the gray-scale gravity center position coordinates of the whole foreground; and taking the gray-scale gravity center position coordinate of the whole foreground as the center coordinate of the whole foreground.
In an embodiment, the method further comprises a classification condition determining unit for: the average gray level value of the foreground object in the last area to be detected is approximately used as a first classification threshold value in the next area to be detected; approximating the gray average value of the background class object in the last region to be detected as a second classification threshold value in the next region to be detected; and determining the first filtering condition and the second filtering condition according to the first classification threshold and the second classification threshold.
In an embodiment, the second scale division module 503 is further configured to: calculating the distance from the center of the foreground whole in the last region to be detected to the center of the instrument based on the center coordinates of the foreground whole in the last region to be detected, and taking the distance as a reference distance; approximating the reference distance as a distance estimation value from the center of the foreground object in the next area to be detected to the center of the instrument; calculating an angle estimated value of a foreground object in the next region to be detected according to the angle and the angle increment of the whole foreground in the previous region to be detected; and calculating the central coordinate approximation value of the foreground object in the area to be detected according to the distance estimation value and the angle estimation value.
In an embodiment, the angle increment is calculated according to an angle of the whole foreground in the previous detection area and an angle of the whole foreground in an adjacent previous detection area of the previous detection area.
For specific limitation of the pointer instrument reading device based on the dual-scale segmentation, reference may be made to the limitation of the pointer instrument reading method based on the dual-scale segmentation hereinabove, and the description thereof will not be repeated here. All or part of each module in the pointer instrument reading device based on the double-scale segmentation can be realized by software, hardware and a combination thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 6. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer equipment is used for storing the data of the instrument image, the geometric parameters, the calculated intermediate quantity and the like. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program, when executed by a processor, implements a pointer instrument reading method based on double-scale segmentation.
It will be appreciated by those skilled in the art that the structure shown in FIG. 6 is merely a block diagram of some of the structures associated with the present inventive arrangements and is not limiting of the computer device to which the present inventive arrangements may be applied, and that a particular computer device may include more or fewer components than shown, or may combine some of the components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory and a processor, the memory having stored therein a computer program, which when executed by the processor performs the steps of the two-scale segmentation based pointer meter reading method embodiments described above.
In one embodiment, a computer readable storage medium is provided, on which a computer program is stored which, when executed by a processor, implements the steps of the two-scale segmentation based pointer meter reading method embodiments described above.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, or the like. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory. By way of illustration, and not limitation, RAM can be in the form of a variety of forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), and the like.
The technical features of the above embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples illustrate only a few embodiments of the application, which are described in detail and are not to be construed as limiting the scope of the application. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the application, which are all within the scope of the application. Accordingly, the scope of protection of the present application is to be determined by the appended claims.

Claims (10)

1. The pointer instrument reading method based on the double-scale segmentation is characterized by comprising the following steps of:
acquiring a dial image, and identifying basic geometric parameters of a dial from the dial image;
based on the basic geometric parameters, a plurality of areas to be detected for representing dial components are segmented from the dial images;
determining the center coordinates and angles of foreground objects in the last region to be detected;
calculating the central coordinate approximation value and the angle approximation value of the foreground class object in the next region to be detected according to the central coordinate and the angle of the foreground class object in the last region to be detected;
calculating an object searching range of the next to-be-detected area based on the central coordinate approximation value and the angle approximation value of the foreground object in the next to-be-detected area;
determining a first filtering condition and a second filtering condition of the next region to be detected according to a first gray average value of a foreground object of the last region to be detected and a second gray average value of a background object of the last region to be detected;
and in the object searching range of the next to-be-detected area, identifying foreground objects and background objects in the next to-be-detected area according to the first filtering condition, the second filtering condition and the gray values of all pixels in the next to-be-detected area.
2. The method of claim 1, wherein determining the center coordinates and angles of foreground class objects within the last region to be detected comprises:
when the last region to be detected is the first region to be detected, acquiring a first center coordinate and a first angle as the center coordinate and the angle of the foreground object in the last region to be detected; the first center coordinates and the first angles are calculated according to preset initial search conditions.
3. The method according to claim 1, wherein the identifying foreground class objects and background class objects in the next region to be detected within the object search range of the next region to be detected according to the first filtering condition, the second filtering condition, and each pixel gray value in the next region to be detected includes:
in the object searching range of the next region to be detected, calculating the gray value of each pixel one by one; if the gray value of the pixel meets a first filtering condition, judging that the pixel belongs to a foreground class; if the gray value of the pixel meets a second filtering condition, judging that the pixel belongs to a background class;
taking all pixels belonging to a foreground class in the object searching range of the next region to be detected as a foreground whole, and calculating gray level gravity center position coordinates of the foreground whole and gray level average values of the foreground whole;
determining the angle of the whole foreground by combining a preset angle calculation formula based on the gray-scale gravity center position coordinates of the whole foreground;
and taking the gray-scale gravity center position coordinate of the whole foreground as the center coordinate of the whole foreground.
4. A method according to claim 3, characterized in that the method further comprises:
the average gray level value of the foreground object in the last area to be detected is approximately used as a first classification threshold value in the next area to be detected;
approximating the gray average value of the background class object in the last region to be detected as a second classification threshold value in the next region to be detected;
and determining the first filtering condition and the second filtering condition according to the first classification threshold and the second classification threshold.
5. The method according to claim 1, wherein calculating the center coordinate approximation and the angle approximation of the foreground class object in the next region to be detected according to the center coordinates and the angles of the foreground class object in the previous region to be detected comprises:
calculating the distance from the center of the foreground whole in the last region to be detected to the center of the instrument based on the center coordinates of the foreground whole in the last region to be detected, and taking the distance as a reference distance;
approximating the reference distance as a distance estimation value from the center of the foreground object in the next area to be detected to the center of the instrument;
calculating an angle estimated value of a foreground object in the next region to be detected according to the angle and the angle increment of the whole foreground in the previous region to be detected;
and calculating the central coordinate approximation value of the foreground object in the area to be detected according to the distance estimation value and the angle estimation value.
6. The method of claim 5, wherein the angular increment is calculated from an angle of a foreground entirety in a last region to be detected and an angle of a foreground entirety in an adjacent last region to be detected.
7. Pointer instrument recognition device based on two scale segmentation, characterized in that, the device includes:
the image acquisition module is used for acquiring dial images and identifying basic geometric parameters of the dial from the dial images;
the first scale segmentation module is used for segmenting a plurality of areas to be detected representing dial components from the dial image based on the basic geometric parameters;
the second scale segmentation module is used for determining the center coordinates and angles of the foreground objects in the last region to be detected; calculating the central coordinate approximation value and the angle approximation value of the foreground class object in the next region to be detected according to the central coordinate and the angle of the foreground class object in the last region to be detected; calculating an object searching range of the next to-be-detected area based on the central coordinate approximation value and the angle approximation value of the foreground object in the next to-be-detected area; determining a first filtering condition and a second filtering condition of the next region to be detected according to a first gray average value of a foreground object of the last region to be detected and a second gray average value of a background object of the last region to be detected; and in the object searching range of the next to-be-detected area, identifying foreground objects and background objects in the next to-be-detected area according to the first filtering condition, the second filtering condition and the gray values of all pixels in the next to-be-detected area.
8. The apparatus according to claim 7, wherein the pointer instrument recognition apparatus based on the two-scale segmentation further comprises an initial search condition determining unit, configured to obtain a first center coordinate and a first angle as a center coordinate and an angle of a foreground object in the previous region to be detected when the previous region to be detected is a first region to be detected; the first center coordinates and the first angles are calculated according to preset initial search conditions.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any of claims 1 to 6 when the computer program is executed.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 6.
CN202110615116.6A 2021-06-02 2021-06-02 Pointer instrument identification method, device, equipment and medium based on double-scale segmentation Active CN113469162B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110615116.6A CN113469162B (en) 2021-06-02 2021-06-02 Pointer instrument identification method, device, equipment and medium based on double-scale segmentation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110615116.6A CN113469162B (en) 2021-06-02 2021-06-02 Pointer instrument identification method, device, equipment and medium based on double-scale segmentation

Publications (2)

Publication Number Publication Date
CN113469162A CN113469162A (en) 2021-10-01
CN113469162B true CN113469162B (en) 2023-09-26

Family

ID=77872135

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110615116.6A Active CN113469162B (en) 2021-06-02 2021-06-02 Pointer instrument identification method, device, equipment and medium based on double-scale segmentation

Country Status (1)

Country Link
CN (1) CN113469162B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105741307A (en) * 2016-03-03 2016-07-06 深圳元启智能技术有限公司 Method for automatically identifying reading of pointer type pressure meter
CN106951900A (en) * 2017-04-13 2017-07-14 杭州申昊科技股份有限公司 A kind of automatic identifying method of arrester meter reading
CN109255344A (en) * 2018-08-15 2019-01-22 华中科技大学 A kind of digital display instrument positioning and Recognition of Reading method based on machine vision

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105741307A (en) * 2016-03-03 2016-07-06 深圳元启智能技术有限公司 Method for automatically identifying reading of pointer type pressure meter
CN106951900A (en) * 2017-04-13 2017-07-14 杭州申昊科技股份有限公司 A kind of automatic identifying method of arrester meter reading
CN109255344A (en) * 2018-08-15 2019-01-22 华中科技大学 A kind of digital display instrument positioning and Recognition of Reading method based on machine vision

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于改进Hough变换的指针仪表表盘识读系统研究;王佳颖 等;《电子世界》(23);第110-112页 *

Also Published As

Publication number Publication date
CN113469162A (en) 2021-10-01

Similar Documents

Publication Publication Date Title
CN109993166B (en) Automatic reading identification method for pointer instrument based on scale searching
EP2843590B1 (en) System and method for package dimensioning
KR102688955B1 (en) Positioning method and device, storage medium
CN111814740B (en) Pointer instrument reading identification method, device, computer equipment and storage medium
CN111047640B (en) Volumetric flask volume calibration method and device, terminal equipment and storage medium
CN111444964B (en) Multi-target rapid image matching method based on adaptive ROI (region of interest) division
CN111259890A (en) Water level identification method, device and equipment of water level gauge
CN111368906A (en) Pointer type oil level indicator reading identification method based on deep learning
CN113256729A (en) External parameter calibration method, device, equipment and storage medium for laser radar and camera
CN114862929A (en) Three-dimensional target detection method and device, computer readable storage medium and robot
CN112966711A (en) Pointer instrument indicating number identification method and system based on convolutional neural network
CN112991459A (en) Camera calibration method, device, equipment and storage medium
CN113469162B (en) Pointer instrument identification method, device, equipment and medium based on double-scale segmentation
CN113050022B (en) Image positioning method and device based on rotary antenna and terminal equipment
CN112504156A (en) Structural surface strain measurement system and measurement method based on foreground grid
CN112836726A (en) Pointer instrument indication reading method and device based on video information
CN112990190A (en) Method and device for identifying reading of pointer instrument
CN115588196A (en) Pointer type instrument reading method and device based on machine vision
CN115683046A (en) Distance measuring method, distance measuring device, sensor and computer readable storage medium
CN113610086A (en) Reading correction method and device for vertical-scale pointer instrument and terminal equipment
CN114022873A (en) Instrument state detection method, electronic device and storage medium
CN113920305A (en) Lightning arrester instrument identification method and device
CN113608207A (en) Blast furnace burden surface shape measuring method, terminal equipment and storage medium
CN113250914A (en) 2D displacement measurement method, system, equipment and storage medium for cabin tower top
CN112417975A (en) Method and device for obtaining reading of pointer instrument

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant