CN113709167B - Compression transmission method of appearance detection data - Google Patents
Compression transmission method of appearance detection data Download PDFInfo
- Publication number
- CN113709167B CN113709167B CN202111018009.1A CN202111018009A CN113709167B CN 113709167 B CN113709167 B CN 113709167B CN 202111018009 A CN202111018009 A CN 202111018009A CN 113709167 B CN113709167 B CN 113709167B
- Authority
- CN
- China
- Prior art keywords
- variance
- products
- size
- position parameters
- set value
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/04—Protocols for data compression, e.g. ROHC
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/06—Notations for structuring of protocol data, e.g. abstract syntax notation one [ASN.1]
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02P—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
- Y02P90/00—Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
- Y02P90/30—Computing systems specially adapted for manufacturing
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Compression, Expansion, Code Conversion, And Decoders (AREA)
Abstract
The invention relates to a compression transmission method of appearance detection data. The method comprises the following steps: s1, obtaining size and position parameters of a continuous product; s2, calculating the variance of the size and position parameters of the latest continuous n (not less than 3) pieces of products, if the variance is less than a set value, calculating the arithmetic mean value of each parameter of the n pieces of products as the reference value of the corresponding parameter, and transmitting the reference value to data processing equipment; if the variance is larger than the set value, returning to S1, and re-acquiring the parameters of the latest continuous n products; s3, obtaining the size and position parameters of subsequent products, calculating the variance of the size and position parameters of the latest continuous n pieces of products, and if the variance is smaller than a set value, respectively subtracting the corresponding reference values from the size and position parameters of the subsequent products to obtain respective offset; if the variance is larger than the set value, returning to S2, and recalculating the reference value; and S4, expanding the offset by m times, rounding, converting the obtained integer into a short integer format, and transmitting the short integer format to data processing equipment.
Description
Technical Field
The invention relates to a compression transmission method of appearance detection data. The method is suitable for the technical field of appearance detection.
Background
On a product production line in an automatic factory, an industrial camera and a detection system matched with the industrial camera are often used for detecting the appearance of a product to determine whether the surface of the product is flawless, the size is normal or not, and the original data volume is often larger under the condition of higher requirement on detection precision.
At present, generally, a distributed acquisition processing system is adopted, that is, an industrial camera is installed on a computer with a specific acquisition peripheral to acquire raw data, a program responsible for processing the data is installed on another computer, data transmission is performed between the computers through an Ethernet, a detection program is connected with the camera to acquire the raw data, and the data is transmitted to a data processing program, but a large data volume generally increases the burden of network transmission, increases the program calculation cost, and reduces the stability of the system.
Disclosure of Invention
The technical problem to be solved by the invention is as follows: in view of the above existing problems, a method for compressing and transmitting appearance detection data is provided to compress and transmit the data, thereby improving the execution efficiency and stability of the system.
The technical scheme adopted by the invention is as follows: a compression transmission method of appearance detection data is characterized in that:
s1, obtaining size and position parameters of a product;
s2, calculating the variance of the size and position parameters of the latest continuous n (not less than 3) pieces of products, if the variance is less than a set value, calculating the arithmetic mean value of each parameter of the n pieces of products as the reference value of the corresponding parameter, and transmitting the reference value to data processing equipment; if the variance is larger than the set value, returning to S1, and re-acquiring the parameters of the latest continuous n products;
s3, obtaining the size and position parameters of subsequent products, calculating the variance of the size and position parameters of the latest continuous n pieces of products, and if the variance is smaller than a set value, respectively subtracting the corresponding reference values from the size and position parameters of the subsequent products to obtain respective offset; if the variance is larger than the set value, returning to S2, and recalculating the reference value;
and S4, enlarging the offset by m times, then rounding, converting the obtained integer into a short integer format, and transmitting the short integer format to data processing equipment.
The utility model provides a compression transmission device of outward appearance inspection data which characterized in that:
the initial parameter acquisition module is used for acquiring the size and position parameters of the product;
the reference value calculation module is used for calculating the variance of the size and the position parameters of the latest continuous n pieces of products, if the variance is smaller than a set value, calculating the arithmetic mean value of all the parameters of the n pieces of products as the reference value of the corresponding parameter, and transmitting the reference value to the data processing equipment; if the variance is larger than the set value, acquiring the parameters of the latest continuous n products again;
the offset calculation module is used for acquiring the size and position parameters of subsequent products, calculating the variance of the size and position parameters of the latest continuous n pieces of products, and if the variance is smaller than a set value, respectively subtracting the corresponding reference values from the size and position parameters of the subsequent products to obtain respective offsets; if the variance is larger than the set value, recalculating the reference value;
and the offset transmission module is used for enlarging the offset by m times, rounding the enlarged offset, converting the obtained integer into a short integer format and transmitting the short integer format to the data processing equipment.
A storage medium having stored thereon a computer program executable by a processor, the computer program comprising: the computer program when executed implements the steps of the method for compressed transmission of look detection data.
An appearance inspection system having an inspection apparatus and a data processing apparatus, characterized in that:
the detection equipment acquires a product image and calculates to obtain the size and position parameters of the product;
the detection equipment calculates the variance of the size and position parameters of the latest continuous n pieces of products, and if the variance is smaller than a set value, the arithmetic mean value of all the parameters of the n pieces of products is calculated to be used as a reference value of the corresponding parameter, and the reference value is transmitted to the data processing equipment; if the variance is larger than the set value, acquiring the parameters of the latest continuous n products again;
the detection equipment acquires the size and position parameters of subsequent products, calculates the variance of the size and position parameters of the latest continuous n pieces of products, and respectively subtracts the corresponding reference values from the size and position parameters of the subsequent products to obtain respective offset if the variance is smaller than a set value; if the variance is larger than the set value, recalculating the reference value;
the detection equipment enlarges the offset by m (which is a positive integer) times and then rounds the offset, converts the obtained integer into a short integer format and transmits the short integer format to the data processing equipment;
and the data processing equipment receives the reference value sent by the detection equipment and the short integer format offset sent subsequently, and the value of the short integer format offset is divided by m and then used for subsequent processing after the reference value is added.
The invention has the beneficial effects that: the invention determines the reference value according to the parameter of which the variance meets the requirement, and only transmits the offset between the subsequent product and the reference value in the subsequent process, thereby converting the value with larger value into a smaller value, and simultaneously adopts a smaller data type for transmission, thereby reducing the size of a data packet by more than 50 percent, stabilizing the data transmission, reducing the occupation of bandwidth, simultaneously reducing the data amount required to be analyzed by a data processing program, and reducing the calculation overhead.
Drawings
FIG. 1 is a functional block diagram of an embodiment.
1. An initial parameter acquisition module; 2. a reference value calculation module; 3. an offset calculation module; 4. and an offset transmission module.
Detailed Description
The embodiment is a compression transmission method of appearance detection data, comprising the following steps:
s1, photographing and size calculation are carried out on a detected product through an industrial camera, and all size and position parameters including length, width, diagonal length and horizontal and vertical coordinates of four corners are obtained.
S2, converting the latest continuous 3-piece product size and position parameter actual values into a byte array in a floating point number format (4 bytes), transmitting the byte array to data processing equipment, and calculating the variance of the latest continuous 3-piece product size and position parameter;
when the variance of each size and position parameter of the latest continuous 3 pieces of products is smaller than a set value, the size and position of the detected product in a certain range are considered to be basically stable, the arithmetic mean value of each parameter of the 3 pieces of products is taken as the reference value of the corresponding parameter, the value is transmitted to the data processing equipment, and the transmission mode identification position of the head part of the transmitted data packet is 0x00;
and when the variance of each size and position parameter of the latest continuous 3 products is larger than the set value, returning to S1, acquiring the parameter of the latest continuous product, and re-acquiring the parameter of the latest continuous 3 products.
S3, acquiring the size and position parameters of subsequent products piece by piece, calculating the variance of the size and position parameters of the latest continuous 3 products, and if the variance of each size and position parameter of the latest continuous 3 products is smaller than a set value, subtracting the reference value calculated in the corresponding step S2 from the size and position parameter of the subsequent product respectively to obtain respective offset; and if the variance is larger than the set value, directly sending the actual values of the size and position parameters of the subsequent product to the data processing equipment, returning to S2, and recalculating the reference value.
And S4, expanding the offset by a plurality of times so as to change the offset into an integer and facilitate the subsequent change of the data format for transmission. In this example, according to the measurement range and the precision requirement of the detection system, each numerical value is multiplied by 10, then the decimal part is removed to obtain the integer value of each offset, the obtained series of integer values are converted into a short integer format (2 bytes), and the short integer format are transmitted to the data processing equipment, and at this time, the transmission mode identification position of the head of the transmitted data packet is 0x01.
The embodiment also provides a device for compressing and transmitting appearance detection data, which comprises an initial parameter acquisition module 1, a reference value calculation module 2, an offset calculation module 3 and an offset transmission module 4.
In the embodiment, the initial parameter acquisition module is used for acquiring the size and position parameters of the product; the reference value calculation module is used for calculating the variance of the size and the position parameters of the latest continuous n pieces of products, if the variance is smaller than a set value, the arithmetic mean value of all the parameters of the n pieces of products is calculated to be used as the reference value of the corresponding parameter, and the reference value is transmitted to the data processing equipment; if the variance is larger than the set value, acquiring the parameters of the latest continuous n products again; the offset calculation module is used for acquiring the size and position parameters of subsequent products, calculating the variance of the size and position parameters of the latest continuous n pieces of products, and if the variance is smaller than a set value, respectively subtracting the corresponding reference values from the size and position parameters of the subsequent products to obtain respective offsets; if the variance is larger than the set value, recalculating the reference value; and the offset transmission module is used for enlarging the offset by m times and then rounding, converting the obtained integer into a short integer format and transmitting the short integer format to the data processing equipment.
The present embodiment also provides a storage medium having stored thereon a computer program executable by a processor, the computer program, when executed, implementing the steps of the method of compressed transmission of appearance detection data in the present example.
The present embodiment further provides an appearance detection system, which has a detection device and a data processing device, and the appearance detection data transmission method between the detection device and the data processing device is as follows:
the detection equipment photographs and calculates the size of a detected product through an industrial camera to obtain all size and position parameters including length, width, diagonal length and horizontal and vertical coordinates of four corners.
The detection device converts the latest continuous 3-piece product size and position parameter actual values into a byte array in a floating point number format (4 bytes) and transmits the byte array to the data processing device, and calculates the variance of the latest continuous 3-piece product size and position parameters; when the variance of each size and position parameter of the latest continuous 3 pieces of products is smaller than a set value, the size and position of the detected product in a certain range are considered to be basically stable, the arithmetic mean value of each parameter of the 3 pieces of products is taken as the reference value of the corresponding parameter, the value is transmitted to the data processing equipment, and the transmission mode identification position of the head part of the transmitted data packet is 0x00; and when the variance of each size and position parameter of the latest continuous 3 products is larger than a set value, acquiring the parameter of the latest continuous product, and re-acquiring the parameter of the latest continuous 3 products.
The detection equipment acquires the size and position parameters of subsequent products, calculates the variance of the size and position parameters of the latest continuous 3 products, and subtracts the corresponding reference values from the size and position parameters of the subsequent products respectively to obtain respective offset if the variance of each size and position parameter of the latest continuous 3 products is smaller than a set value; and if the variance is larger than the set value, directly sending the actual values of the size and position parameters of the subsequent products to the data processing equipment, and recalculating the reference value.
The detection device multiplies the offset by several times in order to make it an integer, which facilitates the subsequent change of its data format for transmission. In this example, according to the measurement range and the precision requirement of the detection system, each numerical value is multiplied by 10, then the decimal part is removed to obtain the integer value of each offset, the obtained series of integer values are converted into a short integer format (2 bytes), and the short integer format are transmitted to the data processing equipment, and at this time, the transmission mode identification position of the head of the transmitted data packet is 0x01.
After receiving the data sent by the detection equipment, the data processing equipment firstly analyzes the head transmission mode identifier of the data packet, and if the identifier is 0x00, the corresponding reference value in the data packet is directly taken out for subsequent processing; if the flag is 0x01, the value of the corresponding offset in the data packet is divided by 10, and then the reference value is added for subsequent processing.
Claims (4)
1. A compression transmission method of appearance detection data is characterized in that:
s1, obtaining size and position parameters of a product;
s2, calculating the variance of the size and position parameters of the latest continuous n pieces of products, if the variance is smaller than a set value, calculating the arithmetic mean value of each parameter of the n pieces of products as the reference value of the corresponding parameter, and transmitting the reference value to data processing equipment; if the variance is larger than the set value, returning to S1, and re-acquiring the parameters of the latest continuous n products;
s3, obtaining the size and position parameters of subsequent products, calculating the variance of the size and position parameters of the latest continuous n products, and if the variance is smaller than a set value, respectively subtracting the corresponding reference values from the size and position parameters of the subsequent products to obtain respective offset; if the variance is larger than the set value, returning to S2, and recalculating the reference value;
and S4, expanding the offset by m times, rounding, converting the obtained integer into a short integer format, and transmitting the short integer format to data processing equipment.
2. The utility model provides a compression transmission device of outward appearance inspection data which characterized in that:
the initial parameter acquisition module (1) is used for acquiring the size and position parameters of a product;
the reference value calculation module (2) is used for calculating the variance of the size and position parameters of the latest continuous n pieces of products, if the variance is smaller than a set value, the arithmetic mean value of all the parameters of the n pieces of products is calculated to be used as the reference value of the corresponding parameter, and the reference value is transmitted to the data processing equipment; if the variance is larger than the set value, acquiring the parameters of the latest continuous n products again;
the offset calculation module (3) is used for acquiring the size and position parameters of subsequent products, calculating the variance of the size and position parameters of the latest continuous n pieces of products, and if the variance is smaller than a set value, respectively subtracting the corresponding reference values from the size and position parameters of the subsequent products to obtain respective offsets; if the variance is larger than the set value, recalculating the reference value;
and the offset transmission module (4) is used for enlarging the offset by m times and then rounding, converting the obtained integer into a short integer format and transmitting the short integer format to the data processing equipment.
3. A storage medium having stored thereon a computer program executable by a processor, the computer program comprising: the computer program when executed performs the steps of the method for compressed transmission of appearance check data according to claim 1.
4. An appearance inspection system having an inspection apparatus and a data processing apparatus, characterized in that:
the detection equipment acquires a product image and calculates to obtain the size and position parameters of the product;
the detection equipment calculates the variance of the size and position parameters of the latest continuous n pieces of products, if the variance is smaller than a set value, the arithmetic mean value of each parameter of the n pieces of products is calculated to be used as a reference value of the corresponding parameter, and the reference value is transmitted to the data processing equipment; if the variance is larger than the set value, acquiring the parameters of the latest continuous n products again;
the detection equipment acquires the size and position parameters of subsequent products, calculates the variance of the size and position parameters of the latest continuous n products, and respectively subtracts corresponding reference values from the size and position parameters of the subsequent products to obtain respective offset if the variance is smaller than a set value; if the variance is larger than the set value, recalculating the reference value;
the detection equipment enlarges the offset by m times and then rounds the offset, converts the obtained integer into a short integer format and transmits the short integer format to the data processing equipment;
and the data processing equipment receives the reference value sent by the detection equipment and the short integer format offset sent subsequently, and the value of the short integer format offset is divided by m and then added with the reference value for subsequent processing.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111018009.1A CN113709167B (en) | 2021-08-30 | 2021-08-30 | Compression transmission method of appearance detection data |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111018009.1A CN113709167B (en) | 2021-08-30 | 2021-08-30 | Compression transmission method of appearance detection data |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113709167A CN113709167A (en) | 2021-11-26 |
CN113709167B true CN113709167B (en) | 2023-04-07 |
Family
ID=78658503
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111018009.1A Active CN113709167B (en) | 2021-08-30 | 2021-08-30 | Compression transmission method of appearance detection data |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113709167B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113977669B (en) * | 2021-12-24 | 2022-05-03 | 杭州百子尖科技股份有限公司 | Automatic machine vision sheet defect eliminating method |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS57127820A (en) * | 1981-01-30 | 1982-08-09 | Sumitomo Metal Ind Ltd | Method of monitoring cyclically moving body |
CN103292654A (en) * | 2013-06-11 | 2013-09-11 | 陈磊磊 | Method for calculating function size of cylindrical part |
CN110929751A (en) * | 2019-10-16 | 2020-03-27 | 福建和盛高科技产业有限公司 | Current transformer unbalance warning method based on multi-source data fusion |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS62219077A (en) * | 1986-03-20 | 1987-09-26 | Hitachi Medical Corp | Data compression method |
JP3848846B2 (en) * | 2001-04-23 | 2006-11-22 | 三菱電機株式会社 | Tracking device |
JP4844094B2 (en) * | 2005-11-16 | 2011-12-21 | 株式会社ニコン | Digital still camera |
JP5591080B2 (en) * | 2010-11-26 | 2014-09-17 | 三菱電機株式会社 | Data compression apparatus, data processing system, computer program, and data compression method |
CN110434673A (en) * | 2019-08-21 | 2019-11-12 | 福建科烨数控科技有限公司 | A kind of method of lathe in machining component parameter real time correction |
CN113077506B (en) * | 2021-06-04 | 2021-08-10 | 深圳联合安防科技有限公司 | Object safety monitoring method based on image processing and control terminal |
-
2021
- 2021-08-30 CN CN202111018009.1A patent/CN113709167B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS57127820A (en) * | 1981-01-30 | 1982-08-09 | Sumitomo Metal Ind Ltd | Method of monitoring cyclically moving body |
CN103292654A (en) * | 2013-06-11 | 2013-09-11 | 陈磊磊 | Method for calculating function size of cylindrical part |
CN110929751A (en) * | 2019-10-16 | 2020-03-27 | 福建和盛高科技产业有限公司 | Current transformer unbalance warning method based on multi-source data fusion |
Also Published As
Publication number | Publication date |
---|---|
CN113709167A (en) | 2021-11-26 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113709167B (en) | Compression transmission method of appearance detection data | |
CN109743356B (en) | Industrial internet data acquisition method and device, readable storage medium and terminal | |
CN116781864B (en) | Factory operation state remote monitoring system and method based on Internet of things data acquisition | |
CN107948634B (en) | Image dead pixel detection method and device and image processing chip | |
CN210274328U (en) | 3D image acquisition system, depth camera and image processing equipment | |
JP2019114842A5 (en) | ||
CN114422412B (en) | Equipment detection method and device and communication equipment | |
CN106788885B (en) | Electrocardiosignal compression rate self-adaptive adjustment wireless transmission system and transmission method | |
CN114500615B (en) | Intelligent terminal based on thing allies oneself with sensing technology | |
CN105758772A (en) | Granularity detection and control system for feed granulation | |
CN115623339B (en) | Image data exchange method, device and system for multiple cameras and automobile | |
CN105491288A (en) | Image adjusting method, device and system | |
CN113386386B (en) | Punch data acquisition method, system, medium and device of rotary high-speed tablet press | |
CN112712021B (en) | Grain surface abnormal state identification method based on perceptual hash and connected domain analysis algorithm | |
CN102055888A (en) | Network camera, network shooting system and network shooting method | |
CN205484089U (en) | Distributing type image acquisition system | |
JP2017200098A (en) | Movement monitoring device | |
CN112615972A (en) | Method and device for automatically correcting DPI (deep Power Point) of high-speed scanner | |
CN203181064U (en) | CFM industrial camera | |
RU2012101457A (en) | METHOD AND DEVICE FOR IMAGE PROCESSING | |
CN110944159A (en) | Information processing method, electronic equipment and information processing system | |
CN2938171Y (en) | Network canera | |
CN116543002B (en) | Automatic detection method, device and system for products | |
JP2022028431A (en) | Image processing apparatus and image processing method | |
CN115809187B (en) | Method for processing waste products of frameless flat panel display based on big data screening |
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 |