Method, system, equipment and storage medium for setting frame numbers of multiple product photos

文档序号:1042896 发布日期:2020-10-09 浏览:6次 中文

阅读说明:本技术 设置多张产品照片帧号的方法、系统、设备和存储介质 (Method, system, equipment and storage medium for setting frame numbers of multiple product photos ) 是由 刘鹤辉 李国志 滕华 于 2020-06-16 设计创作,主要内容包括:本发明公开设置多张产品照片帧号的方法、系统、设备和存储介质,其中所述方法的步骤包括:获取产品照片,判断所述产品照片是否为第一张产品照片:如是则给所获取的所述产品照片设置第一帧号,初始化定时器,并获取下一张产品照片;如否则判断所述定时器是否到达定时时长,如没有到达所述定时时长,则给所获取的所述产品照片设置第二帧号,并获取下一张产品照片;如到达所述定时时长,则给所获取的所述产品照片设置第三帧号,并获取下一张产品照片直至所有产品照片都已被设置帧号。对于所有照片流都可以通过第一、二、三帧号,尤其是第一和第三帧号标识照片流的起始和终止,有效管理同一产品照片流中的所有照片,防止相机出现丢帧、照片数量不相同或难以将照片与产品进行对应等的问题。(The invention discloses a method, a system, equipment and a storage medium for setting the frame numbers of a plurality of product photos, wherein the method comprises the following steps: acquiring a product photo, and judging whether the product photo is a first product photo: if so, setting a first frame number for the obtained product photo, initializing a timer, and obtaining the next product photo; if not, judging whether the timer reaches the timing time length or not, if not, setting a second frame number for the obtained product photo, and obtaining the next product photo; and if the timing duration is reached, setting a third frame number for the obtained product photo, and obtaining the next product photo until all the product photos are set with the frame numbers. For all photo streams, the start and the end of the photo stream can be identified by the first frame number, the second frame number and the third frame number, especially the first frame number and the third frame number, so that all photos in the same product photo stream can be effectively managed, and the problems that the cameras lose frames, the quantity of the photos is different, or the photos and the products are difficult to correspond are solved.)

1. A method for setting frame numbers of a plurality of product photos is characterized by comprising the following steps:

acquiring a product photo, and judging whether the product photo is a first product photo:

if the picture is the first product picture, setting a first frame number for the obtained product picture, initializing a timer, and obtaining the next product picture;

if the product photo is not the first product photo, judging whether the timer reaches a timing time length or not, if the timer does not reach the timing time length, setting a second frame number for the obtained product photo, and obtaining the next product photo; and if the timing duration is reached, setting a third frame number for the obtained product photo, and obtaining the next product photo until all the product photos are set with the frame numbers.

2. The method of setting a multi-product photo frame number according to claim 1,

obtaining a product photo, and judging whether the product photo is a first product photo, specifically:

the method comprises the steps of obtaining a product photo, setting a fourth frame number for the obtained product photo when the photographing mode of the product photo is a single-sheet photographing mode, and obtaining the next product photo until all the product photos are set with the frame numbers;

and when the photographing mode of the product photo is a non-single photographing mode, judging whether the obtained product photo is the first product photo.

3. The method of setting a multi-product photo frame number according to claim 2,

when the photographing mode of the product photo is a non-single photographing mode, acquiring the product photo and judging whether the acquired product photo is a first product photo, specifically:

when the photographing mode of the product photo is a non-single-sheet photographing mode, initializing a photo counter, acquiring the product photo after initializing the photo counter, and judging whether the acquired product photo is a first product photo according to the counting number of the counter;

judging whether the timer reaches a timing time length, if so, setting a third frame number for the obtained product photo, and obtaining the next product photo until all the product photos are set with frame numbers, specifically:

and judging whether the timer reaches the timing duration, if so, setting a third frame number for the obtained product photos, initializing the photo counter, and obtaining the next batch of product photos until all the product photos are set with frame numbers.

4. A method of setting multiple product photo frame numbers according to claim 3, wherein the timed duration is the difference between the time period the product is transported or pulled and the duration of a pulse.

5. A system for setting the frame numbers of multiple product photos is characterized by comprising a data processing module and a judgment processing module,

the data processing module is used for acquiring a product photo;

the judging and processing module is used for judging whether the product photo acquired by the data processing module is a first product photo;

the data processing module is further configured to set a first frame number initialization timer for the acquired product photo when the judgment processing module judges that the acquired product photo is the first product photo;

the judging and processing module is further used for judging whether the timer reaches the timing duration or not when the obtained product photo is judged not to be the first product photo;

the data processing module is further configured to set a second frame number for the obtained product photo when the judging and processing module judges that the timer does not reach the timing duration, and set a third frame number for the obtained product photo when the judging and processing module judges that the timer reaches the timing duration;

the data processing module is also used for acquiring the next product photo after setting the frame number for the product photo each time until all the product photos are set with the frame numbers.

6. The system for setting the frame number of a plurality of product photographs according to claim 5,

the data processing module is used for acquiring product photos, and specifically comprises the following steps:

the data processing module is used for acquiring the product photo and setting a fourth frame number for the acquired product photo when the photographing mode of the product photo is a single-sheet photographing mode, and acquiring the product photo when the photographing mode of the product photo is a non-single-sheet photographing mode;

the judgment processing module is used for judging whether the product photo acquired by the data processing module is a first product photo, and specifically comprises the following steps:

the judging and processing module is used for judging whether the product photo acquired by the data processing module is the first product photo when the photographing mode of the product photo acquired by the data processing module is a non-single photographing mode.

7. The system for setting the frame number of a plurality of product photographs according to claim 6,

the data processing module is used for acquiring the product photo when the photographing mode of the product photo is a non-single photographing mode, and specifically comprises the following steps:

the data processing module is used for initializing a photo counter when the photographing mode of the product photo is a non-single-sheet photographing mode, and acquiring the product photo after the photo counter is initialized;

the judging and processing module is configured to judge whether the product photo acquired by the data processing module is a first product photo when the photographing mode of the product photo acquired by the data processing module is a non-single photographing mode, and specifically includes:

the judging and processing module is used for judging whether the product photo acquired by the data processing module is a first product photo according to the counting number of the counter when the photographing mode of the product photo acquired by the data processing module is a non-single photographing mode;

the data processing module is configured to set a third frame number for the obtained product photos when the judging and processing module judges that the timer reaches the timing duration, and obtain the next batch of product photos until all the product photos have been set with frame numbers, specifically:

and the data processing module is used for setting a third frame number for the obtained product photos, initializing the photo counter and obtaining the next batch of product photos until all the product photos are set with frame numbers when the judging and processing module judges that the timer reaches the timing time length.

8. A system for setting the photo frame number of a plurality of products according to any of claims 5 to 7, wherein said timing duration is the difference between the time period said products are transported or pulled and the duration of a pulse.

9. A computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor when executing the computer program implements the method of setting a number of multiple product photo frames according to any one of claims 1 to 4.

10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the data processing method of any one of claims 1 to 4.

Technical Field

The present invention relates to the field of industrial intelligence, and more particularly, to a method, system, device, and storage medium for setting a number of a multi-product photo frame.

Background

At present, in the process of promoting the digital upgrading of industrial manufacturing and implementing intelligent manufacturing, one of the key problems is how to detect the quality of industrial products manufactured on a production line by using an automatic technology, so as to realize an end-to-end automatic production line from raw material processing and production to back-end quality detection. With the development of computer vision technology, many enterprises have started to automatically find defects of products and sort the products by using an image detection method.

In practical application, generally, when a product is conveyed on a production line, an industrial camera is selected to be installed at a certain specified position, the product is photographed, the photographed picture is sent to a visual insight model to be analyzed, an analysis result is obtained, and then the analysis result is sent to a sorting mechanism to be sorted. In this process, due to the limited field of view of the camera, for a product that is relatively long or large in area, one picture cannot cover the entire product, but multiple pictures need to be taken to cover the entire product. For example, for longer zippers, 2 or even more than 10 photographs are often required to cover a complete zipper, and a double-sided photograph may be required. Due to the limitation of the space of the production line machine and the consideration of the cost, only one industrial camera is installed at one angle for shooting, for example, only one industrial camera is installed on the front side and the back side of the zipper respectively. Therefore, for a product, the pictures taken form a stream of pictures, and from the perspective of the entire production line, the pictures of all the products form a larger stream of pictures during the operation of the product on the production line. Therefore, there is a problem in how to distinguish the photo stream inputted from the camera according to the products to which the photo stream belongs, so that the detection results of a group of photos can be integrated into a unified result and sent to the sorting equipment for sorting the actual products.

For products with electronic tags or signs in appearance, the electronic tags on the photos can be read to match with actual products, but for products without electronic tags or signs on the products, such as zippers, the photos cannot be analyzed to distinguish which photos in the input photo stream correspond to the same product. Meanwhile, in actual production, the camera may lose frames during long-time photographing, so that the number of photos received from the camera may be different even for products of the same batch size. Therefore, it is necessary to perform standardized management of a plurality of photographs of a product.

Disclosure of Invention

The invention aims to overcome at least one defect of the prior art, and provides a method, a system, equipment and a storage medium for setting the frame numbers of a plurality of product photos, which are used for solving the problems of frame loss and different photo numbers of the plurality of product photos in long-time photographing.

The technical scheme adopted by the invention is as follows:

a method for setting frame numbers of multiple product photos comprises the following steps: acquiring a product photo, and judging whether the product photo is a first product photo: if so, setting a first frame number for the obtained product photo, initializing a timer, and obtaining the next product photo; if not, judging whether the timer reaches the timing time length or not, if not, setting a second frame number for the obtained product photo, and obtaining the next product photo; and if the timing duration is reached, setting a third frame number for the obtained product photo, and obtaining the next product photo until all the product photos are set with the frame numbers.

Photos taken by a product form a photo stream, and some products have difficulty in distinguishing which photos in the input photo stream correspond to the same product by analyzing the photos. Meanwhile, in actual production, the camera may lose frames during long-time photographing, so that the number of photos received from the camera may be different even for products of the same batch specification. It is therefore necessary to perform a standardized management of the multiple photographs of the product.

The method provided by the invention is to add frame numbers to the shot photos, judge whether the product photo is the first one or not after the photos are obtained each time, if so, set the first frame number to indicate that the photo is the first photo of the batch of products, then uniformly add the second frame number to the photos to indicate that the photos all belong to the products, in order to determine the last photo of the product, a timer needs to be initialized after the first product photo is obtained, when the timer reaches the timing length, the photo flow of the product is indicated that only the last photo is left, and set the third frame number for the last obtained product photo to indicate that the photo is the last photo of the product and then the end.

For all photo streams, the start and the end of the photo stream can be identified by the first frame number, the second frame number and the third frame number, especially the first frame number and the third frame number, so that all photos in the same product photo stream can be effectively managed, and the problems that the cameras lose frames, the quantity of the photos is different, or the photos and the products are difficult to correspond are solved.

Further, acquiring a product photo, and judging whether the product photo is a first product photo, specifically: when the shooting mode of the product photo is a single-sheet shooting mode, acquiring the product photo, setting a fourth frame number for the acquired product photo, and acquiring the next product photo until all the product photos are set with frame numbers; and when the photographing mode of the product photo is a non-single photographing mode, acquiring the product photo and judging whether the acquired product photo is the first product photo.

The product can be shot only by one picture, namely, one picture can cover the whole product, and the whole product can be completely covered by more than one picture, so that whether the picture shooting mode of the product picture is a single picture shooting mode or not needs to be judged when the picture is obtained, and if the picture is obtained, a fourth frame number is set for the picture so as to distinguish the picture from other picture streams with more than one picture.

Further, when the photographing mode of the product photo is a non-single photographing mode, acquiring the product photo and judging whether the acquired product photo is a first product photo, specifically: when the photographing mode of the product photo is a non-single-sheet photographing mode, initializing a photo counter, acquiring the product photo after initializing the photo counter, and judging whether the acquired product photo is a first product photo according to the counting number of the counter;

judging whether the timer reaches the timing duration, if so, setting a third frame number for the obtained product photos, and obtaining the next batch of product photos until all the product photos are set with the frame numbers, specifically: and judging whether the timer reaches the timing duration, if so, setting a third frame number for the obtained product photos, initializing the photo counter, and obtaining the next batch of product photos until all the product photos are set with frame numbers.

In a non-single shooting mode of a product photo, a photo counter needs to be initialized before the product photo is obtained, the counter counts the photo to judge whether the obtained product photo is the first photo, in the whole process of setting the frame number, the counter is used for determining the first product photo, the timer is used for determining the last product photo, and the high efficiency of the whole process is guaranteed. Since the number of photos of a product is counted by using the counter, after the third frame number is added to the last photo of the product, the photo counter needs to be initialized to count the photo stream of the next product again.

Further, the timed length is the difference between the time period the product is delivered or pulled and the length of a pulse. Since the timer needs to be timed to end before the last picture is taken, if the timer is timed to end before the last picture is taken, the situation that the timer signal is missed and the last picture is missed is caused, so that the total time length of the product pulled or conveyed is required to be subtracted by a pulse time length, so that the timer is timed to end before the last picture is taken in advance.

The technical scheme adopted by the invention is as follows:

a system for setting frame numbers of a plurality of product photos comprises a data processing module and a judging processing module, wherein the data processing module is used for acquiring the product photos; the judging and processing module is used for judging whether the product photo acquired by the data processing module is a first product photo; the data processing module is further configured to set a first frame number for the obtained product photo and initialize a timer when the judging and processing module judges that the obtained product photo is the first product photo; the judging and processing module is further used for judging whether the timer reaches the timing duration or not when the obtained product photo is judged not to be the first product photo; the data processing module is further configured to set a second frame number for the obtained product photos when the judging module judges that the timer does not reach the time duration, set a third frame number for the obtained product photos when the judging module judges that the timer reaches the time duration, and obtain a next batch of product photos until all the product photos have been set with frame numbers; the data processing module is also used for acquiring the next product photo after setting the frame number for the product photo each time until all the product photos are set with the frame numbers.

Further, the data processing module is used for acquiring product photos, and specifically comprises: the data processing module is used for acquiring the product photo and setting a fourth frame number for the acquired product photo when the photographing mode of the product photo is a single-sheet photographing mode, and acquiring the product photo when the photographing mode of the product photo is a non-single-sheet photographing mode;

the judgment processing module is used for judging whether the product photo acquired by the data processing module is a first product photo, and specifically comprises the following steps: the judging and processing module is used for judging whether the product photo acquired by the data processing module is the first product photo when the photographing mode of the product photo acquired by the data processing module is a non-single photographing mode.

Further, the data processing module is configured to obtain the product photo when the photographing mode of the product photo is a non-single photographing mode, and specifically includes: the data processing module is used for initializing a photo counter when the photographing mode of the product photo is a non-single-sheet photographing mode, and acquiring the product photo after the photo counter is initialized;

the judging and processing module is configured to judge whether the product photo acquired by the data processing module is a first product photo when the photographing mode of the product photo acquired by the data processing module is a non-single photographing mode, and specifically includes: the judging and processing module is used for judging whether the product photo acquired by the data processing module is a first product photo according to the counting number of the counter when the photographing mode of the product photo acquired by the data processing module is a non-single photographing mode;

the data processing module is configured to set a third frame number for the obtained product photos when the judging and processing module judges that the timer reaches the timing duration, and obtain the next batch of product photos until all the product photos have been set with frame numbers, specifically: and the data processing module is used for setting a third frame number for the obtained product photos, initializing the photo counter and obtaining the next batch of product photos until all the product photos are set with frame numbers when the judging and processing module judges that the timer reaches the timing time length.

The technical scheme adopted by the invention is as follows:

a computer device comprises a memory and a processor, wherein the memory stores a computer program, and the processor realizes the method for setting the frame numbers of a plurality of product photos when executing the computer program.

A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the above-mentioned data processing method.

Compared with the prior art, the invention has the beneficial effects that:

(1) for all photo streams, the start and the end of the photo stream can be identified by a first frame number, a second frame number and a third frame number, particularly the first frame number and the third frame number, so that all photos in the same product photo stream can be effectively managed, and the problems of frame loss, different photo quantity, difficulty in corresponding the photos with the product and the like of a camera are prevented;

(2) and setting a fourth frame number for the product photo in a single shooting mode to distinguish the product photo from other photo streams with more than one photo, so that different types of product photos can be managed more effectively.

Drawings

FIG. 1 is a flowchart illustrating steps S1-S3 according to embodiment 1 of the present invention.

FIG. 2 is a schematic flow chart of steps S1-S3 in the preferred embodiment of example 1 of the present invention.

Detailed Description

The drawings are only for purposes of illustration and are not to be construed as limiting the invention. For a better understanding of the following embodiments, certain features of the drawings may be omitted, enlarged or reduced, and do not represent the size of an actual product; it will be understood by those skilled in the art that certain well-known structures in the drawings and descriptions thereof may be omitted.

10页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:车辆检索方法、装置、电子设备及可读存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!