CN112036393B - Shale gas field production single pointer instrument reading based identification method - Google Patents

Shale gas field production single pointer instrument reading based identification method Download PDF

Info

Publication number
CN112036393B
CN112036393B CN202010713388.5A CN202010713388A CN112036393B CN 112036393 B CN112036393 B CN 112036393B CN 202010713388 A CN202010713388 A CN 202010713388A CN 112036393 B CN112036393 B CN 112036393B
Authority
CN
China
Prior art keywords
boundary
image
pointer
instrument
rectangle
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
CN202010713388.5A
Other languages
Chinese (zh)
Other versions
CN112036393A (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.)
Chengdu Chuanyou Ruifei Technology Co ltd
Sichuan Changning Natural Gas Development Co ltd
Original Assignee
Chengdu Chuanyou Ruifei Technology Co ltd
Sichuan Changning Natural Gas Development Co ltd
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 Chengdu Chuanyou Ruifei Technology Co ltd, Sichuan Changning Natural Gas Development Co ltd filed Critical Chengdu Chuanyou Ruifei Technology Co ltd
Priority to CN202010713388.5A priority Critical patent/CN112036393B/en
Publication of CN112036393A publication Critical patent/CN112036393A/en
Application granted granted Critical
Publication of CN112036393B publication Critical patent/CN112036393B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/22Image preprocessing by selection of a specific region containing or referencing a pattern; Locating or processing of specific regions to guide the detection or recognition
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/56Extraction of image or video features relating to colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V2201/00Indexing scheme relating to image or video recognition or understanding
    • G06V2201/02Recognising information on displays, dials, clocks

Abstract

The invention discloses an identification method based on single pointer instrument readings in shale gas field production, which relates to the field of intelligent instrument identification, and is characterized in that a relatively blurred mechanical instrument dial image shot by a camera of a production site is converted from an RGB space to an HSV space, then V channel data of the image space are circularly traversed, and the spot boundary under each V value is detected and searched; then constructing a central rectangle of the mechanical instrument sub-image, and filtering the formed pattern spot boundary; then, the aspect ratio constraint is carried out on the filtered map spot boundary, the map spot boundary contains the central rectangular central point constraint, and then the positioning of the pointer boundary of the mechanical instrument is carried out; and finally, performing straight line fitting and deflection angle calculation on the searched pointer boundary, calculating meter reading, and realizing the direct use of a monitoring camera of a production site to read the data of a mechanical meter dial.

Description

Shale gas field production single pointer instrument reading based identification method
Technical Field
The invention relates to the field of intelligent instrument identification, in particular to an identification method based on single pointer instrument readings in shale gas field production.
Background
As shale gas production capacity continues to increase, more and more unmanned inspection shale gas production platforms can be put into production sites. At present, a plurality of single-pointer mechanical meters are arranged in a platform well which is critical to a shale gas production site, intelligent electronic equipment is not connected with the mechanical meters, readings cannot be directly and remotely returned to a rear-end online platform, the existing production site generally adopts manual inspection, and the readings are then transmitted to the rear-end online platform through a terminal online platform, so that the labor cost is high, and the data cannot be read at any time in real time.
And the shale gas production site is provided with cameras, and each camera can be provided with 256 preset positions at most for quickly looking up on-site production equipment. At present, all preset positions on the scene are in an empty state, the camera is only used for temporarily checking the scene condition, the rest time is in a non-recording monitoring state, and the utilization efficiency of the camera is greatly improved.
In the prior art, a plurality of data identification technologies aiming at meters exist, but the data identification technologies are generally built on the basis that the meter data shot by a camera are clear, and because the monitoring camera of the shale gas production site mainly plays a role in monitoring, the problem of a monitoring range is mainly considered during installation, the data are not only opposite to a mechanical meter, but also the single pointer meter picture of the shale gas production site acquired by the camera is comprehensively influenced by factors such as different rotation angles, different time, illumination of different weather images, different shooting distances, meter panels of different sizes, meter panels of different types and the like of the camera, the definition of the photo is generally not high, the factors of the production site are not considered in the method disclosed in the prior art, and if the prior art is directly used for identifying the meter of the shale gas production site, the identification effect is not ideal.
Disclosure of Invention
The invention aims at: the method is used for processing images of the mechanical instrument with low definition, which are acquired by using a monitoring camera of a production site, and performing computer vision analysis on a mechanical instrument dial, so that the reading of the instrument is accurately identified, the mechanical instrument data is read by utilizing the camera to cooperate with an on-line background, the image with low definition, which is acquired by the camera, can be accurately identified, and the problem that the reading in the instrument image with low definition cannot be accurately identified by the existing data identification technology for the instrument is solved.
The technical scheme adopted by the invention is as follows:
the identification method based on the shale gas field production single pointer instrument reading mainly comprises the following steps in sequence:
step 1, capturing an image: detecting and positioning the position of a mechanical instrument in the snap image by using a mechanical instrument model trained by deep learning, intercepting sub-images of the instrument, and performing computer vision analysis of the mechanical instrument;
step 2, image preprocessing: performing image preprocessing on the intercepted mechanical instrument sub-images, and performing image resampling;
step 3, filtering the images: transferring the resampled image from the RGB space to the HSV space, performing cyclic traversal on the V channel data of the image space, and detecting and searching the image spot boundary under each V value;
step 4, constructing a center rectangle: constructing a center rectangle of the mechanical instrument sub-image, and filtering the pattern spot boundary formed in the step 3 by using the constructed center rectangle;
step 5, positioning a meter pointer: performing length-width ratio constraint on the filtered map spot boundary, wherein the map spot boundary comprises central rectangular central point constraint, and then positioning a pointer boundary of a mechanical instrument;
step 6, pointer degree identification: and (3) performing straight line fitting and deflection angle calculation on the searched pointer boundary, determining the rotation angle of the straight line, and calculating the meter reading by combining the initial measuring range of the meter.
The existing data identification technology for the instrument is generally established on the basis that the image data of the instrument shot by a camera is clear, and the monitoring camera of the shale gas production site mainly plays a role in monitoring, so that the problem of a monitoring range is mainly considered during installation, the mechanical instrument cannot be faced only, the image of the mechanical instrument shot by the camera is fuzzy, the images shot by the existing monitoring camera are difficult to identify in the prior art, and the invention mainly aims at the problem.
When the instrument image is processed, the method adopts the steps, wherein the resampling in the step 2 extracts the instrument dial in the mechanical instrument sub-image; in the step 3, the resampled image is changed from the RGB space to the HSV space, and objects with certain colors are easier to track than the RGB color space in the HSV color space, and for the blurred dial plate image, although the hands and the dial plate are hard to distinguish by human eyes, the chromaticity H of the hands and the dial plate are actually quite different, but the brightness V values of the hands and the dial plate are similar, so that the hands are easy to find from the dial plate from the H value according to the characteristic that the H values of the dial plate and the hands are quite different. According to the scheme, the map spot boundaries under different V values are traversed, experience proves that the outline of the meter pointer is related to the V channel, the variable is traversed circularly, an ideal target image is selected, the key ring of the pointer is automatically identified, and the quality of the target image determines whether the subsequent meter reading can be successfully identified.
In the step 4, the center rectangle of the instrument is constructed by taking the center of the resampled image as a new rectangle center and taking half of the side length of the image as the side length of the rectangle, so that the problem of searching the pointer of the whole image is converted into the problem of searching the pointer in the rectangle. The method can reduce the searching range of the pointer and make the foreground and background of the pointer distinguished obviously.
And 5, carrying out boundary searching and positioning on the filtered image to position a pointer of the instrument, generating a minimum circumscribed rectangle of the pointer boundary, carrying out length-width ratio constraint on the generated minimum circumscribed rectangle and the map spot boundary containing central rectangular center point constraint, and finding the pointer boundary meeting the condition when the length-width ratio constraint and the map spot boundary containing central rectangular center point constraint meet the preset constraint condition. And then filtering the boundaries, wherein the selected boundaries fall in the central rectangle. And sequencing the inner boundaries of the center rectangle, wherein the boundary with the largest pixel is the pointer boundary.
And finally, performing straight line fitting and deflection angle calculation on the searched pointer boundary, fitting the straight line of the pointer through the straight line, determining the rotation angle of the fitted straight line, determining the rotation angle of the pointer, and calculating the meter reading by combining the initial measuring range of the corresponding meter.
Further, the step 3 mainly comprises the following steps performed in sequence:
step 3-1: transferring the resampled image from RGB space to HSV space;
step 3-2: and (3) performing cyclic traversal on the V value of the HSV image space from 80 to 230, and performing boundary judgment and search on each image 150 times to search the boundary of the image spot.
In different application scenes, the HSV value ranges are different, the invention selects the image type by using the cvSplit function in the openCV, the H value range is 0-180, the S value range is 0-255, the V value range is 0-255, and the error range of the spot boundary when the V value is too large and too small is too large, so that we select a V value range of an intermediate range for cycle traversal, and here we select the V value range from 80 to 230.
The common characteristics of the images are abstracted by analyzing instrument images under the conditions of different rotation angles, different times, illumination of different weather images, different shooting distances, instrument panels with different sizes, instrument panels with different types and the like: i.e. all images have a pointer whose colour differs significantly from the colour of the background of the dial, but whose brightness is similar. The invention therefore converts the problem of identifying the reading of a mechanical meter into the problem of identifying the rotation angle of the meter pointer. The invention selects to search the boundary of the pattern spot of the pointer in the HSV space, so that the identification method based on the single pointer instrument reading in the shale gas field production can identify the pointer, calculate the instrument angle and efficiently realize the reading of the mechanical instrument under the comprehensive influences of strong and weak image light, the distance between the instrument and the camera within a certain range, the installation angle of the instrument relative to the camera, the background shadow generated by sunlight and the like.
Further, in the step 3, the V-channel data of the image space is circularly traversed, and the influence factor of the cycle termination mainly includes at least one of the aspect ratio of the minimum circumscribing rectangle, the side length ratio of the minimum circumscribing rectangle to the central rectangle of the structural instrument, and the side length ratio of the area of the minimum circumscribing rectangle to the central rectangle of the structural instrument, and the values of the influence factors are all within a predefined threshold, and the cycle is terminated, otherwise, the cycle is continuously traversed to find the boundary of the image spot.
Further, in step 3, calling a CvtColor function to transfer the resampled image from RGB space to HSV space; in the process of circularly traversing the V channel data of the image space, an inRange function is called to filter HSV image space target pixels and used for detecting and searching the image spot boundary under each V value.
Further, after the spot boundary is found in the step 3, the image is converted from HSV space to RGB space.
Further, the step 4 mainly includes: constructing a center rectangle, circularly traversing the V channel data in the step 3, adding a constraint falling in the center rectangle and a constraint containing the midpoint of the center sub rectangle in the center of the boundary to the searched image spot boundary when detecting and searching the image spot boundary under each V value, and sorting the filtered image spot boundary under each V value, wherein the boundary with the largest number is the specific image spot boundary.
Further, the step 5 mainly includes: the method comprises the steps of locating a found specific image spot boundary to comprise a pointer boundary, generating a minimum circumscribed rectangle of the found boundary, filtering the boundary by using three indexes that the height-width ratio of the found boundary circumscribed rectangle is larger than a preset threshold value, the number of boundary pixels is larger than the side length of a center rectangle of an image and the area contained by the boundary is smaller than 30% of the area of the center rectangle of the image, sorting the inner boundary of the center rectangle, and obtaining the boundary with the largest pixel content as the pointer boundary.
And 4, 5, namely finding out a pointer boundary, wherein in the step 4, when each V value in the value range is circularly traversed in the step 3, finding out the optimal value in the corresponding V value and corresponding to the image spot boundary, taking the optimal value as a specific image spot boundary corresponding to each V value, and in the step 5, screening all the specific image spot boundaries found in the step 4, and taking the screened specific image spot boundary as the pointer boundary.
Further, performing straight line fitting on the found pointer boundary in the step 6, and calculating the deflection angle mainly includes: the method comprises the steps of taking two diagonal points of a minimum circumscribed rectangle as analysis objects, taking each point as a center, taking the short side of the minimum rectangle as a side length, constructing a new rectangle, counting the number of boundary points falling on the two rectangles, taking the number of the boundary points as pointer tails, taking the number of the boundary points as pointer heads, fitting a pointer boundary straight line, taking the horizontal coordinates of the two diagonal points of the minimum circumscribed rectangle as variables, solving corresponding vertical coordinates on the straight line, taking the two obtained vertical coordinates as calculation objects, and calculating the deflection angle of the pointer.
When the minimum circumscribed rectangle of the pointer is generated, the rotation angle of the broadside of the minimum circumscribed rectangle is usually expressed in the identification result, but the angle is influenced by the boundary of the identification pointer, and the error is larger. In order to refine pointer reading accuracy, two diagonal points of the minimum circumscribed rectangle are taken as analysis objects, each point is taken as a center, and the short side of the minimum rectangle is taken as a side length, so that a new rectangle is constructed. The number of boundary points falling within the two rectangles is then counted. The number of pointers is the tail of the pointer, and the number of pointers is the head of the pointer. Fitting a pointer boundary straight line, calculating corresponding ordinate on the straight line by taking the abscissa of two diagonal points of the minimum circumscribed rectangle as a variable, and calculating the deflection angle of the pointer by taking the newly calculated two ordinate as a calculation object.
Further, for the images of the positioning snapshot in the step 1, the imaging width and height of the mechanical instrument dial are not smaller than 100 pixels, and the included angle between the mechanical instrument dial and the camera is not smaller than 30 degrees.
Although the invention aims at the image with low definition to recognize the reading of the instrument, if the definition is too low and the imaging width or height of the mechanical instrument dial is smaller than 100 pixels, or the plane included angle between the camera and the mechanical instrument dial is smaller than 30 degrees, the method of the invention can not recognize the pointer reading of the instrument more accurately.
It should be noted that, in the step 2, the Resize function is called to resample the input image, so as to compensate for the angle difference generated by different mounting angles of the instrument relative to the camera; calling FindContours function to search and filter the pattern spot boundary formed in the step 3 in the step 4; and in the step 6, the FitLine function is called to fit the boundary of the pattern spot into a straight line, then the Atan2 function is called to calculate the angle of the boundary of the pattern spot to fit the straight line, and finally the MinAreRect function is called to find the minimum circumscribed rectangle of the boundary for calculating the initial direction of the straight line.
The identification method of the single pointer instrument reading mainly comprises the following steps in sequence:
step 1: detecting and positioning the position of a mechanical instrument in the snap image by using a mechanical instrument model trained by deep learning, intercepting sub-images of the instrument, and performing computer vision analysis of the mechanical instrument;
step 2: performing image preprocessing on the intercepted mechanical instrument sub-images, and performing image resampling;
step 3: transferring the resampled image from the RGB space to the HSV space, performing cyclic traversal on the V channel data of the image space, and detecting and searching the image spot boundary under each V value;
step 4: constructing a center rectangle of the mechanical instrument sub-image, and filtering the pattern spot boundary formed in the step 3 by using the constructed center rectangle;
step 5: performing length-width ratio constraint on the filtered map spot boundary, wherein the map spot boundary comprises central rectangular central point constraint, and then positioning a pointer boundary of a mechanical instrument;
step 6: and (3) performing straight line fitting and deflection angle calculation on the searched pointer boundary, determining the rotation angle of the straight line, and calculating the meter reading by combining the initial measuring range of the meter.
The invention is developed based on the background of the reading identification of the single pointer mechanical instrument in the shale gas production site, but has wide universality, and the pointer reading identification is mainly carried out on the dial aiming at the picture with low definition of the pointer or dial, so that the method can be used for carrying out the reading identification of the instrument not only aiming at the single pointer mechanical instrument in the shale gas production site, but also aiming at the picture with low definition of the single pointer mechanical instrument in the production site, and can be used for carrying out the reading identification of the instrument as long as the picture width of the mechanical instrument dial in the image is not less than 100 pixels, thereby the protection scope of the method is not limited to the instrument identification in the shale gas production site, is not limited to the image shot by a fixed camera, and can be used for carrying out the reading identification of the instrument.
In summary, due to the adoption of the technical scheme, the beneficial effects of the invention are as follows:
1. according to the identification method of the single pointer instrument readings based on shale gas field production, a blurred mechanical instrument dial image shot by a camera of a production site is converted into an HSV space from an RGB space, then computer vision analysis is carried out on the mechanical instrument dial to identify the readings of the instrument, and the identification rate is improved aiming at the blurred mechanical instrument dial image;
2. according to the identification method for the single pointer instrument readings based on shale gas field production, disclosed by the invention, the blurred mechanical instrument dial images shot by the cameras on the production site are converted into HSV space from RGB space, then the mechanical instrument dial is subjected to computer vision analysis, the readings of the instrument are identified, the data reading of the mechanical instrument dial is realized by directly using the monitoring cameras on the production site, compared with the traditional manual inspection, the mechanical instrument data reading is realized, the labor cost is saved, and the real-time efficiency is higher.
Drawings
The invention will now be described by way of example and with reference to the accompanying drawings in which:
FIG. 1 is a functional block diagram of the present invention;
FIG. 2 is a schematic diagram of a key function call of the present invention;
FIG. 3 is a schematic representation of an embodiment of the present invention after resampling;
FIG. 4 is a schematic representation of an embodiment of the present invention after spatial transformation;
FIG. 5 is a schematic diagram of an embodiment of the present invention after spot boundary detection;
FIG. 6 is a schematic diagram of an embodiment of the present invention after constructing a center sub-rectangle with constraints added;
FIG. 7 is a schematic illustration of an embodiment of the present invention after determining the direction of a straight line;
FIG. 8 is a schematic diagram of one embodiment of the present invention in determining pointer reading calculations;
FIG. 9 is a schematic diagram of another embodiment of the invention after resampling;
FIG. 10 is a schematic diagram of the V value 70 after spatial transformation according to another embodiment of the present invention;
FIG. 11 is a schematic diagram of the spatially transformed V value 130 according to another embodiment of the present invention;
FIG. 12 is a schematic diagram of the spatially transformed V-values 160 according to another embodiment of the present invention;
FIG. 13 is a schematic diagram of V values 220 after spatial transformation according to another embodiment of the present invention;
FIG. 14 is a schematic diagram of another embodiment of the present invention after constructing a center sub-rectangle with constraints added;
FIG. 15 is a schematic view of another embodiment of the present invention after determining the straight line direction;
FIG. 16 is a schematic diagram of another embodiment of the present invention in determining pointer reading calculations.
Detailed Description
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it should be understood that the described embodiments are only some embodiments of the present invention, but not all embodiments, and therefore should not be considered as limiting the scope of protection. All other embodiments, which are obtained by a worker of ordinary skill in the art without creative efforts, are within the protection scope of the present invention based on the embodiments of the present invention.
In the description of the present invention, it should be noted that, unless explicitly stated and limited otherwise, the terms "disposed," "connected," and "connected" are to be construed broadly, and may be, for example, fixedly connected, detachably connected, or integrally connected; can be mechanically or electrically connected; or may be directly connected, or may be indirectly connected through an intermediate medium, or may be communication between two elements. The specific meaning of the above terms in the present invention will be understood in specific cases by those of ordinary skill in the art.
The present invention will be described in detail with reference to fig. 1 to 16.
Example 1
The identification method based on the shale gas field production single pointer instrument reading, as shown in figure 1, mainly comprises the following steps in sequence:
step 1, capturing an image: detecting and positioning the position of a mechanical instrument in the snap image by using a mechanical instrument model trained by deep learning, intercepting sub-images of the instrument, and performing computer vision analysis of the mechanical instrument;
step 2, image preprocessing: performing image preprocessing on the intercepted mechanical instrument sub-images, and performing image resampling;
step 3, filtering the images: transferring the resampled image from the RGB space to the HSV space, performing cyclic traversal on the V channel data of the image space, and detecting and searching the image spot boundary under each V value;
step 4, constructing a center rectangle: constructing a center rectangle of the mechanical instrument sub-image, and filtering the pattern spot boundary formed in the step 3 by using the constructed center rectangle;
step 5, positioning a meter pointer: performing length-width ratio constraint on the filtered map spot boundary, wherein the map spot boundary comprises central rectangular central point constraint, and then positioning a pointer boundary of a mechanical instrument;
step 6, pointer degree identification: and (3) performing straight line fitting and deflection angle calculation on the searched pointer boundary, determining the rotation angle of the straight line, and calculating the meter reading by combining the initial measuring range of the meter.
The existing data identification technology for the instrument is generally established on the basis that the image data of the instrument shot by a camera is clear, and the monitoring camera of the shale gas production site mainly plays a role in monitoring, so that the problem of a monitoring range is mainly considered during installation, the mechanical instrument cannot be faced only, the image of the mechanical instrument shot by the camera is fuzzy, the images shot by the existing monitoring camera are difficult to identify in the prior art, and the invention mainly aims at the problem.
Working principle: when the instrument image is processed, the method adopts the steps, wherein the resampling in the step 2 extracts the instrument dial in the mechanical instrument sub-image; in the step 3, the resampled image is changed from the RGB space to the HSV space, and objects with certain colors are easier to track than the RGB color space in the HSV color space, and for the blurred dial plate image, although the hands and the dial plate are hard to distinguish by human eyes, the chromaticity H of the hands and the dial plate are actually quite different, but the brightness V values of the hands and the dial plate are similar, so that the hands are easy to find from the dial plate from the H value according to the characteristic that the H values of the dial plate and the hands are quite different. According to the scheme, the map spot boundaries under different V values are traversed, experience proves that the outline of the meter pointer is related to the V channel, the variable is traversed circularly, an ideal target image is selected, the key ring of the pointer is automatically identified, and the quality of the target image determines whether the subsequent meter reading can be successfully identified.
In the step 4, the center rectangle of the instrument is constructed by taking the center of the resampled image as a new rectangle center and taking half of the side length of the image as the side length of the rectangle, so that the problem of searching the pointer of the whole image is converted into the problem of searching the pointer in the rectangle. The method can reduce the searching range of the pointer and make the foreground and background of the pointer distinguished obviously.
And 5, carrying out boundary searching and positioning on the filtered image to position a pointer of the instrument, generating a minimum circumscribed rectangle of the pointer boundary, carrying out length-width ratio constraint on the generated minimum circumscribed rectangle and the map spot boundary containing central rectangular center point constraint, and finding the pointer boundary meeting the condition when the length-width ratio constraint and the map spot boundary containing central rectangular center point constraint meet the preset constraint condition. And then filtering the boundaries, wherein the selected boundaries fall in the central rectangle. And sequencing the inner boundaries of the center rectangle, wherein the boundary with the largest pixel is the pointer boundary.
And finally, performing straight line fitting and deflection angle calculation on the searched pointer boundary, fitting the straight line of the pointer through the straight line, determining the rotation angle of the fitted straight line, determining the rotation angle of the pointer, and calculating the meter reading by combining the initial measuring range of the corresponding meter.
The clear image which can be accurately identified in the prior art is compared with the fuzzy image which cannot be accurately identified in the prior art, the pointer in the clear image and the dial plate have obvious difference in RGB color space, the difference of the fuzzy image in the RGB color space is quite complex and is difficult to distinguish by using a formula, so that if the improvement on the method is continuously carried out in the RGB color space, the pointer in the clear image and the chromaticity H of the dial plate have great difference, the brightness V values are similar and larger, the pointer in the fuzzy image and the chromaticity H of the dial plate have great difference, but the brightness V values are similar and smaller, therefore, only the V values of the whole fuzzy image are required to be controlled, the boundary of the pointer can be searched when the chromaticity difference between the pointer and the dial plate is maximum, and the positioning of the pointer can be finished and the reading of the dial plate can be read.
The invention is developed based on the background of the reading identification of the single pointer mechanical instrument in the shale gas production site, but has wide universality, and the pointer reading identification is mainly carried out on the dial aiming at the picture with low definition of the pointer or dial, so that the method can be used for carrying out the reading identification of the instrument not only aiming at the single pointer mechanical instrument in the shale gas production site, but also aiming at the picture with low definition of the single pointer mechanical instrument in the production site, and can be used for carrying out the reading identification of the instrument as long as the picture width of the mechanical instrument dial in the image is not less than 100 pixels, thereby the protection scope of the method is not limited to the instrument identification in the shale gas production site, is not limited to the image shot by a fixed camera, and can be used for carrying out the reading identification of the instrument.
Example 2
On the basis of the above embodiment 1, the step 3 mainly includes the following steps performed in order:
step 3-1: transferring the resampled image from RGB space to HSV space;
step 3-2: and (3) performing cyclic traversal on the V value of the HSV image space from 80 to 230, and performing boundary judgment and search on each image 150 times to search the boundary of the image spot.
It should be noted that in different application scenarios, the HSV value ranges are not identical, as shown in fig. 2, the invention selects the image type by using the cvSplit function in the openCV, the H value range is 0-180, the s value range is 0-255, the V value range is 0-255, and the error range of the spot boundary is too large and too small, so we select a V value range in the middle range to cycle through, where we select the V value range from 80 to 230.
Working principle: the common characteristics of the images are abstracted by analyzing instrument images under the conditions of different rotation angles, different times, illumination of different weather images, different shooting distances, instrument panels with different sizes, instrument panels with different types and the like: i.e. all images have a pointer whose colour differs significantly from the colour of the background of the dial, but whose brightness is similar. The invention therefore converts the problem of identifying the reading of a mechanical meter into the problem of identifying the rotation angle of the meter pointer. The invention selects to search the boundary of the pattern spot of the pointer in the HSV space, so that the identification method based on the single pointer instrument reading in the shale gas field production can identify the pointer, calculate the instrument angle and efficiently realize the reading of the mechanical instrument under the comprehensive influences of strong and weak image light, the distance between the instrument and the camera within a certain range, the installation angle of the instrument relative to the camera, the background shadow generated by sunlight and the like.
Example 3
On the basis of the above embodiment 1 or 2, the V-channel data of the image space is circularly traversed in the step 3, and the influencing factors of the cycle termination mainly include at least one of the aspect ratio of the minimum circumscribed rectangle of the boundary line, the side length ratio of the minimum side length of the minimum circumscribed rectangle to the center rectangle of the structural meter, and the side length ratio of the area of the boundary line to the center rectangle of the structural meter, where the values of the influencing factors are within a predefined threshold, and if not, the cycle termination is continued, and otherwise, the cycle is continuously circularly traversed to find the spot boundary.
Example 4
On the basis of the above embodiment 1 or 2, as in fig. 2, in step 3, the cvttcolor function is called to transfer the resampled image from the RGB space to the HSV space; in the process of circularly traversing the V channel data of the image space, an inRange function is called to filter HSV image space target pixels and used for detecting and searching the image spot boundary under each V value.
And (3) after the boundary of the pattern spot is found in the step (3), converting the image from the HSV space into the RGB space. And is the call to the ConvertTo function to convert the image containing the filtered patch boundaries from HSV space to RGB space.
Example 5
On the basis of the above embodiment 1, in steps 4 and 5 of embodiment 1, it is necessary to screen out the pointer boundary that we need from a large number of map spot boundaries corresponding to all V values traversed, first we screen out the specific map spot boundary from the map spot boundaries, we judge the map spot boundary found under each V value, construct a center sub-rectangle, and keep the map spot boundaries falling on the center sub-rectangle, so as to reduce the number of map spot boundaries, and rank the map spot boundaries satisfying the following judgment conditions:
judging condition 1: the quotient of the length divided by the width of the smallest circumscribed rectangle of the spot boundary is greater than 3;
judging condition 2: the polygon formed by the map spot boundaries comprises the center points of the central sub-rectangular areas;
the boundary with the largest number after sorting is selected as the specific pattern spot boundary.
Performing cyclic traversal on the V-channel data of the image space, performing the judgment and sequencing on the image patch boundaries of the images corresponding to each V value, finding a specific image patch boundary, solving a mean value, a variance and a standard deviation according to the pixel number for all specific boundaries found by the images corresponding to all V values, generating the minimum circumscribed rectangle of the found specific image patch boundaries for the images of each specific image patch boundary, and selecting the specific image patch boundary with the largest pixel number meeting the following judgment condition as a pointer boundary:
judging condition 3: falling within a standard deviation;
judging condition 4: the number of pixels of the specific image spot boundary is larger than the rectangular side length of the center of the image;
judging condition 5: the specific spot boundary comprises less than 30% of the area of the center sub-rectangle.
Example 6
On the basis of the above embodiment 1, performing straight line fitting on the found pointer boundary in step 6, the deflection angle calculation mainly includes: the method comprises the steps of taking two diagonal points of a minimum circumscribed rectangle as analysis objects, taking each point as a center, taking the short side of the minimum rectangle as a side length, constructing a new rectangle, counting the number of boundary points falling on the two rectangles, taking the number of the boundary points as pointer tails, taking the number of the boundary points as pointer heads, fitting a pointer boundary straight line, taking the horizontal coordinates of the two diagonal points of the minimum circumscribed rectangle as variables, solving corresponding vertical coordinates on the straight line, taking the two obtained vertical coordinates as calculation objects, and calculating the deflection angle of the pointer.
Working principle: when the minimum circumscribed rectangle of the pointer is generated, the rotation angle of the broadside of the minimum circumscribed rectangle is usually expressed in the identification result, but the angle is influenced by the boundary of the identification pointer, and the error is larger. In order to refine pointer reading accuracy, two diagonal points of the minimum circumscribed rectangle are taken as analysis objects, each point is taken as a center, and the short side of the minimum rectangle is taken as a side length, so that a new rectangle is constructed. The number of boundary points falling within the two rectangles is then counted. The number of pointers is the tail of the pointer, and the number of pointers is the head of the pointer. Fitting a pointer boundary straight line, calculating corresponding ordinate on the straight line by taking the abscissa of two diagonal points of the minimum circumscribed rectangle as a variable, and calculating the deflection angle of the pointer by taking the newly calculated two ordinate as a calculation object.
And (3) calculating the meter reading: the included angle between the default instrument initial scale and the default instrument termination scale is 90 degrees, the default instrument panel full scale is 270 degrees, the angle of the default instrument panel initial scale relative to the X axis is 225 degrees, the clipping value range of the instrument pointer relative to the axis is (-180, 180], and then the instrument reading is:
example 7
On the basis of the embodiment 1, for the positioning snap shot image in the step 1, the imaging width and height of the mechanical instrument dial are not smaller than 100 pixels, and the included angle between the mechanical instrument dial and the camera is not smaller than 30 degrees.
Although the invention aims at the image with low definition to recognize the reading of the instrument, if the definition is too low and the imaging width or height of the mechanical instrument dial is smaller than 100 pixels, or the plane included angle between the camera and the mechanical instrument dial is smaller than 30 degrees, the method of the invention can not recognize the pointer reading of the instrument more accurately.
It should be noted that, in the step 2, the Resize function is called to resample the input image, so as to compensate for the angle difference generated by different mounting angles of the instrument relative to the camera; calling FindContours function to search and filter the pattern spot boundary formed in the step 3 in the step 4; and in the step 6, the FitLine function is called to fit the boundary of the pattern spot into a straight line, then the Atan2 function is called to calculate the angle of the boundary of the pattern spot to fit the straight line, and finally the MinAreRect function is called to find the minimum circumscribed rectangle of the boundary for calculating the initial direction of the straight line.
Example 8
3-8, the identification method based on the single pointer instrument reading of shale gas field production identifies a process image of a shale gas wellhead manometer dial plate, wherein:
FIG. 3 is a resampled bottom image after step 2, where the image is in RGB space and the pointer is similar to the dial;
as shown in fig. 4, after the space is converted into the HSV space in step 3-1, step 3-2 is performed, when the V value of the HSV space is traversed, the image when the V value is 113 is taken, the image can be obviously seen by naked eyes, and the pointer is clear compared with the pattern spot boundary of the dial behind the background;
step 4, the map spot boundary of the pointer determined by calculating the map is one of the specific map spot boundaries, and is also the pointer boundary which is finally obtained; after we convert it back to RGB space, fig. 5 is a diagram of the dial with pointer boundaries;
fig. 6 is a diagram of the pointer boundary finally determined by the dial after step 5, including the pointer boundary, the minimum bounding rectangle and the center sub-rectangle, in fig. 6, the larger rectangle is the center sub-rectangle, the smaller rectangle falling within the center sub-rectangle is the minimum bounding rectangle, and fig. 6 satisfies the following conditions:
judging condition 1: the quotient of the length divided by the width of the minimum bounding rectangle of the pointer boundary is greater than 3;
judging condition 2: the polygon formed by the pointer boundaries comprises the center point of the center sub-rectangular area;
judging condition 3: the pointer boundary falls within one standard deviation of the particular patch boundary for all V values;
judging condition 4: the number of pixels at the pointer boundary is larger than the rectangular side length of the center of the image;
judging condition 5: the pointer boundary contains less than 30% of the area of the center sub-rectangle.
As shown in fig. 7, the straight lines which are more than those in fig. 6 are obtained by continuing the straight line fitting calculation in step 6, and then the fitted pointer corresponds to the straight line, and in fig. 7, the two diagonal points of the circle of the smallest circumscribed rectangle are used as variables, the corresponding ordinate on the straight line is obtained by using the abscissa of the two diagonal points as variables, the newly obtained two ordinate are used as calculation objects, the deflection angle of the pointer is calculated, and in the figure, the calculated deflection angle of the pointer is 154 degrees relative to the X axis.
FIG. 8 is a view of the pressure gauge with the angle between the start and end scales of 90, the measuring range of 0-16 MPa, the full scale of the default gauge panel of 270, the angle of the start scale of the default gauge panel relative to the X-axis of 225, the lines of the third and fourth quadrants in the coordinate system established in FIG. 8 being the found start and end scales of the image gauge panel, finally passing through the formula, for the straight lines corresponding to the pointers fitted in FIG. 7, as the final calculation of the deflection angle and the gauge readings in step 6
I.e.
The calculation can give a pointer reading of 4.21Mpa and an actual pointer reading of 4.20Mpa.
Example 9
9-16, a process image of identifying a shale gas H5-4 wellhead manometer dial based on an identification method of shale gas field production single pointer instrument readings, according to the invention, wherein:
FIG. 9 is a resampled bottom image after step 2, where the image is in RGB space and the pointer is similar to the dial;
fig. 10-13 shows images with different V values when traversing the V values of the HSV space after performing the space transformation to the HSV space in step 3-1, wherein fig. 10 shows an image with a V value of 70, fig. 11 shows an image with a V value of 130, fig. 12 shows an image with a V value of 160, and fig. 13 shows an image with a V value of 220.
Step 4, the calculated and determined pointer pattern spot boundary is one of specific pattern spot boundaries and is the finally obtained pointer boundary; after we transform it back into RGB space, fig. 14 is a diagram of the dial with pointer boundaries, minimum bounding rectangle and center sub-rectangle, where the larger rectangle is the center sub-rectangle and the smaller rectangle falling within the center sub-rectangle is the minimum bounding rectangle, fig. 14 satisfies the following condition:
judging condition 1: the quotient of the length divided by the width of the minimum bounding rectangle of the pointer boundary is greater than 3;
judging condition 2: the polygon formed by the pointer boundaries comprises the center point of the center sub-rectangular area;
judging condition 3: the pointer boundary falls within one standard deviation of the particular patch boundary for all V values;
judging condition 4: the number of pixels at the pointer boundary is larger than the rectangular side length of the center of the image;
judging condition 5: the pointer boundary contains less than 30% of the area of the center sub-rectangle.
As shown in fig. 15, the straight lines which are more than those in fig. 14 are obtained by comparing the straight lines in step 6 with each other, and then the straight lines are fitted with the fitted pointers, and in fig. 7, the two diagonal points of the circle of the smallest circumscribed rectangle are used as variables, the corresponding ordinate on the straight line is obtained by using the abscissa of the two diagonal points as variables, the newly obtained two ordinate are used as calculation targets, the deflection angle of the pointers is calculated, and in the figure, the calculated deflection angle relative to the X axis is 203 °.
FIG. 16 is a view of the pressure gauge with the angle between the start and end scales of 90, the range of 0-25 MPa, the full scale of the default gauge panel of 270, the angle of the start scale of the default gauge panel relative to the X-axis of 225, the lines in the third and fourth quadrants of the coordinate system established in FIG. 8 being the found start and end scales of the image gauge panel, for the straight lines corresponding to the pointer fitted in FIG. 15, and finally passing through the formula
I.e.
The calculation can give a reading of 2.04Mpa for the pointer and 1.97Mpa for the actual reading.
Through examples 8 and 9 and the application in the actual production process, the error rate is below 5%, and the production requirement is met.
The foregoing description is only a preferred embodiment of the present invention, and is not intended to limit the present invention in any way, and any simple modification, equivalent variation, etc. of the above embodiment according to the technical matter of the present invention fall within the scope of the present invention.

Claims (9)

1. A shale gas field production single pointer instrument reading based identification method is characterized by comprising the following steps: the method mainly comprises the following steps of:
step 1: detecting and positioning the position of a mechanical instrument in the snap image by using a mechanical instrument model trained by deep learning, intercepting sub-images of the instrument, and performing computer vision analysis of the mechanical instrument;
step 2: performing image preprocessing on the intercepted mechanical instrument sub-images, and performing image resampling;
step 3: transferring the resampled image from the RGB space to the HSV space, performing cyclic traversal on the V channel data of the image space, and detecting and searching the image spot boundary under each V value;
step 4: constructing a center rectangle of the mechanical instrument sub-image, and filtering the pattern spot boundary formed in the step 3 by using the constructed center rectangle;
step 5: performing length-width ratio constraint on the filtered map spot boundary, wherein the map spot boundary comprises central rectangular central point constraint, and then positioning a pointer boundary of a mechanical instrument;
step 6: and (3) performing straight line fitting and deflection angle calculation on the searched pointer boundary, determining the rotation angle of the straight line, and calculating the meter reading by combining the initial measuring range of the meter.
2. The identification method based on shale gas field production single pointer instrument readings as claimed in claim 1, wherein the identification method comprises the following steps: the step 3 mainly comprises the following steps in sequence:
step 3-1: transferring the resampled image from RGB space to HSV space;
step 3-2: and (3) performing cyclic traversal on the V value of the HSV image space from 80 to 230, and performing boundary judgment and search on each image 150 times to search the boundary of the image spot.
3. The identification method based on shale gas field production single pointer instrument readings as claimed in claim 1 or 2, wherein: and 3, performing cycle traversal on the V-channel data of the image space, wherein the influence factor of cycle termination mainly comprises at least one of the aspect ratio of the minimum circumscribed rectangle of the boundary line, the side length ratio of the minimum side length of the minimum circumscribed rectangle to the central rectangle of the structural instrument and the side length ratio of the area of the boundary line to the central rectangle of the structural instrument, and if the values of the influence factors are within the predefined threshold, the cycle is terminated, otherwise, continuing to perform cycle traversal to find the boundary of the image spot.
4. The identification method based on shale gas field production single pointer instrument readings as claimed in claim 1 or 2, wherein: in step 3, calling a Cvtcolor function to transfer the resampled image from the RGB space to the HSV space; in the process of circularly traversing the V channel data of the image space, an inRange function is called to filter HSV image space target pixels and used for detecting and searching the image spot boundary under each V value.
5. The identification method based on shale gas field production single pointer instrument readings as claimed in claim 1 or 2, wherein: and (3) after the boundary of the pattern spot is found in the step (3), converting the image from the HSV space into the RGB space.
6. The identification method based on shale gas field production single pointer instrument readings as claimed in claim 1, wherein the identification method comprises the following steps: the step 4 mainly comprises the following steps: constructing a center rectangle, circularly traversing the V channel data in the step 3, adding a constraint falling in the center rectangle and a constraint containing the midpoint of the center sub rectangle in the center of the boundary to the searched image spot boundary when detecting and searching the image spot boundary under each V value, and sorting the filtered image spot boundary under each V value, wherein the boundary with the largest number is the specific image spot boundary.
7. The identification method based on shale gas field production single pointer instrument readings as claimed in claim 1, wherein the identification method comprises the following steps: the step 5 mainly comprises the following steps: the found image spot boundary comprises a pointer boundary, the minimum circumscribed rectangle of the found boundary is generated, three indexes that the height-width ratio of the found boundary circumscribed rectangle is larger than a preset threshold value, the number of boundary pixels is larger than the side length of the image center rectangle, the area contained by the boundary is smaller than 30% of the area of the image center rectangle are used for boundary filtering, the selected boundaries fall in the center rectangle, the inner boundary of the center rectangle is ordered, and the boundary with the largest pixels is the pointer boundary.
8. The identification method based on shale gas field production single pointer instrument readings as claimed in claim 1, wherein the identification method comprises the following steps: in the step 6, performing straight line fitting and deflection angle calculation on the searched pointer boundary mainly comprises the following steps: the method comprises the steps of taking two diagonal points of a minimum circumscribed rectangle as analysis objects, taking each point as a center, taking the short side of the minimum rectangle as a side length, constructing a new rectangle, counting the number of boundary points falling on the two rectangles, taking the number of the boundary points as pointer tails, taking the number of the boundary points as pointer heads, fitting a pointer boundary straight line, taking the horizontal coordinates of the two diagonal points of the minimum circumscribed rectangle as variables, solving corresponding vertical coordinates on the straight line, taking the two obtained vertical coordinates as calculation objects, and calculating the deflection angle of the pointer.
9. The identification method based on shale gas field production single pointer instrument readings as claimed in claim 1, wherein the identification method comprises the following steps: and (3) for the positioning snap shot images in the step (1), the imaging width and height of the mechanical instrument dial are not less than 100 pixels, and the included angle between the mechanical instrument dial and the camera is not less than 30 degrees.
CN202010713388.5A 2020-07-22 2020-07-22 Shale gas field production single pointer instrument reading based identification method Active CN112036393B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010713388.5A CN112036393B (en) 2020-07-22 2020-07-22 Shale gas field production single pointer instrument reading based identification method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010713388.5A CN112036393B (en) 2020-07-22 2020-07-22 Shale gas field production single pointer instrument reading based identification method

Publications (2)

Publication Number Publication Date
CN112036393A CN112036393A (en) 2020-12-04
CN112036393B true CN112036393B (en) 2023-08-18

Family

ID=73582928

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010713388.5A Active CN112036393B (en) 2020-07-22 2020-07-22 Shale gas field production single pointer instrument reading based identification method

Country Status (1)

Country Link
CN (1) CN112036393B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116071736A (en) * 2023-03-07 2023-05-05 北京全路通信信号研究设计院集团有限公司 Meter reading method and device, electronic equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104392206A (en) * 2014-10-24 2015-03-04 南京航空航天大学 Image processing method for automatic pointer-type instrument reading recognition
CN104751187A (en) * 2015-04-14 2015-07-01 山西科达自控股份有限公司 Automatic meter-reading image recognition method
CN106228161A (en) * 2016-07-18 2016-12-14 电子科技大学 A kind of pointer-type dial plate automatic reading method
CN106650697A (en) * 2016-12-30 2017-05-10 亿嘉和科技股份有限公司 Instrument scale recognition method
CN108573261A (en) * 2018-04-17 2018-09-25 国家电网公司 A kind of read out instrument recognition methods suitable for Intelligent Mobile Robot
JP2019096304A (en) * 2017-11-17 2019-06-20 キヤノン株式会社 Image processing device, control method thereof, and program
CN111414934A (en) * 2020-01-21 2020-07-14 国网浙江省电力有限公司湖州供电公司 Pointer type meter reading automatic identification method based on fast R-CNN and U-Net

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7357007B2 (en) * 2006-07-14 2008-04-15 Koyaku Industry Co., Ltd. Combination and key operated padlock with device for indicating the lock has been opened by a key

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104392206A (en) * 2014-10-24 2015-03-04 南京航空航天大学 Image processing method for automatic pointer-type instrument reading recognition
CN104751187A (en) * 2015-04-14 2015-07-01 山西科达自控股份有限公司 Automatic meter-reading image recognition method
CN106228161A (en) * 2016-07-18 2016-12-14 电子科技大学 A kind of pointer-type dial plate automatic reading method
CN106650697A (en) * 2016-12-30 2017-05-10 亿嘉和科技股份有限公司 Instrument scale recognition method
JP2019096304A (en) * 2017-11-17 2019-06-20 キヤノン株式会社 Image processing device, control method thereof, and program
CN108573261A (en) * 2018-04-17 2018-09-25 国家电网公司 A kind of read out instrument recognition methods suitable for Intelligent Mobile Robot
CN111414934A (en) * 2020-01-21 2020-07-14 国网浙江省电力有限公司湖州供电公司 Pointer type meter reading automatic identification method based on fast R-CNN and U-Net

Also Published As

Publication number Publication date
CN112036393A (en) 2020-12-04

Similar Documents

Publication Publication Date Title
US11403839B2 (en) Commodity detection terminal, commodity detection method, system, computer device, and computer readable medium
CN108759973B (en) Water level measuring method
CN107358627B (en) Fruit size detection method based on Kinect camera
CN111402247A (en) Machine vision-based method for detecting defects of suspension clamp on power transmission line
CN111709994B (en) Autonomous unmanned aerial vehicle visual detection and guidance system and method
CN113808282A (en) Multi-navigation-factor data fusion method
CN109447062A (en) Pointer-type gauges recognition methods based on crusing robot
CN110619328A (en) Intelligent ship water gauge reading identification method based on image processing and deep learning
CN109492525B (en) Method for measuring engineering parameters of base station antenna
CN112036393B (en) Shale gas field production single pointer instrument reading based identification method
CN114005108A (en) Pointer instrument degree identification method based on coordinate transformation
CN109389165A (en) Oil level gauge for transformer recognition methods based on crusing robot
CN115639248A (en) System and method for detecting quality of building outer wall
CN112036391B (en) Electronic inspection method and system based on shale gas field production station
CN115018785A (en) Hoisting steel wire rope tension detection method based on visual vibration frequency identification
CN111666880A (en) Intelligent identification system for fire extinguisher pointer instrument
CN109784257B (en) Transformer thermometer detection and identification method
CN108254380A (en) PCB circuit board template matching method based on Digital Image Processing
CN115082509B (en) Method for tracking non-feature target
CN115205317B (en) Bridge monitoring photoelectric target image light spot center point extraction method
Wu et al. Intelligent instrument recognition scheme based on unattended substation inspection
CN114638805A (en) Track slab crack detection method and system and storage medium
AU2021106502A4 (en) A Blasting Pile Measurement And Statistics Method For Open-pit Mines Based On UAV Technology
CN111652055B (en) Intelligent switch instrument identification method based on two-stage positioning
CN115684853A (en) Unmanned aerial vehicle power transmission line fault detection method and system with ultraviolet imager

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