CN110608685A - Object size rapid measurement method based on raspberry pie - Google Patents

Object size rapid measurement method based on raspberry pie Download PDF

Info

Publication number
CN110608685A
CN110608685A CN201910884198.7A CN201910884198A CN110608685A CN 110608685 A CN110608685 A CN 110608685A CN 201910884198 A CN201910884198 A CN 201910884198A CN 110608685 A CN110608685 A CN 110608685A
Authority
CN
China
Prior art keywords
measured
image
objects
information
reference object
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
Application number
CN201910884198.7A
Other languages
Chinese (zh)
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.)
Tianjin Polytechnic University
Original Assignee
Tianjin Polytechnic 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 Tianjin Polytechnic University filed Critical Tianjin Polytechnic University
Priority to CN201910884198.7A priority Critical patent/CN110608685A/en
Publication of CN110608685A publication Critical patent/CN110608685A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01BMEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
    • G01B11/00Measuring arrangements characterised by the use of optical techniques
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01BMEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
    • G01B11/00Measuring arrangements characterised by the use of optical techniques
    • G01B11/02Measuring arrangements characterised by the use of optical techniques for measuring length, width or thickness
    • G01B11/022Measuring arrangements characterised by the use of optical techniques for measuring length, width or thickness by means of tv-camera scanning
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01BMEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
    • G01B11/00Measuring arrangements characterised by the use of optical techniques
    • G01B11/24Measuring arrangements characterised by the use of optical techniques for measuring contours or curvatures

Abstract

The invention discloses a method for quickly measuring the size of an object based on a raspberry pie, which can be used for directly acquiring a two-dimensional image of an object to be measured through an area-array camera after the area-array camera is calibrated, so as to quickly acquire key size parameter information of the object; the method has the advantages of high speed, strong practicability, good portability and the like, and the measurement precision meets the requirements of industrial production.

Description

Object size rapid measurement method based on raspberry pie
Technical Field
The invention discloses a raspberry pie-based object dimension rapid measurement method, which can be used for collecting a two-dimensional image of an object to be measured directly through an area-array camera after the area-array camera is calibrated, so as to rapidly acquire key dimension parameter information of the object.
Background
The traditional object size measurement means mainly comprises manual and professional instrument modes; the manual mode is mainly based on measurement of a gauge, a graduated scale and the like, and the method is simple, convenient and quick, but the precision is not high; although professional instruments such as a contourgraph and an X-ray measuring instrument have high precision, the special instruments have higher requirements on the measuring environment and have certain limitations in the field of modern industrial production; with the continuous development and updating of optical technology, signal processing and computer technology, people can acquire image information of an object in the external environment through an optical imaging method, convert the image information into a digital signal which can be processed and recognized by a machine, and finally realize the function of simulating human visual information perception by using a computer or a robot, so that the machine vision technology is formed, and a new direction is provided for the rapid measurement of the object; the general measuring system based on machine vision extracts key information through an image processing algorithm by collecting an image of an object to be measured and inputting the image into a computer, and finally obtains dimension information of the object to be measured by utilizing a camera calibration parameter; meanwhile, because a computer is used as an image processing unit, the portability needs to be improved.
The raspberry type image processing system has the advantages of high speed, strong practicability and good portability because the software algorithm is deeply optimized, and the measurement precision basically meets the requirements of industrial production.
Disclosure of Invention
The invention aims to overcome the defects of the existing method and provides a raspberry group-based object size rapid measurement method, which can realize rapid measurement of two-dimensional size information of an object to be measured by setting a reference object only after a camera is calibrated.
A method for quickly measuring the size of an object based on a raspberry pie mainly comprises the following steps:
(1) collecting and preprocessing an image of an object to be measured;
(2) extracting contour information of all objects in the image;
(3) selecting and determining a reference object through preset index information;
(4) marking all objects to be measured in the image in a scanning mode;
(5) respectively determining the frame and the vertex of the object to be measured, and calculating the central point and the connecting line of each frame;
(6) calculating Euclidean distances between corresponding central points, and marking the actual size information of the object to be measured;
in the step 1, through an area-array camera module arranged on a raspberry group platform, color images of an object to be measured and a reference object are collected and transmitted to a raspberry group processor chip, and edge gaps of all objects in the image are filled through a morphological method, so that the image is preprocessed;
in step 2, after extracting the edge information of the object to be measured and the reference object, marking the external contours of all objects in the collected color image by a contour retrieval method;
in step 3, the positions and the contour sizes of all objects in the image are counted to determine a reference object, and the measurement proportion value determined by the actual size of the reference object is pixel _ per _ metric which is pixel _ width/width, wherein pixel _ width represents the number of unit pixels and takes the pixels as units; the width is the real length of the reference object and the unit is millimeter;
step 4, after the position information of the reference object is determined, carrying out serial number annotation on the object to be measured after the contour is extracted one by one from left to right in a scanning mode;
in step 5, extracting a rotation boundary of the object to be measured according to the contour line region information, drawing an outer frame of the object to be measured, returning coordinates of a frame vertex, defining a central point calculation function midpoint, and simultaneously extracting coordinates of four vertices of the boundary, wherein the coordinates of the four vertices of the boundary are extractedThe positions of the vertexes of the elliptic boundaries are positioned by an averaging method, and two adjacent vertexes (x) are calculated1,y1),(x2,y2) The calculation method comprises the following steps: midpoint (x, y) ═ x1+x2)/2,(y1+y2) /2), marking the connecting line with the corresponding center line point;
in step 6, Euclidean formula is used to calculate Euclidean distance between central points corresponding to the objects to be measured, and the key dimension information of the objects to be measured can be expressed asWherein (x)z1,yz1),(xz2,yz2) Is a coordinate value corresponding to the center point.
Compared with the prior art, the invention has the following advantages:
1. the method has good portability, and can conveniently measure under any environment because the camera and the digital image processing unit are integrated, the method has the advantages of small volume, light weight and the like, and the method can be directly supplied by a mobile power supply,
2. the method has the advantages that the measurement speed is high, the object is quickly measured in an image acquisition mode, the object in the acquisition process can be in a motion state, and meanwhile, the parameter calibration process of a measurement system in a common method is omitted, so that the method can be applied to the fields of industrial flow line production, medical measurement research and the like.
Drawings
FIG. 1 is a flow chart of a method of the present invention;
FIG. 2 is an initial image collected by the area-array camera, wherein the left card is a reference object, and the middle oval coin and the right rectangular iron box are objects to be measured;
FIG. 3 is the result of the pre-processing of the image of FIG. 2, wherein (a) is the image after the graying process; (b) is a Gaussian filtered image; (c) the image is an image after edge detection; (d) is a morphologically processed image;
FIG. 4 is a diagram of an image after extracting all the object contours in FIG. 2, where the red border is the object contour;
FIG. 5 is the image determined by referring to the size parameter information of the object, i.e. the length and width size information of the left blue card;
fig. 6 is a frame of the object to be measured in fig. 2 and a center point labeling result image thereof, and (a) is an elliptical coin labeling result image; (b) labeling a result image for the rectangular iron box on the right side;
FIG. 7 is a result image of the calculation of the dimension information of all the objects to be measured in FIG. 2, and (a) is a result image of the calculation of the middle oval coin; (b) the resulting image is calculated for the right rectangular iron box.
Detailed Description
The flow chart of the invention is shown in figure 1, the method comprises the steps that firstly, a raspberry group reads color images of an object to be measured and a reference object, which are acquired by an area-array camera, the size information of the reference object is set through programming, then image preprocessing is carried out through closed operation in Gaussian filtering, edge detection and morphological processing, and finally contour information of all objects in an image is extracted; the reference object is determined through the pre-input index information, all objects to be measured in the image are classified and labeled in a scanning mode, then the boundary frames and the vertexes of the objects to be measured are respectively determined, the positions of the middle points of all the boundary frames of the objects to be measured are calculated, corresponding connecting lines are carried out, and the Euclidean distances corresponding to the middle points are calculated, so that the actual size information of the objects to be measured can be labeled. The following describes a specific implementation process of the technical scheme of the invention with reference to the accompanying drawings:
1. collecting and preprocessing an image of an object to be measured;
a camera-specific csi (cmos Sensor interface) interface is disposed on the raspberry pi platform, and a color image corresponding to the object to be measured and the reference object is collected right above the object to be measured and the reference object by connecting an area array module with a resolution of 1920 × 1200 and 700 ten thousand pixels and transmitted to a raspberry pi processor chip, as shown in fig. 2; because the image preprocessing mainly operates on gray pixels, the acquired image is converted into a gray image by a weighted average method, the principle of the weighted average method is to weight and average the values of the red, green and blue components according to a certain weight value, and finally a gray image is obtained, and the result is shown in fig. 3 (a); considering that image quality degradation is easily caused by environmental interference in the camera acquisition process, in order to better retain the detail characteristics of an image, the method adopts a Gaussian filter algorithm to process the acquired image, the algorithm is a process of carrying out weighted average on the whole image, a Gaussian template traverses each pixel point in the image by using a normalized Gaussian template, the central value of the template is replaced by the gray value of the weighted average to obtain a smoothed image, and the processing result is shown in fig. 3 (b); because the outlines of the object to be measured and the reference object are the outer edge parts of the object to be measured and the reference object, the object to be measured and the reference object are separated from the background image at the same time, the edge characteristics of the object in the image are extracted through an edge detection algorithm, a foundation is laid for the subsequent outline information extraction, and the extraction result is shown in fig. 3 (c); finally, the object edge null attack is eliminated through a mathematical morphology algorithm to improve the accuracy of contour extraction, and the result is shown in fig. 3 (d).
2. Extracting contour information of all objects in the image;
after the edge information of the object to be measured and the reference object is extracted, the outline of all objects in the image is extracted by a contour retrieval method, contour labeling is carried out in a color image initially acquired by an area-array camera, and the labeling result is shown in fig. 4, namely a red block diagram part.
3. Selecting and determining a reference object through preset index information;
setting the leftmost object as a reference object, and determining the first detected object as the reference object from left to right by detecting the outline arrangement of the objects; the measurement method needs to measure by referring to the position and size information of the object, for example: selecting a bus card as a reference object, and obtaining the card with the length of 85.6 mm and the width of 54.0 mm by pre-measurement, as shown in fig. 5; and (3) placing the card at the leftmost side of the image, further extracting information by sequencing the sizes of the position outlines of the objects in the image, and determining a reference object. The measured scale value determined with reference to the actual size of the object is pixel _ per _ metric.
pixel_per_metric=pixel_width/width (1)
Wherein, pixel _ width is used for expressing the number of unit pixels, and the pixel px is taken as a unit; the actual length of the object is referenced in width, in millimeters.
4. Marking all objects to be measured in the image in a scanning mode;
after the position of the reference object is determined, serial numbers are marked on the object with the extracted outline item by item from left to right in a scanning mode, so that size extraction can be performed on a single object conveniently in the subsequent processing process. The serial numbers correspond to the contours of the objects to be measured, and the smaller contour line areas are ignored, so that the contours of all the objects are labeled.
5. Respectively determining the frame and the vertex of the object to be measured, and calculating the central point and the connecting line of each frame;
if the contour region is large enough, the rotation boundary of the object is extracted, the frame of the object is drawn, and the coordinates of the vertex of the frame are returned. Defining a central point calculation function midpoint, taking out coordinates of four vertexes of the boundary, positioning the vertex position of the elliptic boundary by an averaging method, and calculating two adjacent vertexes (x)1,y1),(x2,y2) The center point coordinate is calculated as follows:
midpoint(x,y)=((x1+x2)/2,(y1+y2)/2) (2)
and marking the center points and connecting the corresponding center line points, as shown in FIG. 6, wherein FIG. 6(a) is a graph of the calculation result of the border and the center point of the oval coin to be measured, and FIG. 6(b) is a graph of the calculation result of the border and the center point of the rectangular iron box to be measured
6. Calculating Euclidean distances between corresponding middle points, and marking out actual size information of the object to be detected;
and finally, calculating the Euclidean distance between the corresponding central points by using an Euclidean formula to obtain the size rho of the object, namely:
wherein (x)z1,yz1),(xz2,yz2) Are coordinate values corresponding to the two center points. The calculation labeling result is shown in fig. 7, in which (a) is the information of the major axis and minor axis dimensions of the middle oval coin; (b) the length and width dimension information of the right rectangular iron box.
7. Summary of the invention
The invention provides a method for quickly measuring the size of an object based on a raspberry pie, which fully utilizes the digital image processing capacity of the raspberry pie, utilizes an area-array camera module installed on the raspberry pie to acquire an object to be measured and a reference object image, automatically and intelligently identifies the object to be measured in the image through preset size information of the reference object, and gives accurate size information of the object to be measured, improves the requirement that a traditional high-precision size measuring system based on machine vision still needs to calibrate the measuring system, and has better portability, so the system has wide application prospect in the field of industrial production.

Claims (1)

1. A method for quickly measuring the size of an object based on a raspberry pie mainly comprises the following steps:
(1) collecting and preprocessing an image of an object to be measured;
(2) extracting contour information of all objects in the image;
(3) selecting and determining a reference object through preset index information;
(4) marking all objects to be measured in the image in a scanning mode;
(5) respectively determining the frame and the vertex of the object to be measured, and calculating the central point and the connecting line of each frame;
(6) calculating Euclidean distances between corresponding central points, and marking the actual size information of the object to be measured;
in the step 1, through an area-array camera module arranged on a raspberry group platform, color images of an object to be measured and a reference object are collected and transmitted to a raspberry group processor chip, and edge gaps of all objects in the image are filled through a morphological method, so that the image is preprocessed;
in step 2, after extracting the edge information of the object to be measured and the reference object, marking the external contours of all objects in the collected color image by a contour retrieval method;
in step 3, the positions and the contour sizes of all objects in the image are counted to determine a reference object, and the measurement proportion value determined by the actual size of the reference object is pixel _ per _ metric which is pixel _ width/width, wherein pixel _ width represents the number of unit pixels and takes the pixels as units; the width is the real length of the reference object and the unit is millimeter;
step 4, after the position information of the reference object is determined, carrying out serial number annotation on the object to be measured after the contour is extracted one by one from left to right in a scanning mode;
in step 5, extracting a rotation boundary of the object to be measured according to the contour line region information, drawing an outer frame of the object to be measured, returning coordinates of a frame vertex, defining a central point calculation function midpoint, simultaneously extracting coordinates of four vertices of the boundary, wherein the vertex position of the elliptic boundary is positioned by an averaging method, and calculating two adjacent vertices (x)1,y1),(x2,y2) The calculation method comprises the following steps: midpoint (x, y) ═ x1+x2)/2,(y1+y2) /2), marking the connecting line with the corresponding center line point;
in step 6, Euclidean formula is used to calculate Euclidean distance between central points corresponding to the objects to be measured, and the key dimension information of the objects to be measured can be expressed asWherein (x)z1,yz1),(xz2,yz2) Is a coordinate value corresponding to the center point.
CN201910884198.7A 2019-09-18 2019-09-18 Object size rapid measurement method based on raspberry pie Pending CN110608685A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910884198.7A CN110608685A (en) 2019-09-18 2019-09-18 Object size rapid measurement method based on raspberry pie

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910884198.7A CN110608685A (en) 2019-09-18 2019-09-18 Object size rapid measurement method based on raspberry pie

Publications (1)

Publication Number Publication Date
CN110608685A true CN110608685A (en) 2019-12-24

Family

ID=68892129

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910884198.7A Pending CN110608685A (en) 2019-09-18 2019-09-18 Object size rapid measurement method based on raspberry pie

Country Status (1)

Country Link
CN (1) CN110608685A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111160470A (en) * 2019-12-30 2020-05-15 四川慈石召铁科技有限公司 Archaeological object form processing and analyzing method, device and computer storage medium
CN111612776A (en) * 2020-05-22 2020-09-01 福州数据技术研究院有限公司 Automatic pathological gross specimen size measuring method based on image edge recognition
CN112217970A (en) * 2020-08-29 2021-01-12 苏州无用科技有限公司 Photographing method and photographing system for remote processing of sunglass clamping piece
CN113137932A (en) * 2021-05-14 2021-07-20 淮阴工学院 Portable surface clearance measuring device and measuring method
CN113518182A (en) * 2021-06-30 2021-10-19 天津市农业科学院 Cucumber phenotype characteristic measuring method based on raspberry pie
CN113781481A (en) * 2021-11-11 2021-12-10 滨州学院 Method and device for non-contact measurement of shape and size of object and electronic equipment

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102102978A (en) * 2009-12-16 2011-06-22 Tcl集团股份有限公司 Handheld terminal, and method and device for measuring object by using same
CN103542807A (en) * 2012-07-16 2014-01-29 联想(北京)有限公司 Length measurement method and device, and electronic device
JP2014052383A (en) * 2013-11-11 2014-03-20 Meidensha Corp Chassis dynamometer
CN105043269A (en) * 2015-07-08 2015-11-11 上海与德通讯技术有限公司 Method for measuring size of object and electronic apparatus
KR101599235B1 (en) * 2015-01-14 2016-03-03 (주)에스시전시문화 3D photo scanner
CN105444678A (en) * 2015-11-09 2016-03-30 佛山绿怡信息科技有限公司 Handset size measurement method and system
CN110072040A (en) * 2019-04-22 2019-07-30 东华大学 A kind of image collecting device based on raspberry pie

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102102978A (en) * 2009-12-16 2011-06-22 Tcl集团股份有限公司 Handheld terminal, and method and device for measuring object by using same
CN103542807A (en) * 2012-07-16 2014-01-29 联想(北京)有限公司 Length measurement method and device, and electronic device
JP2014052383A (en) * 2013-11-11 2014-03-20 Meidensha Corp Chassis dynamometer
KR101599235B1 (en) * 2015-01-14 2016-03-03 (주)에스시전시문화 3D photo scanner
CN105043269A (en) * 2015-07-08 2015-11-11 上海与德通讯技术有限公司 Method for measuring size of object and electronic apparatus
CN105444678A (en) * 2015-11-09 2016-03-30 佛山绿怡信息科技有限公司 Handset size measurement method and system
CN110072040A (en) * 2019-04-22 2019-07-30 东华大学 A kind of image collecting device based on raspberry pie

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111160470A (en) * 2019-12-30 2020-05-15 四川慈石召铁科技有限公司 Archaeological object form processing and analyzing method, device and computer storage medium
CN111160470B (en) * 2019-12-30 2024-01-23 四川慈石召铁科技有限公司 Archaeological object form processing and analyzing method and device and computer storage medium
CN111612776A (en) * 2020-05-22 2020-09-01 福州数据技术研究院有限公司 Automatic pathological gross specimen size measuring method based on image edge recognition
CN112217970A (en) * 2020-08-29 2021-01-12 苏州无用科技有限公司 Photographing method and photographing system for remote processing of sunglass clamping piece
CN113137932A (en) * 2021-05-14 2021-07-20 淮阴工学院 Portable surface clearance measuring device and measuring method
CN113137932B (en) * 2021-05-14 2023-02-28 淮阴工学院 Portable surface clearance measuring device and measuring method
CN113518182A (en) * 2021-06-30 2021-10-19 天津市农业科学院 Cucumber phenotype characteristic measuring method based on raspberry pie
CN113781481A (en) * 2021-11-11 2021-12-10 滨州学院 Method and device for non-contact measurement of shape and size of object and electronic equipment

Similar Documents

Publication Publication Date Title
CN110608685A (en) Object size rapid measurement method based on raspberry pie
CN110689579B (en) Rapid monocular vision pose measurement method and measurement system based on cooperative target
CN110276808B (en) Method for measuring unevenness of glass plate by combining single camera with two-dimensional code
CN109612390B (en) Large-size workpiece automatic measuring system based on machine vision
CN105538345B (en) A kind of puma manipulator and positioning assembly method based on many camera lenses
CN101322589B (en) Non-contact type human body measuring method for clothing design
CN110672020A (en) Stand tree height measuring method based on monocular vision
CN110223355B (en) Feature mark point matching method based on dual epipolar constraint
CN102589516B (en) Dynamic distance measuring system based on binocular line scan cameras
CN109558871B (en) Pointer instrument reading identification method and device
CN107607053B (en) A kind of standing tree tree breast diameter survey method based on machine vision and three-dimensional reconstruction
CN107392849B (en) Target identification and positioning method based on image subdivision
CN107928675A (en) A kind of trunk measuring method being combined based on deep learning and red dot laser
CN105547834A (en) Fast stress-strain curve measuring system and method based on binocular vision
CN107358628B (en) Linear array image processing method based on target
CN110260818B (en) Electronic connector robust detection method based on binocular vision
CN107016353B (en) A kind of integrated method and system of variable resolution target detection and identification
CN113689401A (en) Method and device for detecting diameter of crystal bar of czochralski silicon single crystal furnace
CN106952262B (en) Ship plate machining precision analysis method based on stereoscopic vision
CN107084671A (en) A kind of recessed bulb diameter measuring system and measuring method based on three wire configuration light
CN111179335A (en) Standing tree measuring method based on binocular vision
CN111415378B (en) Image registration method for automobile glass detection and automobile glass detection method
CN116880353A (en) Machine tool setting method based on two-point gap
CN109740458B (en) Method and system for measuring physical characteristics based on video processing
CN113607058B (en) Straight blade size detection method and system based on machine vision

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
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20191224

WD01 Invention patent application deemed withdrawn after publication