CN113111931B - Measuring cylinder reading method based on light intensity transformation and clustering - Google Patents

Measuring cylinder reading method based on light intensity transformation and clustering Download PDF

Info

Publication number
CN113111931B
CN113111931B CN202110361275.8A CN202110361275A CN113111931B CN 113111931 B CN113111931 B CN 113111931B CN 202110361275 A CN202110361275 A CN 202110361275A CN 113111931 B CN113111931 B CN 113111931B
Authority
CN
China
Prior art keywords
picture
measuring cylinder
reading
clustering
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
CN202110361275.8A
Other languages
Chinese (zh)
Other versions
CN113111931A (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.)
Tongji University
Original Assignee
Tongji 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 Tongji University filed Critical Tongji University
Priority to CN202110361275.8A priority Critical patent/CN113111931B/en
Publication of CN113111931A publication Critical patent/CN113111931A/en
Application granted granted Critical
Publication of CN113111931B publication Critical patent/CN113111931B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/23Clustering techniques
    • G06F18/232Non-hierarchical techniques
    • G06F18/2321Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions
    • G06F18/23213Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions with fixed number of clusters, e.g. K-means clustering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/26Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion
    • G06V10/267Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion by performing operations on regions, e.g. growing, shrinking or watersheds
    • 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 relates to a measuring cylinder reading method based on light intensity transformation and clustering, which comprises the following steps: 1) Taking the shot picture containing the measuring cylinder type instrument panel as an input picture, and calculating to obtain the brightness value of the input picture; 2) According to the position and the corresponding rotation angle of a measuring cylinder in a given input picture, cutting and rotating the input picture to enable the measuring cylinder of the cut picture to be in a vertical state; 3) Mapping the cut picture to an HSV color gamut, adjusting the brightness of a Value channel according to the brightness Value of the picture, and then turning back to the RGB color gamut; 4) And clustering the position area of the measuring cylinder, obtaining the reading of the measuring cylinder by utilizing the clustering center and the percentage of the liquid color, and marking and displaying the reading in the picture. Compared with the prior art, the invention has the advantages of being suitable for outdoor weak light environment and the like.

Description

Measuring cylinder reading method based on light intensity transformation and clustering
Technical Field
The invention relates to the field of reading of instrument panels of measuring cylinders and image processing, in particular to a method for reading measuring cylinders based on light intensity transformation and clustering.
Background
Under the continuous development of industrial technology, various instruments are included in many projects, reading values displayed by the instruments are very important for maintenance or management of related personnel, along with the expansion of related industrial scale, more and more instrument panels are provided, scenes of alarming when the readings of the instruments are close to early warning values are increased, if a specially-assigned person is engaged to monitor different instrument panels in all weather, the method is not practical, and a large amount of labor force is wasted. The development of the computer technology makes the real-time monitoring and reading of the instrument panel possible based on pictures or videos, so that the labor cost can be greatly reduced, the related instruments can be accurately monitored for twenty-four hours, and the preset condition can be quickly warned by using related algorithms.
Many library functions for image processing are involved in the current development of computer vision, such as OpenCV. In the prior art, researchers use the divided measuring cylinder data to carry out graying and binaryzation, and directly use the binarized image to judge the amount of liquid columns contained in the image. The method can be used for quickly estimating the liquid column in the measuring cylinder, but in outdoor environment such as dark light and other conditions, the threshold value selection is very important when binaryzation is carried out by using the scheme, and the whole reading result is very sensitive to the threshold value because the color difference between the liquid column area and the blank area is small under the dark light condition. Therefore, reading the measuring cylinder in the picture under different lighting conditions is a task to be solved.
Some solutions for reading the instrument panel are also provided in the prior art, and a reading identification mode of a pointer instrument panel is provided in chinese patent CN 110490145A. Through the concrete analysis to the common pattern of pointer instrument, carry out the analysis to sample and input pattern in advance, reduce input sample quantity and the required a large amount of calculations of sample comparison, improved recognition speed, be convenient for make the discernment judgement rapidly to the instrument reading, the current patent is mostly to carrying out reading discernment to pointer type or digital dial plate, hardly carries out the reading to the graduated flask formula instrument. Meanwhile, the prior art is mostly in a stable illumination environment, the camera is close to the dial plate, and a large research space is provided for reading the dial plate of the measuring cylinder type outdoors.
Disclosure of Invention
The invention aims to overcome the defects of the prior art and provide a measuring cylinder reading method based on light intensity transformation and clustering.
The purpose of the invention can be realized by the following technical scheme:
a measuring cylinder reading method based on light intensity conversion and clustering is used for realizing the accurate degree of a measuring cylinder under outdoor weak light environment, and comprises the following steps:
1) Taking the shot picture containing the measuring cylinder type instrument panel as an input picture, and calculating to obtain the brightness value of the input picture;
2) According to the position and the corresponding rotation angle of a measuring cylinder in a given input picture, cutting and rotating the input picture to enable the measuring cylinder of the cut picture to be in a vertical state;
3) Mapping the cut picture to an HSV color gamut, adjusting the brightness of a Value channel according to the brightness Value of the picture, and then returning to an RGB color gamut;
4) And clustering the position area of the measuring cylinder, obtaining the reading of the measuring cylinder by utilizing the clustering center and the percentage of the liquid color, and marking and displaying the reading in the picture.
In step 1), the calculation formula of the brightness value of the input picture is:
Figure BDA0003005677560000021
wherein R and G are channel values of R and G respectively.
The step 2) specifically comprises the following steps:
201 Clipping the input picture according to the position of the measuring cylinder;
202 Standardizing the cut picture;
203 Constructing a rotation matrix according to the rotation angle, and carrying out affine transformation on the cut image after the standardization processing so that the measuring cylinder in the picture keeps the vertical forward direction.
The step 3) specifically comprises the following steps:
301 Converting the picture after the affine transformation processing into an HSV color gamut;
302 Carry on the corresponding adjustment to the Value channel Value of picture according to the luminance Value of picture;
303 ) the picture is switched from the HSV color gamut back to the RGB color gamut after the adjustment is completed.
The step 302) is as follows:
and setting upper and lower limit threshold values of the picture brightness according to the actual environment where the measuring cylinder is located, and when the picture brightness Value exceeds the upper and lower limit threshold Value ranges, adjusting the picture Value channel Value in a manner of reducing the Value by exceeding the upper limit threshold Value and increasing the Value by being lower than the lower limit threshold Value so that the picture brightness Value is in the upper and lower limit threshold Value ranges.
The upper and lower threshold values of the picture brightness are respectively 100 and 30.
The step 4) specifically comprises the following steps:
301 Adopting a K-Means model, and setting the number of clustering categories as 2 to respectively represent the area where the liquid column is located and the area without the liquid column;
302 Inputting pixel points of the area where the measuring cylinder is located in the picture into a K-Means model for clustering to obtain two clustering centers, determining a liquid label according to the classification label of the pixel of the area where the liquid column is located after each pixel point is classified, calculating the percentage of the liquid column according to the liquid label, and finishing video reading.
In the step 302), after the pixels in the area where the measuring cylinder is located in the picture are classified, each pixel corresponds to a classification label, namely the area where the liquid column is located or the area without the liquid column, and the percentage of the pixels corresponding to the area where all the labels are located in the liquid column is calculated, namely the percentage of the liquid column.
When video reading is carried out, the characteristic that the change among different frames in a video is small is considered, a window averaging mode is adopted to enable the final reading result to be more stable, and the window size is 100.
The measuring cylinder reading device for realizing the measuring cylinder reading method comprises the following steps:
a camera: the device is used for shooting pictures containing the measuring cylinder type instrument panel and sending the pictures to the memory through a transmission line;
a memory: a computer program for storing steps of a method for operating a graduated cylinder reading;
a processor: for invoking a computer program in the memory for performing the steps of the cylinder reading method.
Compared with the prior art, the invention has the following advantages:
according to the method, for the picture containing the measuring cylinder in the outdoor weak light environment scene, the brightness of the picture is calculated, the brightness value of the picture is adjusted according to different brightness on the HSV color gamut, after the position of the measuring cylinder in the picture is obtained, the measuring cylinder area is subjected to operations such as standardization, affine transformation and the like, the measuring cylinder is located at the forward position, then a liquid column part and a non-liquid column part in the measuring cylinder are distinguished in a clustering mode, the height of the liquid column is calculated according to the clustering center and the ratio of the two parts, and the reading of the measuring cylinder is obtained.
Drawings
Fig. 1 is a graph showing the results in the normal light environment in example 1.
FIG. 2 is a graph showing the results in a low light environment in example 1.
FIG. 3 is a flowchart of the method of example 1.
FIG. 4 is a flow chart of the method of the present invention.
Detailed Description
The invention is described in detail below with reference to the figures and specific embodiments. The present embodiment is implemented on the premise of the technical solution of the present invention, and a detailed implementation manner and a specific operation process are given, but the scope of the present invention is not limited to the following embodiments.
Example 1
As shown in fig. 3, the present embodiment provides a method for reading a graduated cylinder based on light intensity transformation and clustering, which includes the following steps:
1) Calculating the brightness value of an input picture for the input picture containing the measuring cylinder type instrument panel;
2) Giving the position and the related rotation angle of the measuring cylinder in the picture, and performing related transformation operation on the picture to enable the measuring cylinder to be in a vertical state;
3) Mapping the picture to an HSV color gamut, processing a Value channel according to the brightness Value in the step 1), and finally returning to the RGB color gamut;
4) And (4) clustering in the measuring cylinder area, obtaining the reading of the measuring cylinder by utilizing the clustering center and the percentage of the liquid color, and marking and displaying the reading in the figure.
For the image brightness value calculated by the mean value of the three RGB channels in step 1), the method is implemented by using a relevant image processing library function in OpenCV, and the image brightness value brightness is expressed as:
Figure BDA0003005677560000041
wherein R and G are channel values of R and G respectively.
After the brightness value of the picture is obtained, corresponding conversion is carried out by taking the brightness value as a reference when the subsequent image is subjected to brightness conversion processing.
In step 2), image processing is performed on a picture area obtained by cutting according to the input position of the measuring cylinder, and the specific operation process specifically comprises the following steps:
201 Clipping the input picture by using the position of the measuring cylinder;
202 Standardized operation on graduated cylinder pictures, with the parameters set to: alpha =255, beta =0, norm \_type = cv2.Norm_minmax;
203 Using the rotation angle to construct a matrix, and carrying out affine transformation on the image so that the measuring cylinder in the picture keeps a vertical forward direction.
After steps 201) -203) are completed, the pictures processed subsequently are all the cropped areas.
The specific steps of the relevant processing of the image brightness in the step 3) are as follows:
301 Converting the clipped and processed picture into an HSV color gamut;
302 Corresponding adjustment is performed on the picture Value channel according to the picture brightness Value, specifically:
according to the upper and lower limit thresholds of the picture brightness, when the picture brightness Value exceeds the upper and lower limit threshold range, the Value channel Value (namely the picture brightness Value) is adjusted in a manner of decreasing the Value when exceeding the upper limit threshold and increasing the Value when being lower than the lower limit threshold, in the embodiment, the upper and lower limit thresholds of the picture brightness are respectively 100 and 30;
303 ) the picture is switched from the HSV gamut back to the RGB gamut after the change is complete.
Images are input into a final clustering module for clustering after completing 301) -303), and a column matrix only containing measuring cylinders is adopted for calculation during clustering.
In step S4, the specific steps of performing clustering reading on the pictures are as follows:
401 Adopting a K-Means model, the number of clustering categories is 2, and the parameters are set to be n _ clusters =2, n_jobs =32, tol =0.01;
402 Putting pixel points of the measuring cylinder area in the picture into a model for clustering to obtain two clustering centers, determining a liquid label according to the pixel label of the area where the liquid column is located after each pixel point is classified, and calculating the percentage of the liquid column according to the liquid label.
When performing video reading, the characteristic that the change between different frames in the video is small needs to be considered, and the final reading result is more stable by using a window averaging method, where the window size is 100 in this embodiment.
As can be seen in fig. 1, this embodiment has a better effect in a normal lighting environment.
Fig. 2 shows the effect of the method on the reading of the graduated cylinder type instrument under dark and low light conditions, and it can be seen that the method still has a good reading result even under dark conditions.
Example 2
The embodiment provides a device for a measuring cylinder reading method based on light intensity transformation and clustering, which corresponds to embodiment 1, and the device comprises a camera, a transmission line, a memory and a processor, wherein the memory stores a computer program for operating the reading method, and the processor calls the computer program to execute the steps of the degree method.
The foregoing detailed description of the preferred embodiments of the invention has been presented. It should be understood that numerous modifications and variations can be devised by those skilled in the art in light of the above teachings. Therefore, the technical solutions available to those skilled in the art through logic analysis, reasoning and limited experiments based on the prior art according to the concept of the present invention should be within the scope of protection defined by the claims.

Claims (4)

1. A measuring cylinder reading method based on light intensity conversion and clustering is used for realizing accurate degree of a measuring cylinder under outdoor weak light environment, and is characterized by comprising the following steps:
1) Taking the shot picture containing the measuring cylinder type instrument panel as an input picture, and calculating to obtain a brightness value of the input picture;
2) Cutting and rotating the input picture according to the position and the corresponding rotation angle of the measuring cylinder in the given input picture, so that the measuring cylinder of the cut picture is in a vertical state;
3) Mapping the cut picture to an HSV color gamut, adjusting the brightness of a Value channel according to the brightness Value of the picture, and then returning to an RGB color gamut;
4) Clustering the position area of the measuring cylinder, obtaining the reading of the measuring cylinder by using the clustering center and the percentage of the liquid color, and marking and displaying the reading in a picture;
in step 1), the calculation formula of the brightness value of the input picture is:
Figure FDA0004068088530000011
wherein R and G are channel values of R and G respectively;
the step 2) specifically comprises the following steps:
201 Clipping the input picture according to the position of the measuring cylinder;
202 Standardizing the cut picture;
203 Constructing a rotation matrix according to the rotation angle, and carrying out affine transformation on the cut image after the standardization processing so as to ensure that a measuring cylinder in the image keeps a vertical forward direction;
the step 3) specifically comprises the following steps:
301 Converting the picture after the affine transformation processing into an HSV color gamut;
302 Carry on the corresponding adjustment to the Value channel Value of picture according to the luminance Value of picture;
303 After the adjustment is completed, the picture is converted from the HSV color gamut to the RGB color gamut;
the step 302) is as follows:
setting upper and lower limit threshold values of the picture brightness according to the actual environment where the measuring cylinder is located, and when the picture brightness Value exceeds the upper and lower limit threshold Value ranges, adjusting the picture Value channel Value in a manner of reducing the Value by exceeding the upper limit threshold Value and increasing the Value by being lower than the lower limit threshold Value so that the picture brightness Value is in the upper and lower limit threshold Value ranges;
the upper and lower limit threshold values of the picture brightness are respectively 100 and 30;
the step 4) specifically comprises the following steps:
401 Adopting a K-Means model, and setting the number of clustering categories as 2 to respectively represent the area where the liquid column is located and the area without the liquid column;
402 Inputting pixel points of the area where the measuring cylinder is located in the picture into a K-Means model for clustering to obtain two clustering centers, determining a liquid label according to the classification label of the pixel of the area where the liquid column is located after each pixel point is classified, calculating the percentage of the liquid column according to the liquid label, and finishing video reading.
2. The method for reading a measuring cylinder based on light intensity transformation and clustering as claimed in claim 1, wherein in the step 402), after the pixels in the area where the measuring cylinder is located in the picture are classified, each pixel corresponds to a classification label, namely the area where the liquid column is located or the area without the liquid column, and the percentage of all labels to the pixels in the area where the liquid column is located is calculated, namely the percentage of the liquid column.
3. The method for reading the graduated cylinder based on the light intensity transformation and the clustering as claimed in claim 1, wherein the final reading result is more stable by adopting a window averaging method in consideration of the characteristic of small change among different frames in the video when the video reading is performed, and the window size is 100.
4. The method for reading the graduated cylinder based on the light intensity transformation and the clustering as claimed in claim 3, wherein the graduated cylinder reading device for implementing the method for reading the graduated cylinder comprises:
a camera: the device is used for shooting pictures containing the measuring cylinder type instrument panel and sending the pictures to the memory through a transmission line;
a memory: a computer program for storing steps of a method for operating a graduated cylinder reading;
a processor: for invoking a computer program in the memory for performing the steps of the cylinder reading method.
CN202110361275.8A 2021-04-02 2021-04-02 Measuring cylinder reading method based on light intensity transformation and clustering Active CN113111931B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110361275.8A CN113111931B (en) 2021-04-02 2021-04-02 Measuring cylinder reading method based on light intensity transformation and clustering

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110361275.8A CN113111931B (en) 2021-04-02 2021-04-02 Measuring cylinder reading method based on light intensity transformation and clustering

Publications (2)

Publication Number Publication Date
CN113111931A CN113111931A (en) 2021-07-13
CN113111931B true CN113111931B (en) 2023-04-07

Family

ID=76713524

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110361275.8A Active CN113111931B (en) 2021-04-02 2021-04-02 Measuring cylinder reading method based on light intensity transformation and clustering

Country Status (1)

Country Link
CN (1) CN113111931B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112115895A (en) * 2020-09-24 2020-12-22 深圳市赛为智能股份有限公司 Pointer type instrument reading identification method and device, computer equipment and storage medium

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102769758A (en) * 2012-07-18 2012-11-07 京东方科技集团股份有限公司 Method and system for processing RGB (red, green and blue) data
CN104112258A (en) * 2014-06-19 2014-10-22 中国科学院深圳先进技术研究院 Method and system for realizing RGB color image processing
CN104517268B (en) * 2014-12-24 2017-09-26 小米科技有限责任公司 Adjust the method and device of brightness of image
CN106296674B (en) * 2016-08-04 2019-02-22 电子科技大学 A kind of automatic reading method of the ellipse without grid oil level indicator
CN108711140B (en) * 2018-05-16 2021-09-10 广东欧谱曼迪科技有限公司 Image brightness uniformity real-time recovery method based on inter-class variance description
CN109146826A (en) * 2018-06-27 2019-01-04 华南理工大学 A kind of image enchancing method and device
CN111292273B (en) * 2020-03-05 2023-03-24 合肥工业大学 Semantic-guided dim light image enhancement method
CN111626190B (en) * 2020-05-26 2023-07-07 浙江大学 Water level monitoring method for scale recognition based on clustering partition
CN112504383A (en) * 2020-09-04 2021-03-16 上海大学 Image processing-based method for judging level in gauge in head-up mode

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112115895A (en) * 2020-09-24 2020-12-22 深圳市赛为智能股份有限公司 Pointer type instrument reading identification method and device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN113111931A (en) 2021-07-13

Similar Documents

Publication Publication Date Title
US11120757B2 (en) Gray scale adjustment method and device for display panel
US9740967B2 (en) Method and apparatus of determining air quality
CN107843599B (en) AOI-based panel detection and judgment method and device
CN108090908B (en) Image segmentation method, device, terminal and storage medium
CN112767392A (en) Image definition determining method, device, equipment and storage medium
CN112750162A (en) Target identification positioning method and device
CN114119591A (en) Display screen picture quality detection method
CN112419229A (en) Display screen linear defect detection method and device and storage medium
CN110298829A (en) A kind of lingual diagnosis method, apparatus, system, computer equipment and storage medium
US20160005156A1 (en) Infrared selecting device and method
CN112070762A (en) Mura defect detection method and device for liquid crystal panel, storage medium and terminal
Le et al. Novel framework for optical film defect detection and classification
CN113111931B (en) Measuring cylinder reading method based on light intensity transformation and clustering
CN211856402U (en) Automobile instrument panel detection system based on machine vision
CN104748862A (en) Analyzing device and analyzing method
CN109784257B (en) Transformer thermometer detection and identification method
US20150358559A1 (en) Device and method for matching thermal images
CN114923581A (en) Infrared selecting device and infrared selecting method
CN115035071A (en) Visual detection method for black spot defect of PAD light guide plate
CN113630594A (en) Bad point detection system of display panel
CN114002704A (en) Laser radar monitoring method and device for bridge tunnel and medium
CN107796323A (en) A kind of micro- change detecting system of bridge based on hot spot vision signal intellectual analysis
CN114245110A (en) Method and device for detecting bad point of camera
CN112213081A (en) Screen body detection equipment
CN105959528A (en) Working scene switching method and apparatus and test device

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