CN111256596A - Size measuring method and device based on CV technology, computer equipment and medium - Google Patents

Size measuring method and device based on CV technology, computer equipment and medium Download PDF

Info

Publication number
CN111256596A
CN111256596A CN202010107483.0A CN202010107483A CN111256596A CN 111256596 A CN111256596 A CN 111256596A CN 202010107483 A CN202010107483 A CN 202010107483A CN 111256596 A CN111256596 A CN 111256596A
Authority
CN
China
Prior art keywords
measured object
image
boundary frame
measuring tool
information
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.)
Granted
Application number
CN202010107483.0A
Other languages
Chinese (zh)
Other versions
CN111256596B (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.)
Beijing Ronglian Yitong Information Technology Co ltd
Original Assignee
Beijing Ronglian Yitong Information Technology 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 Beijing Ronglian Yitong Information Technology Co ltd filed Critical Beijing Ronglian Yitong Information Technology Co ltd
Priority to CN202010107483.0A priority Critical patent/CN111256596B/en
Publication of CN111256596A publication Critical patent/CN111256596A/en
Application granted granted Critical
Publication of CN111256596B publication Critical patent/CN111256596B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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
    • 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
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/70Denoising; Smoothing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20084Artificial neural networks [ANN]

Landscapes

  • Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Geometry (AREA)
  • Image Analysis (AREA)
  • Length Measuring Devices By Optical Means (AREA)

Abstract

The invention discloses a size measuring method, a size measuring device, computer equipment and a size measuring medium based on a CV technology, wherein the method comprises the following steps: acquiring image information of a measuring tool and a measured object in a detection area; obtaining a first boundary frame of the measuring tool and a second boundary frame of the measured object according to the image information; calculating the number of pixel points in a first preset area in the first boundary frame to obtain a first number; calculating the number of pixel points in a second preset area in the second boundary frame to obtain a second number; according to the scale information of the measuring tools in the first preset area, the first quantity and the second quantity, the size information of the measured object is calculated.

Description

Size measuring method and device based on CV technology, computer equipment and medium
Technical Field
The invention relates to the technical field of intelligent measurement, in particular to a size measurement method and device based on a CV (constant value classification) technology, computer equipment and a medium.
Background
Traditional dimensional measurement mainly carries out manual measurement through measuring tool, like slide caliper, block gauge, feeler gauge etc. needs artifical the participation in measuring process, and operation process is also consuming time, generally need take up slide caliper and block the object or go to measure with the ruler, then read out dimensional data, and measuring error is big, and inefficiency.
Disclosure of Invention
The present invention is directed to solving, at least to some extent, one of the technical problems in the art described above. Therefore, a first objective of the present invention is to provide a size measuring method based on CV technology, which can automatically measure the size of the measured object, reduce the labor intensity, make the measurement more convenient and faster, and have precise measurement and high efficiency.
A second object of the invention is to propose a sizing device based on CV technology.
A third object of the invention is to propose a computer device.
A fourth object of the invention is to propose a computer-readable storage medium.
In order to achieve the above object, an embodiment of the first aspect of the present invention provides a size measuring method based on CV technology, including:
acquiring image information of a measuring tool and a measured object in a detection area;
obtaining a first boundary frame of the measuring tool and a second boundary frame of the measured object according to the image information;
calculating the number of pixel points in a first preset area in the first boundary frame to obtain a first number;
calculating the number of pixel points in a second preset area in the second boundary frame to obtain a second number;
and calculating the size information of the measured object according to the scale information of the measuring tools in the first preset area, the first quantity and the second quantity.
According to the size measuring method based on the CV technology, provided by the embodiment of the first aspect of the invention, a measuring tool and a measured object are placed in a detection area, and image information of the measuring tool and the measured object in the detection area is acquired; the method comprises the steps of identifying a measuring tool and the area of a measured object in image information, generating a first boundary frame of the measuring tool and a second boundary frame of the measured object, wherein the number of pixel points of a first preset area in the first boundary frame is a first number, the number of pixel points of a second preset area in the second boundary frame is a second number, and calculating size information of the measured object according to scale information, the first number and the second number of the measuring tool in the first preset area. According to the size measuring method based on the CV technology, the image recognition technology is used, the size of a measured object can be automatically measured, the manual working strength is reduced, the measurement is more convenient and faster, and the measurement precision and the measurement efficiency are high.
According to some embodiments of the present invention, the obtaining a first bounding box of the measuring tool and a second bounding box of the measured object according to the image information includes:
preprocessing the image information;
acquiring preprocessed image information, and extracting the characteristics of the measuring tool and the measured object in the preprocessed image information;
carrying out target classification on the measuring tool and the measured object after feature extraction to respectively generate a first class and a second class;
and generating a first boundary frame of the measuring tool in the first class and a second boundary frame of the measured object in the second class.
According to some embodiments of the invention, the pre-processing comprises image filtering denoising, image binarization and image compression processing.
According to some embodiments of the invention, the image compression process displays regular features between pixels in an image by computationally gathering image information at a low-frequency part at the upper left corner of an image matrix;
the calculation formula is as follows:
Figure BDA0002388887800000031
p=0,q=0
Figure BDA0002388887800000032
p=1,2···,H-1,q=0
Figure BDA0002388887800000033
p=0,q=1,2···,Z-1
Figure BDA0002388887800000034
p=1,2···,H-1,q=1,2···,Z-1
where F (x, y) is a sequence function of H, Z points in the time domain, x is 0,1,2, H-1, y is 0,1,2, Z-1, and F (p, q) is a transform coefficient at (p, q), a transformed coefficient matrix can be obtained, and feature information on the image can be obtained.
According to some embodiments of the invention, the performing feature extraction on the measurement tool and the measured object in the preprocessed image information comprises: and extracting the characteristics of the measuring tool and the measured object in the preprocessed image information by adopting a trained area detection network.
According to some embodiments of the invention, obtaining the trained area detection network comprises:
acquiring N sample images marked with the first boundary frame and the second boundary frame;
detecting the sample image according to a preset area detection network, wherein a third bounding box and a fourth bounding box are respectively generated in the sample image, and N third bounding boxes and N fourth bounding boxes are obtained from N sample images;
calculating first similarity information of the first bounding box and the third bounding box in the N sample images;
calculating second similarity information of the second bounding box and the fourth bounding box in the N sample images;
and training the preset area detection network according to the first similarity information and the second similarity information to obtain the trained area detection network.
According to some embodiments of the invention, the first predetermined area is a rectangular area of a × L1, and the second predetermined area is a rectangular area of a × L2;
the scale information of the measuring tool comprises the length of the measuring tool, and the size information of the measured object comprises the length of the measuring tool;
the size of the measured object is calculated by the following formula:
L2=L1*S2/S1
wherein L1 is the length of the measuring tool, L2 is the length of the object to be measured, S1 is the first number, and S2 is the second number.
In order to achieve the above object, a second embodiment of the present invention provides a dimension measuring device based on CV technology, including:
the first acquisition module is used for acquiring image information of a measuring tool and a measured object in the detection area;
the image processing module is used for obtaining a first boundary frame of the measuring tool and a second boundary frame of the measured object according to the image information;
the calculation module is used for:
calculating the number of pixel points in a first preset area in the first boundary frame to obtain a first number;
calculating the number of pixel points in a second preset area in the second boundary frame to obtain a second number;
and calculating the size information of the measured object according to the scale information of the measuring tools in the first preset area, the first quantity and the second quantity.
According to the size measuring device based on the CV technology, provided by the embodiment of the second aspect of the invention, a measuring tool and a measured object are placed in a detection area, and image information of the measuring tool and the measured object in the detection area is acquired; the method comprises the steps of identifying a measuring tool and the area of a measured object in image information, generating a first boundary frame of the measuring tool and a second boundary frame of the measured object, wherein the number of pixel points of a first preset area in the first boundary frame is a first number, the number of pixel points of a second preset area in the second boundary frame is a second number, and calculating size information of the measured object according to scale information, the first number and the second number of the measuring tool in the first preset area. This size measurement device based on CV technique utilizes image recognition technology, can measure the size of testee automatically, reduces artificial working strength, makes to measure convenient and fast more, and measurement accuracy and measurement of efficiency are high.
According to some embodiments of the invention, the image processing module comprises:
the image preprocessing module is used for preprocessing the image information;
the characteristic extraction module is used for acquiring the preprocessed image information and extracting the characteristics of the measuring tool and the measured object in the preprocessed image information;
the target classification module is used for performing target classification on the measuring tool and the measured object after the features are extracted, and respectively generating a first class and a second class;
and the boundary generating module is used for generating a first boundary frame of the measuring tool in the first class and a second boundary frame of the measured object in the second class.
To achieve the above object, a third embodiment of the present invention provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and running on the processor, and the processor implements the method as described above when executing the program.
The computer equipment and the method for measuring the size based on the CV technology have the advantages that the computer equipment and the method for measuring the size based on the CV technology can realize the advantages and the details are not repeated herein.
To achieve the above object, a fourth aspect of the present invention provides a computer-readable storage medium, on which a computer program is stored, the computer program implementing the method as described above when being executed by a processor.
The beneficial effects of the computer-readable storage medium and the size measuring method based on the CV technology can be realized, and the details are not repeated herein.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and drawings.
The technical solution of the present invention is further described in detail by the accompanying drawings and embodiments.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the principles of the invention and not to limit the invention. In the drawings:
FIG. 1 is a flow diagram of a dimensional measurement method based on CV techniques in accordance with one embodiment of the present invention;
FIG. 2 is a flow chart of a dimensional measurement method based on CV techniques in accordance with another embodiment of the present invention;
FIG. 3 is a flow diagram of acquiring a trained area detection network according to one embodiment of the present invention;
FIG. 4 is a block diagram of a dimensional measurement device based on CV technology in accordance with one embodiment of the present invention;
fig. 5 is a block diagram of a dimensional measurement device based on CV technology in accordance with one embodiment of the invention.
Reference numerals:
the system comprises a first acquisition module 1, an image processing module 2, an image preprocessing module 21, a feature extraction module 22, a target classification module 23, a boundary generation module 24 and a calculation module 3.
Detailed Description
The preferred embodiments of the present invention will be described in conjunction with the accompanying drawings, and it will be understood that they are described herein for the purpose of illustration and explanation and not limitation.
The dimensional measurement method, apparatus, computer device, and medium based on CV technology proposed by the embodiments of the present invention are described below with reference to fig. 1 to 5.
The invention discloses a dimension measuring method, a dimension measuring device, computer equipment and a medium based on CV technology. Before, an application scenario related to various embodiments of the present disclosure is first described. In an application scene, computer vision (computer vision) is used for replacing human eyes to perform machine vision such as identification, tracking and measurement on a target, and further performing graphic processing, so that the computer processing becomes an image more suitable for human eyes to observe or transmitted to an instrument to detect.
FIG. 1 is a flow diagram of a dimensional measurement method based on CV techniques in accordance with one embodiment of the present invention; as shown in fig. 1, the embodiment of the first aspect of the present invention provides a size measuring method based on CV technology, the steps include S1-S5:
s1, acquiring image information of the measuring tool and the measured object in the detection area;
s2, obtaining a first boundary frame of the measuring tool and a second boundary frame of the measured object according to the image information;
s3, calculating the number of pixel points in a first preset area in the first boundary frame to obtain a first number;
s4, calculating the number of pixel points in a second preset area in the second boundary frame to obtain a second number;
and S5, calculating the size information of the measured object according to the scale information, the first number and the second number of the measuring tools in the first preset area.
According to the working principle of the technical scheme, according to the size measuring method based on the CV technology, provided by the embodiment of the first aspect of the invention, the measuring tool and the measured object are placed in the detection area, and the detection area can be on a desktop or a production line with a fixed horizontal position, which is not limited by the invention. Preferably, the measuring means and the object to be measured are placed in parallel and in close proximity in the examination area. Acquiring image information of a measuring tool and a measured object in a detection area; the method comprises the steps of identifying a measuring tool and the area of a measured object in image information, generating a first boundary frame of the measuring tool and a second boundary frame of the measured object, wherein the number of pixel points of a first preset area in the first boundary frame is a first number, the number of pixel points of a second preset area in the second boundary frame is a second number, and calculating size information of the measured object according to scale information, the first number and the second number of the measuring tool in the first preset area.
The image information of the measuring tool and the measured object in the detection area can be acquired by the camera and the CCD (Complementary Charged device) and the CMOS (Complementary Metal-Oxide Semiconductor) camera, and the acquired image information has high precision and is easy to process.
The first boundary frame is used for detecting the area where the measuring tool is located in the image information, determining the area where the measuring tool is located in the image information through edge detection, generating the first boundary frame, and framing the area by using a closed line.
The second boundary frame is used for detecting the area where the object to be detected is located in the image information, determining the area where the object to be detected is located in the image information through edge detection, generating the second boundary frame and framing the area by using a closed line.
The beneficial effects of the above technical scheme are that: according to the size measuring method based on the CV technology, the image recognition technology is used, the size of a measured object can be automatically measured, the manual working strength is reduced, the measurement is more convenient and faster, and the measurement is accurate and efficient.
FIG. 2 is a flow chart of a dimensional measurement method based on CV techniques in accordance with another embodiment of the present invention; as shown in fig. 2, the step of obtaining the first bounding box of the measuring tool and the second bounding box of the measured object according to the image information includes steps S6-S9:
s6, preprocessing the image information;
s7, acquiring preprocessed image information, and extracting the characteristics of the measuring tool and the measured object in the preprocessed image information;
s8, carrying out target classification on the measuring tool and the measured object after feature extraction, and respectively generating a first class and a second class;
and S9, generating a first boundary frame of the measuring tool in the first class and a second boundary frame of the measured object in the second class.
The working principle and the beneficial effects of the technical scheme are as follows: the image information is preprocessed, wherein the preprocessing comprises image filtering denoising and image binarization processing, the image information can be filtered and noise eliminated through preprocessing, the image contour or lines become clear, the image information can be selectively enhanced or suppressed to improve the visual effect of the image, and the image information is converted into a form more suitable for machine processing so as to be convenient for data extraction or image information identification.
The input region of interest may be a rectangular region including a measurement tool and an object to be measured, and may extract a region to be selected in the image, remove an extraneous region, and improve image processing efficiency. And performing feature extraction on the measuring tool and the measured object in the preprocessed image information, wherein the feature extraction depends on a deep convolution neural network. The deep convolutional neural network model is mainly used for building a network structure by taking a convolutional layer, a pooling layer and a full connection layer as main components. The convolutional layers and the pooling layers usually alternate multiple times in a deep network, and the depth refers to a structure with multiple convolutional layers and pooling layers. The fully-connected layer appears in the last layers of the deep convolutional neural network model, and mainly converts the convolutional characteristic diagram output by the convolutional layer into a characteristic vector with a fixed length. The image information can be provided with a plurality of measured objects and 1 measuring tool, the measuring tool and the measured objects after the characteristic extraction are subjected to target classification, specifically, the measuring tool after the characteristic extraction is in a first type, and the measured objects after the characteristic extraction are in a second type, so that the target classification is carried out, and the sizes of the measured objects can be measured more effectively. And generating a first boundary frame of the measuring tool in the first class and a second boundary frame of each measured object in the second class.
In one embodiment, the preprocessing includes image filtering denoising, image binarization, and image compression processing.
In order to improve the identification precision of the image, the image is filtered and denoised, the noise of the image mainly comprises surface dirt and image shadow, the surface dirt is basically unremoved and can only be processed by an error correction algorithm of the image, and the filtering algorithm is used for processing in order to reduce the influence of the noise on the image.
The image filtering mainly adopts spatial filtering to process the image.
The image binarization processing generally refers to an image with each pixel of the image having only two gray values, the binarization image has the advantages of small operation amount, high processing speed, small occupied storage space and the like, and other related processing can be conveniently performed on the binarized image, so that important information or characteristics in the image can be obtained.
The image compression processing is to gather the image information at the low-frequency part of the upper left corner of the image matrix through calculation, and show the regular characteristics among all the pixel points in the image;
the calculation formula is as follows:
Figure BDA0002388887800000091
p=0,q=0
Figure BDA0002388887800000092
p=1,2···,H-1,q=0
Figure BDA0002388887800000101
p=0,q=1,2···,Z-1
Figure BDA0002388887800000102
p=1,2···,H-1,q=1,2···,Z-1
where F (x, y) is a sequence function of H, Z points in the time domain, x is 0,1,2, H-1, y is 0,1,2, Z-1, and F (p, q) is a transform coefficient at (p, q), a transformed coefficient matrix can be obtained, and feature information on the image can be obtained.
The beneficial effects of the above technical scheme are that: the image may be divided into 8 by 8 sub-blocks, i.e. p-8 and q-8. And p is 0, the point where q is 0 is a direct current coefficient, the rest points are alternating current coefficients, and the pixel points on the image have correlation. The conversion through the calculation formula is beneficial to compressing the image information, so that the image data can be stored in a narrow storage space, and meanwhile, the image information is compressed, so that the image transmission efficiency can be more efficient.
According to some embodiments of the invention, the performing feature extraction on the measurement tool and the measured object in the preprocessed image information comprises: and extracting the characteristics of the measuring tool and the measured object in the preprocessed image information by adopting a trained area detection network.
The beneficial effects of the above technical scheme are that: by adopting the trained area detection network, the detection precision of the area can be improved, and the accuracy of image identification is further improved.
FIG. 3 is a flow diagram of acquiring a trained area detection network according to one embodiment of the present invention; as shown in fig. 3, the step of acquiring the trained area detection network includes steps S10-S14:
s10, acquiring N sample images marked with the first boundary frame and the second boundary frame;
s11, detecting the sample image according to a preset area detection network, generating a third bounding box and a fourth bounding box in the sample image respectively, and obtaining N third bounding boxes and N fourth bounding boxes in N sample images;
s12, calculating first similarity information of the first bounding box and the third bounding box in the N sample images;
s13, calculating second similarity information of the second bounding box and the fourth bounding box in the N sample images;
s14, training the preset area detection network according to the first similarity information and the second similarity information to obtain the trained area detection network.
The working principle of the technical scheme is as follows: acquiring N sample images, wherein each sample image is marked with a first boundary frame and a second boundary frame, detecting the sample images according to a preset area detection network, generating a third boundary frame and a fourth boundary frame in the N samples respectively, and calculating first similarity information of the first boundary frame and the third boundary frame in the N sample images; calculating second similarity information of a second boundary frame and a fourth boundary frame in the N sample images; and training the preset area detection network according to the first similarity information and the second similarity information, and finely adjusting the preset area detection network to obtain the trained area detection network, thereby being beneficial to image recognition of a measuring tool and a measured object in the image information.
According to some embodiments of the invention, the first predetermined area is a rectangular area of a × L1, and the second predetermined area is a rectangular area of a × L2;
the scale information of the measuring tool comprises the length of the measuring tool, and the size information of the measured object comprises the length of the measuring tool;
the size of the measured object is calculated by the following formula:
L2=L1*S2/S1
wherein L1 is the length of the measuring tool, L2 is the length of the object to be measured, S1 is the first number, and S2 is the second number.
For example, the width of the first preset area is the same as that of the second preset area, and the size information of the measured object can be accurately calculated through a calculation formula according to the scale information, the first number and the second number of the measuring tools.
FIG. 4 is a block diagram of a dimensional measurement device based on CV technology in accordance with one embodiment of the present invention; as shown in fig. 4, a second embodiment of the present invention provides a dimension measuring device based on CV technology, including:
the first acquisition module 1 is used for acquiring image information of a measuring tool and a measured object in a detection area;
the image processing module 2 is used for obtaining a first boundary frame of the measuring tool and a second boundary frame of the measured object according to the image information;
the calculation module 3 is configured to:
calculating the number of pixel points in a first preset area in the first boundary frame to obtain a first number;
calculating the number of pixel points in a second preset area in the second boundary frame to obtain a second number;
and calculating the size information of the measured object according to the scale information of the measuring tools in the first preset area, the first quantity and the second quantity.
According to the working principle of the technical scheme, according to the size measuring device based on the CV technology provided by the embodiment of the second aspect of the invention, the measuring tool and the measured object are placed in the detection area, and the detection area can be a desktop or a production line with a fixed horizontal position, which is not limited by the invention. Preferably, the measuring means and the object to be measured are placed in parallel and in close proximity in the examination area. Acquiring image information of a measuring tool and a measured object in a detection area; the method comprises the steps of identifying a measuring tool and the area of a measured object in image information, generating a first boundary frame of the measuring tool and a second boundary frame of the measured object, wherein the number of pixel points of a first preset area in the first boundary frame is a first number, the number of pixel points of a second preset area in the second boundary frame is a second number, and calculating size information of the measured object according to scale information, the first number and the second number of the measuring tool in the first preset area.
The first acquisition module 1 includes a camera, a photoelectric conversion device ccd (coupled Charged device), and a Complementary Metal-Oxide Semiconductor CMOS (Complementary Metal-Oxide Semiconductor) camera, and acquires image information of the measurement tool and the object to be measured in the detection area through the first acquisition module 1, and the acquired image information has high accuracy and is easy to process the image information.
The first boundary frame is used for detecting the area where the measuring tool is located in the image information, determining the area where the measuring tool is located in the image information through edge detection, generating the first boundary frame, and framing the area by using a closed line.
The second boundary frame is used for detecting the area where the object to be detected is located in the image information, determining the area where the object to be detected is located in the image information through edge detection, generating the second boundary frame and framing the area by using a closed line.
The beneficial effects of the above technical scheme are that: this size measurement device based on CV technique utilizes image recognition technology, can measure the size of testee automatically, reduces artificial working strength, makes to measure convenient and fast more, and measurement accuracy and measurement of efficiency are high.
FIG. 5 is a block diagram of a dimensional measurement device based on CV technology in accordance with a further embodiment of the present invention; as shown in fig. 5, the image processing module 2 includes:
an image preprocessing module 21, configured to preprocess the image information;
the feature extraction module 22 is configured to obtain preprocessed image information, and perform feature extraction on the measurement tool and the measured object in the preprocessed image information;
the target classification module 23 is configured to perform target classification on the measurement tool and the measured object after feature extraction, and generate a first class and a second class respectively;
the boundary generating module 24 is configured to generate a first boundary frame of the measuring tool in the first category and a second boundary frame of the measured object in the second category.
The working principle and the beneficial effects of the technical scheme are as follows: the image information is preprocessed, wherein the preprocessing comprises image filtering denoising, image binarization and image compression processing, the image information can be filtered and noise eliminated through the preprocessing, so that the image contour or lines become clear, the image information can be selectively enhanced or inhibited to improve the visual effect of the image, and the image information is converted into a form more suitable for machine processing so as to be convenient for data extraction or image information identification; the image compression processing enables image data to be stored in a narrow storage space, and simultaneously compresses image information, so that the image transmission efficiency can be more efficient.
The input region of interest may be a rectangular region including a measurement tool and an object to be measured, and may extract a region to be selected in the image, remove an extraneous region, and improve image processing efficiency. And performing feature extraction on the measuring tool and the measured object in the preprocessed image information, wherein the feature extraction depends on a deep convolution neural network. The deep convolutional neural network model is mainly used for building a network structure by taking a convolutional layer, a pooling layer and a full connection layer as main components. The convolutional layers and the pooling layers usually alternate multiple times in a deep network, and the depth refers to a structure with multiple convolutional layers and pooling layers. The fully-connected layer appears in the last layers of the deep convolutional neural network model, and mainly converts the convolutional characteristic diagram output by the convolutional layer into a characteristic vector with a fixed length. The image information can be provided with a plurality of measured objects and 1 measuring tool, the measuring tool and the measured objects after the characteristic extraction are subjected to target classification, specifically, the measuring tool after the characteristic extraction is in a first type, and the measured objects after the characteristic extraction are in a second type, so that the target classification is carried out, and the sizes of the measured objects can be measured more effectively. And generating a first boundary frame of the measuring tool in the first class and a second boundary frame of each measured object in the second class.
To achieve the above object, a third embodiment of the present invention provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and running on the processor, and the processor implements the method as described above when executing the program.
The computer equipment and the method for measuring the size based on the CV technology have the advantages that the computer equipment and the method for measuring the size based on the CV technology can realize the advantages and the details are not repeated herein.
To achieve the above object, a fourth aspect of the present invention provides a computer-readable storage medium, on which a computer program is stored, the computer program implementing the method as described above when being executed by a processor.
The beneficial effects of the computer-readable storage medium and the size measuring method based on the CV technology can be realized, and the details are not repeated herein.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (11)

1. A dimension measurement method based on CV technology is characterized by comprising the following steps:
acquiring image information of a measuring tool and a measured object in a detection area;
obtaining a first boundary frame of the measuring tool and a second boundary frame of the measured object according to the image information;
calculating the number of pixel points in a first preset area in the first boundary frame to obtain a first number;
calculating the number of pixel points in a second preset area in the second boundary frame to obtain a second number;
and calculating the size information of the measured object according to the scale information of the measuring tools in the first preset area, the first quantity and the second quantity.
2. The CV-technology-based dimension measurement method according to claim 1, wherein the obtaining a first bounding box of the measurement tool and a second bounding box of the measured object from the image information includes:
preprocessing the image information;
acquiring preprocessed image information, and extracting the characteristics of the measuring tool and the measured object in the preprocessed image information;
carrying out target classification on the measuring tool and the measured object after feature extraction to respectively generate a first class and a second class;
and generating a first boundary frame of the measuring tool in the first class and a second boundary frame of the measured object in the second class.
3. The CV-technology-based dimension measuring method of claim 2, wherein the preprocessing comprises image filtering denoising, image binarization, and image compression processing.
4. The CV-technology-based dimension measurement method according to claim 3, wherein the image compression process is used for displaying regular features among pixel points in the image by computationally gathering image information in a low-frequency part at the upper left corner of an image matrix;
the calculation formula is as follows:
Figure FDA0002388887790000021
Figure FDA0002388887790000022
Figure FDA0002388887790000023
Figure FDA0002388887790000024
where F (x, y) is a sequence function of H, Z points in the time domain, x is 0,1,2, H-1, y is 0,1,2, Z-1, and F (p, q) is a transform coefficient at (p, q), a transformed coefficient matrix can be obtained, and feature information on the image can be obtained.
5. The CV-technology-based dimension measuring method according to claim 2, wherein the performing feature extraction on the measuring tool and the measured object in the preprocessed image information comprises: and extracting the characteristics of the measuring tool and the measured object in the preprocessed image information by adopting a trained area detection network.
6. The CV-technology-based dimension measurement method of claim 5, wherein obtaining the trained area detection network comprises:
acquiring N sample images marked with the first boundary frame and the second boundary frame;
detecting the sample image according to a preset area detection network, wherein a third bounding box and a fourth bounding box are respectively generated in the sample image, and N third bounding boxes and N fourth bounding boxes are obtained from N sample images;
calculating first similarity information of the first bounding box and the third bounding box in the N sample images;
calculating second similarity information of the second bounding box and the fourth bounding box in the N sample images;
and training the preset area detection network according to the first similarity information and the second similarity information to obtain the trained area detection network.
7. The CV-technology-based dimension measuring method of claim 1, wherein the first predetermined area is a rectangular area of a × L1, and the second predetermined area is a rectangular area of a × L2;
the scale information of the measuring tool comprises the length of the measuring tool, and the size information of the measured object comprises the length of the measuring tool;
the size of the measured object is calculated by the following formula:
L2=L1*S2/S1
wherein L1 is the length of the measuring tool, L2 is the length of the object to be measured, S1 is the first number, and S2 is the second number.
8. A dimension measuring device based on CV technology is characterized by comprising:
the first acquisition module is used for acquiring image information of a measuring tool and a measured object in the detection area;
the image processing module is used for obtaining a first boundary frame of the measuring tool and a second boundary frame of the measured object according to the image information;
the calculation module is used for:
calculating the number of pixel points in a first preset area in the first boundary frame to obtain a first number;
calculating the number of pixel points in a second preset area in the second boundary frame to obtain a second number;
and calculating the size information of the measured object according to the scale information of the measuring tools in the first preset area, the first quantity and the second quantity.
9. The CV-technology-based dimension measuring device of claim 7, wherein the image processing module comprises:
the image preprocessing module is used for preprocessing the image information;
the characteristic extraction module is used for acquiring the preprocessed image information and extracting the characteristics of the measuring tool and the measured object in the preprocessed image information;
the target classification module is used for performing target classification on the measuring tool and the measured object after the features are extracted, and respectively generating a first class and a second class;
and the boundary generating module is used for generating a first boundary frame of the measuring tool in the first class and a second boundary frame of the measured object in the second class.
10. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the method according to any of claims 1-7 when executing the program.
11. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-7.
CN202010107483.0A 2020-02-21 2020-02-21 Size measuring method and device based on CV technology, computer equipment and medium Active CN111256596B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010107483.0A CN111256596B (en) 2020-02-21 2020-02-21 Size measuring method and device based on CV technology, computer equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010107483.0A CN111256596B (en) 2020-02-21 2020-02-21 Size measuring method and device based on CV technology, computer equipment and medium

Publications (2)

Publication Number Publication Date
CN111256596A true CN111256596A (en) 2020-06-09
CN111256596B CN111256596B (en) 2021-09-14

Family

ID=70952886

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010107483.0A Active CN111256596B (en) 2020-02-21 2020-02-21 Size measuring method and device based on CV technology, computer equipment and medium

Country Status (1)

Country Link
CN (1) CN111256596B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112802087A (en) * 2021-02-04 2021-05-14 上海中通吉网络技术有限公司 Method and device for detecting overall volume of deposit and electronic equipment
CN113344878A (en) * 2021-06-09 2021-09-03 北京容联易通信息技术有限公司 Image processing method and system

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE4313688A1 (en) * 1993-04-27 1994-11-03 Taurus Daten & Mestechnik Gmbh Method for determining the screening equivalent particle size distribution of a particle mixture
JP3668653B2 (en) * 1999-11-01 2005-07-06 株式会社大林組 Dimension and shape measurement method using digital camera
CN101216304A (en) * 2007-01-04 2008-07-09 财团法人工业技术研究院 Systems and methods for object dimension estimation
CN101493945A (en) * 2009-03-13 2009-07-29 北京航空航天大学 Point interference image compression method and device based on wavelet transform
CN102441581A (en) * 2010-09-30 2012-05-09 邓玥 Machine vision-based device and method for online detection of structural steel section size
CN102970544A (en) * 2012-12-07 2013-03-13 豪威科技(上海)有限公司 JPEG (Joint Photographic Experts Group) encoding and decoding method and JPEG encoding and decoding system
CN103090823A (en) * 2013-01-15 2013-05-08 北京汽车股份有限公司 Method and device for computing area of irregular figure
CN104182757A (en) * 2013-05-22 2014-12-03 内蒙古大学 Method of acquiring actual coverage area of measured target and device
CN105100495A (en) * 2015-08-25 2015-11-25 李万鸿 Method for measuring a plan view size of an object by utilizing a mobile phone photographing function
CN105392014A (en) * 2015-11-05 2016-03-09 天津津航计算技术研究所 Optimized wavelet transformation image compression method
CN105865326A (en) * 2015-01-21 2016-08-17 成都理想境界科技有限公司 Object size measurement method and image database data acquisition method
CN110349201A (en) * 2019-07-07 2019-10-18 创新奇智(合肥)科技有限公司 A kind of suit length measurement method, system and electronic equipment neural network based

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE4313688A1 (en) * 1993-04-27 1994-11-03 Taurus Daten & Mestechnik Gmbh Method for determining the screening equivalent particle size distribution of a particle mixture
JP3668653B2 (en) * 1999-11-01 2005-07-06 株式会社大林組 Dimension and shape measurement method using digital camera
CN101216304A (en) * 2007-01-04 2008-07-09 财团法人工业技术研究院 Systems and methods for object dimension estimation
CN101493945A (en) * 2009-03-13 2009-07-29 北京航空航天大学 Point interference image compression method and device based on wavelet transform
CN102441581A (en) * 2010-09-30 2012-05-09 邓玥 Machine vision-based device and method for online detection of structural steel section size
CN102970544A (en) * 2012-12-07 2013-03-13 豪威科技(上海)有限公司 JPEG (Joint Photographic Experts Group) encoding and decoding method and JPEG encoding and decoding system
CN103090823A (en) * 2013-01-15 2013-05-08 北京汽车股份有限公司 Method and device for computing area of irregular figure
CN104182757A (en) * 2013-05-22 2014-12-03 内蒙古大学 Method of acquiring actual coverage area of measured target and device
CN105865326A (en) * 2015-01-21 2016-08-17 成都理想境界科技有限公司 Object size measurement method and image database data acquisition method
CN105100495A (en) * 2015-08-25 2015-11-25 李万鸿 Method for measuring a plan view size of an object by utilizing a mobile phone photographing function
CN105392014A (en) * 2015-11-05 2016-03-09 天津津航计算技术研究所 Optimized wavelet transformation image compression method
CN110349201A (en) * 2019-07-07 2019-10-18 创新奇智(合肥)科技有限公司 A kind of suit length measurement method, system and electronic equipment neural network based

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112802087A (en) * 2021-02-04 2021-05-14 上海中通吉网络技术有限公司 Method and device for detecting overall volume of deposit and electronic equipment
CN113344878A (en) * 2021-06-09 2021-09-03 北京容联易通信息技术有限公司 Image processing method and system

Also Published As

Publication number Publication date
CN111256596B (en) 2021-09-14

Similar Documents

Publication Publication Date Title
CN107478657A (en) Stainless steel surfaces defect inspection method based on machine vision
CN108090894B (en) Fabric defect detection method based on distance matching function and perceptual hash algorithm
CN107230203B (en) Casting defect identification method based on human eye visual attention mechanism
CN112348787A (en) Training method of object defect detection model, object defect detection method and device
CN105447512A (en) Coarse-fine optical surface defect detection method and coarse-fine optical surface defect detection device
CN111256596B (en) Size measuring method and device based on CV technology, computer equipment and medium
CN112233067A (en) Hot rolled steel coil end face quality detection method and system
CN107742307A (en) Based on the transmission line galloping feature extraction and parameters analysis method for improving frame difference method
CN105678767A (en) SoC software and hardware collaborative design-based cloth surface blemish detection method
CN111415339B (en) Image defect detection method for complex texture industrial product
CN110334727B (en) Intelligent matching detection method for tunnel cracks
CN115797354A (en) Method for detecting appearance defects of laser welding seam
CN115684176A (en) Online visual inspection system for film surface defects
CN112634159A (en) Hyperspectral image denoising method based on blind noise estimation
CN110322470A (en) Action recognition device, action recognition method and recording medium
CN116152697A (en) Three-dimensional model measuring method and related device for concrete structure cracks
Apdilah et al. A study of Frei-Chen approach for edge detection
CN109272484B (en) Rainfall detection method based on video image
CN113850769A (en) Hyperspectral change detection method based on Simese space spectrum joint convolution network
CN112614113A (en) Strip steel defect detection method based on deep learning
CN115294119B (en) Machine vision-based method for detecting stains in inner grooves of heads of plum-blossom-shaped threads
CN116645418A (en) Screen button detection method and device based on 2D and 3D cameras and relevant medium thereof
CN110533663B (en) Image parallax determining method, device, equipment and system
CN114550149A (en) Pointer instrument reading method and system based on deep learning
CN107123105A (en) Images match defect inspection method based on FAST algorithms

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