CN115082697A - Bimetallic strip temperature measurement method based on OpenCV image edge recognition - Google Patents
Bimetallic strip temperature measurement method based on OpenCV image edge recognition Download PDFInfo
- Publication number
- CN115082697A CN115082697A CN202210675233.6A CN202210675233A CN115082697A CN 115082697 A CN115082697 A CN 115082697A CN 202210675233 A CN202210675233 A CN 202210675233A CN 115082697 A CN115082697 A CN 115082697A
- Authority
- CN
- China
- Prior art keywords
- image
- bimetallic strip
- edge
- temperature measurement
- opencv
- 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.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/40—Extraction of image or video features
- G06V10/44—Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01K—MEASURING TEMPERATURE; MEASURING QUANTITY OF HEAT; THERMALLY-SENSITIVE ELEMENTS NOT OTHERWISE PROVIDED FOR
- G01K5/00—Measuring temperature based on the expansion or contraction of a material
- G01K5/48—Measuring temperature based on the expansion or contraction of a material the material being a solid
- G01K5/56—Measuring temperature based on the expansion or contraction of a material the material being a solid constrained so that expansion or contraction causes a deformation of the solid
- G01K5/62—Measuring temperature based on the expansion or contraction of a material the material being a solid constrained so that expansion or contraction causes a deformation of the solid the solid body being formed of compounded strips or plates, e.g. bimetallic strip
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N20/00—Machine learning
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/20—Image preprocessing
- G06V10/30—Noise filtering
Landscapes
- Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Software Systems (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Multimedia (AREA)
- Artificial Intelligence (AREA)
- Evolutionary Computation (AREA)
- Medical Informatics (AREA)
- Data Mining & Analysis (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- Mathematical Physics (AREA)
- Image Analysis (AREA)
Abstract
The invention provides a bimetallic strip temperature measurement method based on OpenCV image edge recognition, which adopts a Sobel operator to extract the edges of a bimetallic strip; after edges are extracted through Sobel operator operation, the edges of the image need to be refined; in the edge thinning process, an edge image obtained after the first traversal of the Sobel operator is used as an input image; after extracting the edge coordinates, establishing a contour on a pixel coordinate plane, and calibrating with an actual size after establishing a corresponding pixel coordinate set, determining an actual length corresponding to the pixel coordinates, and realizing conversion between a pixel measurement value and an actual measurement value; software and hardware combine, and the identification accuracy is high, and the test program code can be opened the source and used repeatedly, can realize that the change of bimetallic strip is compatible, overcomes that the fixed can not be changed of thermometric meter bimetallic strip and then the temperature measurement range receives the not enough of built-in bimetallic strip kind limitation, has innovated bimetallic strip temperature measurement technical application, and cost and intensity of labour have been reduced have improved the temperature measurement precision, promote the product competitiveness of bimetallic strip temperature measurement trade.
Description
Technical Field
The invention belongs to the field of material thermal deformation detection, and relates to a bimetallic strip temperature measurement method based on OpenCV image edge recognition
Background
At present, circle detection methods commonly used by OpenCV are mainly a Hough (Hough) transformation method, a least square method and the like. The Hough transform is a commonly used shape detection method, and is commonly applied to detecting straight lines and circles. The least square method is one of the most reliable methods for obtaining a set of unknowns from a set of measured values, in which the sum of squares of measurement errors can be minimized when random errors are normally distributed. The least square method is adopted for ellipse fitting, ellipse equation parameters are estimated through boundary information of all or part of target objects, calculation is efficient, and the fitting degree is high under the condition that the target object image has a complete boundary. Because the invention measures the curvature of the bimetallic strip and the edge characteristics of the bimetallic strip can be approximated to an ellipse, the invention adopts the least square method to carry out the contour identification.
The existing OpenCV provides relevant APIs for circle fitting, namely findContours () and fitEllipse (), wherein the former is used for contour discovery, and the latter is used for circle fitting, and for the discovered contour of an approximate circle, a better display effect can be obtained through circle fitting. However, this method cannot evaluate the fitting error, and therefore the present invention recognizes the contour of the bimetal using findContours ().
The invention aims at the requirement of contour identification of the bimetallic strip in the thermal deformation process, and contour edge feature extraction is carried out on the image after binarization processing by utilizing a findContours () function. If the pixel values of two adjacent pixels change from (white) 255 to (black) 0 or from (black) 0 to (white) 255, the two pixels are edge points.
Disclosure of Invention
Aiming at the problems in the prior art, the invention provides a bimetallic strip temperature measurement method based on OpenCV image edge identification, so as to solve the above-mentioned technical problems.
In order to achieve the purpose, the invention is realized by the following technical scheme: a bimetallic strip temperature measurement method based on OpenCV image edge recognition is characterized in that Sobel operators are adopted for edge detection to extract the edges of a bimetallic strip; after the edges are extracted through Sobel operator operation, the edges of the image need to be refined. In the edge thinning process, the edge image obtained after the first traversal of the Sobel operator is used as an input image, Sobel edge detection is carried out on the input image again, the interior of the edge of the input image is used as background processing, the input image is traversed again through the Sobel operator, and finally a new metal sheet edge image is calculated. The detailed implementation process of the refinement algorithm is as follows:
(1) defining an original image of the metal sheet as, and performing image noise reduction by using a median filter;
(2) using Sobel operator and median filtering to operate the collected image, and defining the result as
(3) Processing the new image by using the Sobel operator again, wherein the calculated new image is;
(4) and subtracting, and when the difference value is a negative value, the value of the point is 0, and a final edge is obtained, namely:
further, machine learning is utilized to correct errors and substitute a curvature calculation formula to calculate curvature; the bimetallic strip contour can be accurately identified and extracted under different shooting environments, so that identification and calculation are carried out, and the influence of environmental noise on shooting identification precision is reduced.
Furthermore, after the edge coordinates are extracted, the outline is established on the pixel coordinate plane, and the outline is calibrated with the actual size after the outline and the corresponding pixel coordinate set are established, so that the actual length corresponding to one pixel coordinate can be determined, and further the conversion between the pixel measurement value and the actual measurement value is realized.
Further, at the output: and outputting the temperature data, the corresponding image acquisition data, and the set-up coordinates of the curvature data according to the user requirements and calibrating.
Further, OpenCV is adopted for image recognition, graying processing is carried out on the image, the area where the bimetallic strip is located is intercepted, and then a findContours function is used for detecting the outline of the object; the function prototype is as follows:
findContours(InputOutputArray image,OutputArrayOfArrays contours,OutputArray hierarchy,int mode,int method,Point offset=Point())。
further, after coordinate information of the contour is obtained, a scatter plot diagram is drawn; curve fitting of the scatter diagram adopts np of numpy, poly fit function and scipy of optimize;
the fitting of Python polynomial mainly uses np.polyfit function, the fitting of other functions uses curr _ fit function, the function prototype of curr _ fit is as follows:
scipy.optimize.curve_fit(f,xdata,ydata,p0=None,sigma=No ne,absolute_sigma=False,check_finite=True,bounds=(-inf,inf),method=None,jac=None,**kwargs);
namely: a fitted function y comprising an argument x, parameters a, B; while the main function of curve _ fit is to compute a, B.
In summary, the present invention provides a bimetallic strip temperature measurement method based on OpenCV image edge recognition, and to sum up, the present invention provides a bimetallic strip temperature measurement method based on OpenCV image edge recognition, which achieves the following beneficial effects:
1) the OpenCV finishes the real-time acquisition and storage of images, and has flexible processing mode, high measurement speed and high precision.
2) The method has the advantages that non-contact image acquisition with high reduction degree is realized, subjective errors caused by manual drawing and manual observation are avoided, bending errors caused by complex mechanical structures and contact resistance are avoided, the measurement precision is ensured, and the shape characteristic parameters of the metal sheet can be objectively and accurately described.
3) The algorithm for identifying the outline of the object is innovatively applied to measurement and calculation, and a computer image processing system for detecting and analyzing the shape of the object is established by combining the powerful calculation function of a computer.
4) Compare in traditional bimetallic strip thermometer, this technique software and hardware combines, and the identification accuracy is high, and test program code can be opened source and used repeatedly, can realize that the change of bimetallic strip is compatible, has overcome that traditional thermometer bimetallic strip is fixed can not be changed and then the temperature measurement scope receives the not enough of built-in bimetallic strip kind limitation, has innovated bimetallic strip temperature measurement technical application, and the cost is reduced and intensity of labour has improved the temperature measurement precision, promotes the product competitiveness of bimetallic strip temperature measurement trade.
5) Only the outline is shot, so that the limitation of a plurality of devices is avoided, the type of the bimetallic strip can be replaced, and different bimetallic strips can be suitable for different temperature measuring intervals.
6) The temperature can be remotely measured, namely, the temperature can be analyzed only by an image, and after a test image can be obtained, the image is transmitted to another place for remote analysis, unlike the traditional bimetallic strip thermometer in which a bimetallic strip is connected with a reading pointer, so that only field test can be carried out by field reading.
Drawings
FIG. 1 is a schematic diagram of an edge detection process according to the present invention;
FIG. 2 is a graphical illustration of the fit effect of the present invention;
in fig. 3, (a) is an original image, (b) is a recognition effect image, and (c) is a fitting effect image
Detailed Description
The invention is further described below with reference to the accompanying drawings.
As shown in fig. 1-3, the invention relates to a bimetallic strip temperature measurement method based on OpenCV image edge recognition, which comprises a bimetallic strip temperature measurement method based on OpenCV image edge recognition, wherein the edge detection adopts a Sobel operator to extract the edge of a bimetallic strip; after the edges are extracted through Sobel operator operation, the edges of the image need to be refined. In the edge thinning process, the edge image obtained after the Sobel operator traverses for the first time is used as an input image, Sobel edge detection is carried out on the input image again, the inner portion of the edge of the input image is used as background processing, the input image is traversed again through the Sobel operator, and finally a new metal sheet edge image can be calculated. The detailed implementation process of the refinement algorithm is as follows:
(1) defining an original image of a metal sheet as the original image, and performing image noise reduction by using a median filter;
(2) using Sobel operator and median filtering to operate the collected image, and defining the result as
(3) Processing the new image by using the Sobel operator again, wherein the calculated new image is;
(4) and subtracting, and when the difference value is a negative value, the value of the point is 0, and a final edge is obtained, namely:
further, machine learning is utilized to correct errors and substitute a curvature calculation formula to calculate curvature; the bimetallic strip contour can be accurately identified and extracted under different shooting environments, so that identification and calculation are carried out, and the influence of environmental noise on shooting identification precision is reduced.
Furthermore, after the edge coordinates are extracted, the outline is established on the pixel coordinate plane, and the outline is calibrated with the actual size after the outline and the corresponding pixel coordinate set are established, so that the actual length corresponding to one pixel coordinate can be determined, and further the conversion between the pixel measurement value and the actual measurement value is realized.
Further, at the output: and outputting the temperature data, the corresponding image acquisition data, and the set-up coordinates of the curvature data according to the user requirements and calibrating.
Further, OpenCV is adopted for image recognition, firstly, graying is carried out on the image, the area where the bimetallic strip is located is cut out, and then a findContours function is used for detecting the outline of the object, wherein the function prototype is as follows:
findContours(InputOutputArray image,OutputArrayOfArrays contours,OutputArray hierarchy,int mode,int method,Point offset=Point());
further, the unimage, which may be a gray scale image, is a single-channel image matrix, but is more commonly a binary image, which is generally processed by an edge detector such as Canny or laplace;
further, l vectors, defined as "vector < vector > Point > > vectors", are a vector and a double vector, each element in the vector holds a set of vectors of points formed by consecutive Point points, and each set of Point points is an outline. How many contours, vector constants have how many elements;
further, method of type int, defines the approximation of the contour. In the project, CV _ CHAIN _ APPROX _ SIMPLE is adopted to only store inflection point information of the contour, points at the inflection points of all the contour are stored in constraints vectors, and information points on a straight line section between the inflection points are not reserved.
Furthermore, after coordinate information of the contour is obtained, a scatter plot diagram is drawn.
Curve fitting of the scatter plot takes np. The fitting of Python polynomial mainly uses np.polyfit function, the fitting of other functions uses curr _ fit function, the function prototype of curr _ fit is as follows:
scipy.optimize.curve_fit(f,xdata,ydata,p0=None,sigma=None,a bsolute_sigma=False,check_finite=True,bounds=(-inf,inf),met hod=None,jac=None,**kwargs);
a function y through fitting, comprising an independent variable x, parameters A, B; while the main function of curve _ fit is to compute a, B.
When all curve fits are completed, the list compares the sizes of R2 to select the optimal function, and then the curvature of the curve is calculated.
The invention provides a bimetallic strip temperature measurement method based on OpenCV image edge recognition, which has the following beneficial effects:
1) the OpenCV finishes the real-time acquisition and storage of images, and has flexible processing mode, high measurement speed and high precision.
7) The method has the advantages that non-contact image acquisition with high reduction degree is realized, subjective errors caused by manual drawing and manual observation are avoided, bending errors caused by complex mechanical structures and contact resistance are avoided, the measurement precision is ensured, and the shape characteristic parameters of the metal sheet can be objectively and accurately described.
8) The algorithm for identifying the outline of the object is innovatively applied to measurement and calculation, and a computer image processing system for detecting and analyzing the shape of the object is established by combining the powerful calculation function of a computer.
9) Compare in traditional bimetallic strip thermometer, this technique software and hardware combines, and the identification accuracy is high, and test program code can be opened source and used repeatedly, can realize that the change of bimetallic strip is compatible, has overcome that traditional thermometer bimetallic strip is fixed can not be changed and then the temperature measurement scope receives the not enough of built-in bimetallic strip kind limitation, has innovated bimetallic strip temperature measurement technical application, and the cost is reduced and intensity of labour has improved the temperature measurement precision, promotes the product competitiveness of bimetallic strip temperature measurement trade.
10) Only the outline is shot, so that the limitation of a plurality of devices is avoided, the type of the bimetallic strip can be replaced, and different bimetallic strips can be suitable for different temperature measuring intervals.
11) The temperature can be remotely measured, namely, the temperature can be analyzed only by an image, and after a test image can be obtained, the image is transmitted to another place for remote analysis, unlike the traditional bimetallic strip thermometer in which a bimetallic strip is connected with a reading pointer, so that only field test can be carried out by field reading.
Claims (6)
1. A bimetallic strip temperature measurement method based on OpenCV image edge recognition is characterized in that Sobel operators are adopted for edge detection to extract the edges of a bimetallic strip; after the edges are extracted through Sobel operator operation, the edges of the image need to be refined. In the edge thinning process, the edge image obtained after the first traversal of the Sobel operator is used as an input image, Sobel edge detection is carried out on the input image again, the interior of the edge of the input image is used as background processing, the input image is traversed again through the Sobel operator, and finally a new metal sheet edge image is calculated. The detailed implementation process of the refinement algorithm is as follows:
(1) defining an original image of the metal sheet as, and performing image noise reduction by using a median filter;
(2) using Sobel operator and median filtering to operate the collected image, and defining the result as
(3) Processing the new image by using the Sobel operator again, wherein the calculated new image is;
(4) and subtracting, when the difference value is a negative value, the value of the point is 0, and obtaining a final edge, namely:
2. the method for thermometry of bimetallic strips based on OpenCV image edge recognition, as recited in claim 1, wherein machine learning is used to correct errors and substitute a curvature calculation formula to calculate curvature; the bimetallic strip contour can be accurately identified and extracted under different shooting environments, so that identification and calculation are carried out, and the influence of environmental noise on shooting identification precision is reduced.
3. The method for thermometry of bimetallic strips based on OpenCV image edge recognition, as recited in claim 1, wherein after the edge coordinates are extracted, an outline is established on a pixel coordinate plane, and after a corresponding pixel coordinate set is calibrated with an actual size, an actual length corresponding to one pixel coordinate can be determined, thereby realizing conversion between a pixel measurement value and an actual measurement value.
4. The method for thermometry of bimetallic strips based on OpenCV image edge recognition as claimed in claim 1, wherein the thermometry is located at the output end: and outputting the temperature data, the corresponding image acquisition data, and the set-up coordinates of the curvature data according to the user requirements and calibrating.
5. The method for measuring the temperature of the bimetallic strip based on OpenCV image edge recognition is characterized in that OpenCV is adopted for image recognition, graying is carried out on an image, the area where the bimetallic strip is located is intercepted, and then a findContours function is used for detecting the outline of an object; the function prototype is as follows:
findContours(InputOutputArray image,OutputArrayOfArrays contours,OutputArray hierarchy,int mode,int method,Point offset=Point())。
6. the method for thermometry of bimetallic strips based on OpenCV image edge recognition as recited in claim 1, wherein after coordinate information of a contour is obtained, a scatter plot diagram is drawn; curve fitting of the scatter diagram adopts np of numpy, poly fit function and scipy of optimize;
the fitting of Python polynomial mainly uses np.polyfit function, the fitting of other functions uses curr _ fit function, the function prototype of curr _ fit is as follows:
scipy.optimize.curve_fit(f,xdata,ydata,p0=None,sigma=None,absolute_sigma=False,check_finite=True,bounds=(-inf,inf),method=None,jac=None,**kwargs);
namely: a fitted function y comprising an argument x, parameters a, B; while the main function of curve _ fit is to compute a, B.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210675233.6A CN115082697A (en) | 2022-06-15 | 2022-06-15 | Bimetallic strip temperature measurement method based on OpenCV image edge recognition |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210675233.6A CN115082697A (en) | 2022-06-15 | 2022-06-15 | Bimetallic strip temperature measurement method based on OpenCV image edge recognition |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115082697A true CN115082697A (en) | 2022-09-20 |
Family
ID=83250560
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210675233.6A Pending CN115082697A (en) | 2022-06-15 | 2022-06-15 | Bimetallic strip temperature measurement method based on OpenCV image edge recognition |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115082697A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116308217A (en) * | 2023-05-19 | 2023-06-23 | 中交第四航务工程勘察设计院有限公司 | Concrete monitoring platform management method and system based on Internet of things |
-
2022
- 2022-06-15 CN CN202210675233.6A patent/CN115082697A/en active Pending
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116308217A (en) * | 2023-05-19 | 2023-06-23 | 中交第四航务工程勘察设计院有限公司 | Concrete monitoring platform management method and system based on Internet of things |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2021000524A1 (en) | Hole protection cap detection method and apparatus, computer device and storage medium | |
Liu et al. | A detection and recognition system of pointer meters in substations based on computer vision | |
CN116721106A (en) | Profile flaw visual detection method based on image processing | |
CN104363815A (en) | Image processing device, image processing method, and image processing program | |
CN109558871B (en) | Pointer instrument reading identification method and device | |
CN113689415A (en) | Steel pipe wall thickness online detection method based on machine vision | |
CN109658391B (en) | Circle radius measuring method based on contour merging and convex hull fitting | |
CN108955901B (en) | Infrared temperature measurement method and system and terminal equipment | |
CN108601509B (en) | Image processing apparatus, image processing method, and program-recorded medium | |
CN104732520A (en) | Cardio-thoracic ratio measuring algorithm and system for chest digital image | |
CN115294527B (en) | Subway tunnel damage detection method based on computer vision | |
CN115082697A (en) | Bimetallic strip temperature measurement method based on OpenCV image edge recognition | |
CN113793337A (en) | Locomotive accessory surface abnormal degree evaluation method based on artificial intelligence | |
CN114004790A (en) | Battery cover quality detection method and device, computer equipment and storage medium | |
Li et al. | Sublingual vein extraction algorithm based on hyperspectral tongue imaging technology | |
CN116958125A (en) | Electronic contest host power supply element defect visual detection method based on image processing | |
CN116740053B (en) | Management system of intelligent forging processing production line | |
CN116309589B (en) | Sheet metal part surface defect detection method and device, electronic equipment and storage medium | |
CN113280868B (en) | Method and system for synchronously monitoring axial vibration and rotating speed | |
CN116823708A (en) | PC component side mold identification and positioning research based on machine vision | |
CN113554688B (en) | O-shaped sealing ring size measurement method based on monocular vision | |
CN115908275A (en) | Hot ring rolling deformation geometric state online measurement method based on deep learning | |
CN115294119A (en) | Machine vision-based method for detecting stains in inner groove of head of plum-blossom-shaped thread | |
CN115115653A (en) | Refined temperature calibration method for cold and hot impact test box | |
CN112819009A (en) | Target identification and positioning method based on Harris corner detection and NCC matching |
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 |