CN113674200A - Method and device for counting articles on production line and computer storage medium - Google Patents

Method and device for counting articles on production line and computer storage medium Download PDF

Info

Publication number
CN113674200A
CN113674200A CN202110773821.9A CN202110773821A CN113674200A CN 113674200 A CN113674200 A CN 113674200A CN 202110773821 A CN202110773821 A CN 202110773821A CN 113674200 A CN113674200 A CN 113674200A
Authority
CN
China
Prior art keywords
image
face
face image
article
frame image
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110773821.9A
Other languages
Chinese (zh)
Inventor
刘士臣
王枫
李保坤
熊剑平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Dahua Technology Co Ltd
Original Assignee
Zhejiang Dahua 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 Zhejiang Dahua Technology Co Ltd filed Critical Zhejiang Dahua Technology Co Ltd
Priority to CN202110773821.9A priority Critical patent/CN113674200A/en
Publication of CN113674200A publication Critical patent/CN113674200A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • 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/10016Video; Image sequence
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30242Counting objects in image

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Image Analysis (AREA)

Abstract

The application discloses a method and a device for counting articles on a production line and a computer storage medium. The method for counting the articles on the production line comprises the following steps: acquiring a video stream, and acquiring a current frame image and a previous frame image of an article from the video stream in real time; analyzing the previous frame image and the current frame image respectively by using an end face segmentation model to obtain a first end face image and a second end face image of the article; updating the statistical quantity of the article based on the first end face image and the second end face image. By the method, the number of the articles on the assembly line can be counted in real time, so that the accuracy of counting the number of the articles is improved.

Description

Method and device for counting articles on production line and computer storage medium
Technical Field
The present application relates to the field of computer vision and image processing technologies, and in particular, to a method and an apparatus for counting articles on a production line, and a computer storage medium.
Background
In order to count objects (such as steel bars) on a production line, many production lines are provided with automatic counting devices, but the mechanical counting devices have great limitation, and electronic sensing equipment completely depends on the electronic sensing devices to directly scan, so that counting errors exist, and the probability of triggering the automatic counting devices is not high.
In recent years, with the development of image processing technology and image recognition technology, the number of articles can be determined by counting and analyzing the number of prediction frames of the articles in an image, but in this way, the number of the articles moving on an assembly line cannot be counted in real time, detection omission occurs, and the error of the counted number is large.
Disclosure of Invention
The technical problem that this application mainly solved is how to count the quantity of article on the assembly line in real time to improve the accuracy of article quantity count.
In order to solve the technical problem, the application adopts a technical scheme that: a method for counting articles in an assembly line is provided. The method for counting the articles on the production line comprises the following steps: acquiring a video stream, and acquiring a current frame image and a previous frame image of an article from the video stream; analyzing the previous frame image and the current frame image respectively by using an end face segmentation model to obtain a first end face image and a second end face image of the article; updating the statistical quantity of the article based on the first end face image and the second end face image.
In order to solve the technical problem, the application adopts a technical scheme that: a counting device for articles on a production line is provided. The counting device for the articles on the pipeline comprises a memory and a processor, wherein the memory is coupled with the processor; wherein, the memorizer is used for storing the program data, the treater is used for carrying out the program data in order to realize: acquiring a video stream, and acquiring a current frame image and a previous frame image of an article from the video stream; analyzing the previous frame image and the current frame image respectively by using an end face segmentation model to obtain a first end face image and a second end face image of the article; updating the statistical quantity of the article based on the first end face image and the second end face image.
In order to solve the technical problem, the application adopts a technical scheme that: a computer storage medium is provided. The computer storage medium having stored thereon program instructions that, when executed, implement: acquiring a video stream, and acquiring a current frame image and a previous frame image of an article from the video stream; analyzing the previous frame image and the current frame image respectively by using an end face segmentation model to obtain a first end face image and a second end face image of the article; updating the statistical quantity of the article based on the first end face image and the second end face image.
The beneficial effect of this application is: different from the prior art, the method comprises the steps of firstly obtaining a video stream of an article on a production line, and obtaining a current frame image and a previous frame image of the article from the video stream in real time; then, analyzing the image pair of the previous frame and the current frame by using an end face segmentation model respectively to obtain a first end face image and a second end face image of the article; and finally updating the statistical quantity of the articles based on the first end face image and the second end face image. Because of this application is the quantity that updates article according to the current frame image information of article and previous frame image information, can all carry out quantity update to article at every frame of video stream constantly, and then can count in real time to the quantity of article on the assembly line, avoid examining the hourglass of article on the assembly line in the motion, can improve the accuracy of article quantity count.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts. Wherein:
FIG. 1 is a schematic flow chart diagram illustrating one embodiment of a method for counting articles in an assembly line of the present application;
FIG. 2 is a schematic flow chart diagram illustrating one embodiment of a method for counting articles in an assembly line of the present application;
FIG. 3 is a flowchart illustrating a step S22 of the method for counting articles in the assembly line of FIG. 2;
FIG. 4 is a schematic structural view of an embodiment of an end image and ruled lines of an article of the present application;
FIG. 5 is a flowchart illustrating a step S28 of the method for counting articles in the assembly line of FIG. 2;
FIG. 6 is a schematic flow chart diagram illustrating one embodiment of a method for counting articles in an assembly line of the present application;
FIG. 7 is a schematic flow chart diagram illustrating one embodiment of an apparatus for counting articles in an assembly line of the present application;
FIG. 8 is a schematic structural diagram of an embodiment of a computer storage medium according to the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terms "first" and "second" in this application are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. In the description of the present application, "plurality" means at least two, e.g., two, three, etc., unless explicitly specifically limited otherwise. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus.
Reinforcing steel bars are one of the most commonly used building materials in building engineering, and have various types, different sizes and specifications and large using scale. At present, in the process of producing the steel bars, when the steel bars need to be bundled according to a certain number, manual operation is generally adopted, and the counted steel bars and the steel bars which are not counted need to be marked for multiple times, so that a large amount of labor cost is consumed, and the efficiency is low. In addition, the manual counting steel bars often have counting errors, and the accuracy and the reliability of the acceptance number result cannot be guaranteed. Especially, when the device faces severe weather conditions such as high temperature, low temperature, typhoon, rainstorm, snowstorm and the like, the working environment is poor, the work of manually counting the reinforcing steel bars is difficult to be normally carried out, and a plurality of potential safety hazards exist.
In the prior art, many production lines are provided with automatic counting devices. However, the mechanical steel bar counting device can only work at a constant speed, and steel bars are required to be kept in a regular state, so that the limitation is large, the electronic sensing equipment completely depends on the electronic sensing device to directly scan, counting errors exist, and the probability of triggering the automatic counting device is not high.
In recent years, with the increasing development of computer technology and multimedia technology, the development of image processing technology and image recognition technology has been greatly promoted. The image recognition is that a computer is utilized to send image information transmitted by a camera into the computer according to a certain sequence, and the result is output after image processing, analysis and recognition, thereby facilitating operators and eliminating various dangerous cases in the production process in time. The industrial image recognition problem is also becoming a hot spot of people's research.
In the prior art, the number of prediction frames at the end of a steel bar in an image is statistically analyzed, so that the technical scheme for determining the number of the steel bars has some defects: only the number of the steel bars in the current image can be counted; depending on the accuracy of the detection frame, there are missed detections and false detections; when the end face of the steel bar is very small, the detection frame is inaccurate or invalid; the number of the steel bars moving on the assembly line cannot be counted in real time.
In order to solve the above problems, the present application provides a method and an apparatus for counting articles on a production line, and a computer storage medium, which can be used for counting not only steel bars, but also other articles on the production line, and are not limited specifically. Embodiments of the present application will be described based on rebar.
The present application first provides a method for counting articles on a production line, as shown in fig. 1, fig. 1 is a schematic flow chart of an embodiment of the method for counting articles on the production line. The counting method of the articles on the production line comprises the following steps:
step S11: and acquiring a video stream, and acquiring a current frame image and a previous frame image of the article from the video stream.
The method comprises the steps that video acquisition devices such as a camera and the like are used for acquiring articles on the production line in real time, such as video streams of reinforcing steel bars, and current frame images and previous frame images of the reinforcing steel bars are acquired from the video streams; by analogy, the next frame of image is obtained as the current frame when the quantity is updated next time, and the current frame when the quantity is updated this time is used as the previous frame when the quantity is updated next time. In order to improve the timeliness of counting, the current frame image and the previous frame image of the reinforcing steel bar can be acquired from the video stream in real time, and real-time counting processing is carried out.
Wherein, the current frame image and the previous frame image can be adjacent image frames or non-adjacent image frames.
Step S12: and analyzing the previous frame image and the current frame image respectively by using an end face segmentation model to obtain a first end face image and a second end face image of the article.
The angle of the camera can be adjusted to enable the video stream obtained in step S11 to contain the image information of the end faces of the reinforcing steel bars, and the end face information in the image information can accurately represent the number of the reinforcing steel bars, so that the accuracy of the number statistics of the reinforcing steel bars can be improved.
Step S13: updating the statistical quantity of the article based on the first end face image and the second end face image.
And updating the current statistical quantity of the steel bars at the current frame moment by utilizing the first end face image of the previous frame image and the second end face image of the current frame image of the steel bars.
In this embodiment, the steps S11 (the video stream may not be repeatedly acquired) to S13 are performed at each frame time of the video stream, so as to update the statistical number of the reinforcement bars according to the embodiment end face information of the reinforcement bars at each frame time of the reinforcement bars in real time.
Different from the prior art, the quantity of the articles can be updated at each frame moment of the video stream according to the current frame image information and the previous frame image information of the articles, so that the quantity of the articles on the assembly line can be counted in real time, missing detection of the articles on the assembly line in motion is avoided, and the accuracy of counting the quantity of the articles can be improved.
The present application further proposes a method of another embodiment, as shown in fig. 2, the present embodiment specifically includes the following steps:
step S21: an original end face image of the article is acquired.
Step S22: and marking the original end face image to obtain a label image of the article.
Alternatively, the present embodiment may implement step S22 by using the method shown in fig. 3. The method of the present embodiment includes steps S31 and S32.
Step S31: and fitting and labeling the edge area of the article of the original end face image to form a labeled area and an unlabeled area.
The marked area is a background area of the article, and the unmarked area is an end face area of the article.
Step S32: and setting the pixel value of the pixel point in the labeling area as a second preset value, and setting the pixel value of the pixel point in the unmarked area as a first preset value to obtain a label graph of the article.
In this embodiment, the second preset value is 1, and the first preset value is 0; in the label map of the article, the pixel value of the pixel point in the background region of the article is set to 1, and the pixel value of the pixel point in the end face region of the article is set to 0.
In other embodiments, the second preset value is 0, the first preset value is 1, the pixel value of the pixel point in the labeled region is set to 0, and the pixel value of the pixel point in the unlabeled region is set to 1, or the pixel value of the pixel point in the labeled region and the pixel value of the pixel point in the unlabeled region are respectively set to two different pixel values with a large difference, so that the identification is facilitated, and no limitation is specifically made.
Step S23: and training the initial end face segmentation model by using the original end face image and the label image to obtain an end face segmentation model.
The steps S21 to S23 are used to train the end face segmentation model to improve the accuracy of the end face segmentation. The steps S21 to S23 are also described:
when an initial end face segmentation model is trained, firstly, fitting and labeling are carried out on the edge area of the end face of the steel bar to form a labeled area corresponding to the end face of the steel bar and an unmarked area corresponding to the background of the steel bar, the pixel point of the labeled area is set to be 1, the pixel point of the unmarked area is set to be 0, and a label graph with the size consistent with the original end face image size of the steel bar is obtained; forming a training graph by the label graph and the original end face graph, and training the initial end face segmentation model to obtain an end face segmentation model of the steel bar; in practical applications, as long as the image frame in the video stream is input into the end face segmentation model, the segmentation result of the end face of the steel bar of the image frame, that is, the first end face image, the second end face image, the third end face image, and the like, can be obtained.
Because the difference between the number of pixels on the end face of the steel bar in the video stream image frame and the number of pixels on the background is large, in order to enable the constructed end face segmentation model to better learn the characteristics of the end face of the steel bar, the end face segmentation model of the embodiment can be used for more accurately segmenting the end face area of the steel bar, and the end face segmentation model can be trained by adopting a loss function loss in the following form:
Figure BDA0003154932010000061
wherein p is the probability that the pixel prediction of the pixel point is the first preset value, y is the true pixel value (the above labeled pixel value) of the pixel point, and α and γ are both adjustment parameters, where α may be 0.75, and γ may be 2. In other embodiments, α and/or γ may be adjusted depending on the application.
Step S24: and acquiring a video stream, and acquiring a current frame image and a previous frame image of the article from the video stream.
Step S24 is similar to step S11 described above and is not repeated here.
In other embodiments, the execution order of steps S21 to S23 and S24 may not be limited.
Step S25: and analyzing the previous frame image and the current frame image respectively by using an end face segmentation model to obtain a first end face image and a second end face image of the article.
The end face segmentation models trained in steps S21 to S23 are used to analyze the previous frame image and the current frame image respectively.
Step S25 is similar to step S12 described above and is not repeated here.
Step S26: and acquiring a ruled line, wherein the ruled line is parallel to a reference line of a video frame of the steel bar.
The reference line may be an ordinate axis of the video frame (image frame), as shown in fig. 4, a virtual regular line is set at the end of the rebar conveyor in the video image of the camera, as shown by a dotted line in fig. 4, the regular line is parallel to the ordinate axis of the video frame (image frame) of the rebar, and it may be assumed that the regular line is x with respect to the abscissa axis of the video frame.
Step S27: and respectively counting a first number of pixel points with preset pixel values on the ruled line in the first end face image and a second number of pixel points with preset pixel values on the ruled line in the second end face image.
In this embodiment, the preset pixel value is a first preset value, and the pixel values of other pixel points in the first end face image and the second end face image are second preset values.
As shown in fig. 4, the cumulative value of the pixel points of all the end faces of the steel bars (i.e. having the first preset value 0) on the horizontal axis x of the previous frame image (no previous frame image is marked as 0) of the steel bars is counted as a first quantity, and the cumulative value of the pixel points of all the end faces of the steel bars (i.e. having the first preset value 0) on the horizontal axis x of the current frame image of the steel bars is counted as a second quantity.
Step S28: the number of rebars is updated based on a relationship between the first number and the second number.
It can be known from the above analysis that the pixel value of the pixel point corresponding to the reinforcement end face region in the end face image of the reinforcement output by the end face segmentation model is different from the pixel value of the pixel point corresponding to the reinforcement background region, because the position of the reinforcement end face relative to the rule line is constantly changing along with the transmission of the assembly line, the number of the pixel points corresponding to the reinforcement end face and having the first preset value on the rule line is also constantly changing, and therefore the present embodiment can update the number of the reinforcements based on the number change of the pixel points on the rule line and having the preset pixel value.
The method of the embodiment of fig. 4 of the present application is applicable to articles having end face dimensions that are not uniformly distributed along the conveying direction (abscissa) of the assembly line.
In other embodiments, a regular line parallel to the abscissa axis of the video frame of the article may also be used to accommodate articles having end face dimensions that are not uniformly distributed along the direction perpendicular to the pipeline (the ordinate axis).
Specifically, the present embodiment may implement step S28 by the method as shown in fig. 5. The method of the present embodiment includes steps S51 and S52.
Step S51: if the first number is greater than the second number, the second number is compared to a number threshold.
If the first number of the pixel points of the end face of the steel bar on the regular line in the previous frame image is larger than the second number of the pixel points of the end face of the steel bar on the regular line in the current frame image, the steel bar is considered to be rapidly transmitted, and the second number of the pixel points of the end face of the steel bar on the regular line in the current frame image is further compared with a number threshold value to determine whether the steel bar is transmitted in the next frame image.
Step S52: if the second number is less than the number threshold, the number of rebars is incremented by one.
If the second number is less than the number threshold, the rebar is considered to have been transferred in the next frame of image, i.e., prior to the next frame of image, so the number of rebars can be incremented by one. The quantity threshold value can be set according to the shape and the size of the steel bar, the time interval of two image frames and other parameters, so that the steel bar cannot be repeatedly counted at the next frame time.
Further, step S28 further includes: and if the first number is smaller than the second number or the second number is larger than or equal to the number threshold, the number of the steel bars is unchanged.
If the first number of the pixel points of the end face of the steel bar on the regular line in the previous frame image is smaller than the second number of the pixel points of the end face of the steel bar on the regular line in the current frame image, the steel bar is considered to be just transmitted, and the number of the steel bar is kept unchanged; and if the second number is larger than or equal to the number threshold, the reinforcing steel bars are considered not to be transmitted in the next frame of image, and the number of the reinforcing steel bars is kept unchanged.
In the embodiment, the number of the reinforcing steel bars is updated by using the number of the pixel points of the end faces of the reinforcing steel bars on the regular lines in the two frames of images, so that the method can adapt to the reinforcing steel bars with different sizes.
Further, an initial value of the counting identifier of the steel bars can be set as a start identifier, and if the second number is smaller than the number threshold, the counting identifier is updated to be an end identifier to indicate that the number of the steel bars is increased by one; and if the first number is smaller than the second number or the second number is larger than or equal to the number threshold, updating the counting identifier of the reinforcing steel bars as a starting identifier to indicate that the number of the reinforcing steel bars is unchanged. In this way, it is possible to avoid that the same rebar is repeatedly counted.
In another embodiment, the size of the current frame image and the previous frame image is adjusted to a predetermined size, such as 256 × 256, before the end face segmentation model is used to analyze the previous frame image and the current frame image, respectively, so as to accelerate the end face image segmentation of the end face segmentation model.
Of course, the original end face image of the article may also be adjusted to a predetermined size, such as 256 × 256, which may speed up the training of the initial end face segmentation model.
The present application further provides a counting method for articles on a production line according to another embodiment, as shown in fig. 6, the counting method of the present embodiment specifically includes the following steps:
step S61: and acquiring a video stream, and acquiring a current frame image and a previous frame image of the article from the video stream.
Step S62: and analyzing the previous frame image and the current frame image respectively by using an end face segmentation model to obtain a first end face image and a second end face image of the article.
Step S63: updating the statistical quantity of the article based on the first end face image and the second end face image.
The steps S61 to S63 can refer to the above embodiments, which are not described herein.
Step S64: sending the statistical quantity of the items to the controller.
The statistical quantity of the reinforcing steel bars is sent to the controller, information recording and further analysis are facilitated, reference basis is controlled for the reinforcing steel bar conveyor and the packaging machine, and management efficiency can be improved.
Step S65: the controller controls the article conveyor and the wrapping machine according to the statistical quantity.
The controller controls the article conveyor and the packer according to the statistics amount of the reinforcing steel bars, so that resources are saved, and the transportation efficiency can be improved.
The embodiment of the application has strong applicability, and can be accurately adapted to any environment without being interfered by external factors; the number of the steel bars obtained through detection is informationized in real time, and compared with steel bar counting of a single-frame image, the method is more suitable for assembly line batch operation, the number of the packed steel bars is controlled in advance, and subsequent human input is avoided; the automatic real-time counting of the reinforcing steel bars is carried out, other equipment is not needed, and the labor consumption and potential safety hazards are reduced; the number of the steel bars can be counted, data can be sent to the controller, a control suggestion is given, and management of managers is facilitated; the expansibility is strong, the algorithm is convenient to iterate and upgrade, and the cost is saved; and performing image segmentation on the scene of the steel bar conveyor by using a real-time semantic segmentation network method.
The present application further provides an apparatus for counting articles on a pipeline, as shown in fig. 7, the apparatus 100 for counting articles on a pipeline of this embodiment includes a processor 101, a memory 102 coupled to the processor 101, an input/output device 103, and a bus 104.
The processor 101, the memory 102, and the input/output device 103 are respectively connected to the bus 104, the memory 102 stores program data, and the processor 101 is configured to execute the program data to implement: acquiring a video stream, and acquiring a current frame image and a previous frame image of an article from the video stream; analyzing the previous frame image and the current frame image respectively by using an end face segmentation model to obtain a first end face image and a second end face image of the article; updating the statistical quantity of the article based on the first end face image and the second end face image.
The processor 101, when executing the program data, also implements the method of counting items on the pipeline of the above-described embodiments. The controller in the above embodiments may be integrated within the processor 101.
In the present embodiment, the processor 101 may also be referred to as a CPU (Central Processing Unit). The processor 101 may be an integrated circuit chip having signal processing capabilities. The processor 101 may also be a general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components. A general purpose processor may be a microprocessor or the processor 101 may be any conventional processor or the like.
The counting device 100 for the objects on the assembly line of the embodiment can count the reinforcing steel bars and other materials in various shapes and sizes in the reinforcing steel bar conveyor of the assembly line, complete counting, and can also replace manual work to complete bundling work for fixing the number of the reinforcing steel bars. The device is influenced by the environment, has small precision and high accuracy, can send the quantity of the reinforcing steel bars to the processor 101 in real time, is convenient for the reinforcing steel bar packer to pack the reinforcing steel bars with fixed quantity, reduces the production cost and improves the working efficiency.
The present application further provides a computer storage medium, as shown in fig. 8, fig. 8 is a schematic structural diagram of an embodiment of the computer storage medium of the present application. The computer storage medium 110 has stored thereon program instructions 111, which when executed by a processor (not shown) implement: acquiring a video stream, and acquiring a current frame image and a previous frame image of an article from the video stream; analyzing the previous frame image and the current frame image respectively by using an end face segmentation model to obtain a first end face image and a second end face image of the article; updating the statistical quantity of the article based on the first end face image and the second end face image.
The program instructions 111, when executed by a processor (not shown), also implement the method for counting articles in a pipeline of the above-described embodiments.
The computer storage medium 110 of the embodiment may be, but is not limited to, a usb disk, an SD card, a PD optical drive, a removable hard disk, a high-capacity floppy drive, a flash memory, a multimedia memory card, a server, etc.
Different from the prior art, the method comprises the steps of firstly obtaining a video stream of an article on a production line, and obtaining a current frame image and a previous frame image of the article from the video stream in real time; then, analyzing the image pair of the previous frame and the current frame by using an end face segmentation model respectively to obtain a first end face image and a second end face image of the article; and finally updating the statistical quantity of the articles based on the first end face image and the second end face image. Because of this application is the quantity that updates article according to the current frame image information of article and previous frame image information, can all carry out quantity update to article at every frame of video stream constantly, and then can count in real time to the quantity of article on the assembly line, avoid examining the hourglass of article on the assembly line in the motion, can improve the accuracy of article quantity count.
In addition, if the above functions are implemented in the form of software functions and sold or used as independent articles, the functions may be stored in a storage medium readable by a mobile terminal, that is, the present application also provides a storage device storing program data, the program data being executable to implement the method of the above embodiments, the storage device may be, for example, a usb disk, an optical disk, a server, etc. That is, the present application may be embodied as a software article including instructions for causing an intelligent terminal to perform all or part of the steps of the method according to the embodiments.
In the description of the present application, reference to the description of the terms "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present application. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present application, "plurality" means at least two, e.g., two, three, etc., unless specifically limited otherwise.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and the scope of the preferred embodiments of the present application includes other implementations in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present application.
The logic and/or steps represented in the flowcharts or otherwise described herein, such as an ordered listing of executable instructions that can be viewed as implementing logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device (e.g., a personal computer, server, network device, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions). For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
The above description is only for the purpose of illustrating embodiments of the present application and is not intended to limit the scope of the present application, and all modifications of equivalent structures and equivalent processes, which are made by the contents of the specification and the drawings of the present application or are directly or indirectly applied to other related technical fields, are also included in the scope of the present application.

Claims (10)

1. A method of counting items in an assembly line, comprising:
acquiring a video stream, and acquiring a current frame image and a previous frame image of an article from the video stream;
analyzing the previous frame image and the current frame image respectively by using an end face segmentation model to obtain a first end face image and a second end face image of the article;
updating a statistical quantity of the item based on the first end face image and the second end face image.
2. The counting method of claim 1, wherein said updating the statistical quantity of the articles based on the first end face image and the second end face image comprises:
obtaining a ruled line, wherein the ruled line is parallel to a reference direction of a video frame of the item;
respectively counting a first number of pixel points with preset pixel values on the ruled line in the first end face image and a second number of pixel points with preset pixel values on the ruled line in the second end face image;
updating the quantity of the item based on a relationship between the first quantity and the second quantity.
3. The counting method of claim 2, wherein the predetermined pixel value is a first predetermined value, the pixel values of other pixels in the first end face image and the second end face image are second predetermined values, and the updating the quantity of the article based on the relationship between the first quantity and the second quantity comprises:
if the first number is greater than the second number, comparing the second number to a number threshold;
if the second quantity is less than the quantity threshold, then the quantity of the item is incremented by one.
4. The counting method of claim 3, wherein said updating the quantity of the item based on the relationship between the first quantity and the second quantity further comprises:
if the first quantity is less than the second quantity, or the second quantity is greater than or equal to the quantity threshold, the quantity of the item is unchanged.
5. The counting method according to claim 3, wherein before the analyzing the previous frame image and the current frame image respectively by using the end face segmentation model, the method further comprises:
acquiring an original end face image of the article;
marking the original end face image to obtain a label image of the article;
and training an initial end face segmentation model by using the original end face image and the label image to obtain the end face segmentation model.
6. The counting method of claim 5, wherein the labeling the original end face image to obtain the label map of the article comprises:
fitting and labeling the edge area of the article of the original end face image to form a labeled area and an unlabeled area;
and setting the pixel value of the pixel point in the labeling area as the second preset value, and setting the pixel value of the pixel point in the unmarked area as the first preset value to obtain the label graph of the article.
7. The counting method according to claim 5, wherein the loss function loss of the end face segmentation model satisfies the following condition:
Figure FDA0003154930000000021
wherein p is the probability that the pixel predicted value of the pixel point is the first preset value, y is the pixel value of the pixel point, and both alpha and gamma are adjusting parameters.
8. The counting method according to claim 1, further comprising, before the analyzing the previous frame image and the current frame image respectively by using an end face segmentation model:
and adjusting the sizes of the current frame image and the previous frame image to preset sizes.
9. An apparatus for counting items in a pipeline, comprising a memory and a processor, the memory coupled to the processor;
wherein the memory is configured to store program data and the processor is configured to execute the program data to implement:
acquiring a video stream, and acquiring a current frame image and a previous frame image of an article from the video stream;
analyzing the previous frame image and the current frame image respectively by using the end face segmentation model to obtain a first end face image and a second end face image of the article;
updating a statistical quantity of the item based on the first end face image and the second end face image.
10. A computer storage medium having stored thereon program instructions that, when executed, implement:
acquiring a video stream, and acquiring a current frame image and a previous frame image of an article from the video stream;
analyzing the previous frame image and the current frame image respectively by using the end face segmentation model to obtain a first end face image and a second end face image of the article;
updating a statistical quantity of the item based on the first end face image and the second end face image.
CN202110773821.9A 2021-07-08 2021-07-08 Method and device for counting articles on production line and computer storage medium Pending CN113674200A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110773821.9A CN113674200A (en) 2021-07-08 2021-07-08 Method and device for counting articles on production line and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110773821.9A CN113674200A (en) 2021-07-08 2021-07-08 Method and device for counting articles on production line and computer storage medium

Publications (1)

Publication Number Publication Date
CN113674200A true CN113674200A (en) 2021-11-19

Family

ID=78538713

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110773821.9A Pending CN113674200A (en) 2021-07-08 2021-07-08 Method and device for counting articles on production line and computer storage medium

Country Status (1)

Country Link
CN (1) CN113674200A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114078127A (en) * 2022-01-20 2022-02-22 广州里工实业有限公司 Object defect detection and counting method, device, equipment and storage medium
CN116449789A (en) * 2023-06-14 2023-07-18 烟台金丝猴食品科技有限公司 Intelligent control method for charging barrel and related products
CN117115751A (en) * 2023-09-22 2023-11-24 山东九州信泰信息科技股份有限公司 Equipment monitoring method and system based on industrial Internet

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005078105A (en) * 2003-08-29 2005-03-24 Daido Steel Co Ltd Method and apparatus for counting bar material
CN109544562A (en) * 2018-11-09 2019-03-29 北京工业大学 Reinforcing bar end face automatic identification counting algorithm based on image
CN110929756A (en) * 2019-10-23 2020-03-27 广物智钢数据服务(广州)有限公司 Deep learning-based steel size and quantity identification method, intelligent device and storage medium
CN111127457A (en) * 2019-12-25 2020-05-08 上海找钢网信息科技股份有限公司 Reinforcing steel bar number statistical model training method, statistical method, device and equipment
CN111639740A (en) * 2020-05-09 2020-09-08 武汉工程大学 Steel bar counting method based on multi-scale convolution neural network
CN112380920A (en) * 2020-10-23 2021-02-19 中国水产科学研究院东海水产研究所 Method for counting fry number by using video data

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005078105A (en) * 2003-08-29 2005-03-24 Daido Steel Co Ltd Method and apparatus for counting bar material
CN109544562A (en) * 2018-11-09 2019-03-29 北京工业大学 Reinforcing bar end face automatic identification counting algorithm based on image
CN110929756A (en) * 2019-10-23 2020-03-27 广物智钢数据服务(广州)有限公司 Deep learning-based steel size and quantity identification method, intelligent device and storage medium
CN111127457A (en) * 2019-12-25 2020-05-08 上海找钢网信息科技股份有限公司 Reinforcing steel bar number statistical model training method, statistical method, device and equipment
CN111639740A (en) * 2020-05-09 2020-09-08 武汉工程大学 Steel bar counting method based on multi-scale convolution neural network
CN112380920A (en) * 2020-10-23 2021-02-19 中国水产科学研究院东海水产研究所 Method for counting fry number by using video data

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
ZHIQI SU 等: "Rebar automaticlly counting on the product line", 《IEEE》 *
郑友莲;: "钢筋自动计数系统中图像识别算法的研究", 武汉工程职业技术学院学报, no. 01 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114078127A (en) * 2022-01-20 2022-02-22 广州里工实业有限公司 Object defect detection and counting method, device, equipment and storage medium
CN114078127B (en) * 2022-01-20 2022-05-17 广州里工实业有限公司 Object defect detection and counting method, device, equipment and storage medium
CN116449789A (en) * 2023-06-14 2023-07-18 烟台金丝猴食品科技有限公司 Intelligent control method for charging barrel and related products
CN116449789B (en) * 2023-06-14 2023-08-18 烟台金丝猴食品科技有限公司 Intelligent control method and system for charging barrel and computer readable storage medium
CN117115751A (en) * 2023-09-22 2023-11-24 山东九州信泰信息科技股份有限公司 Equipment monitoring method and system based on industrial Internet

Similar Documents

Publication Publication Date Title
CN113674200A (en) Method and device for counting articles on production line and computer storage medium
CN108579094B (en) User interface detection method, related device, system and storage medium
CN111310645A (en) Overflow bin early warning method, device, equipment and storage medium for cargo accumulation amount
CN112101317B (en) Page direction identification method, device, equipment and computer readable storage medium
CN112085739A (en) Semantic segmentation model training method, device and equipment based on weak supervision
CN112041851A (en) Text recognition method and terminal equipment
CN110910355A (en) Package blocking detection method and device and computer storage medium
CN111597857B (en) Logistics package detection method, device, equipment and readable storage medium
CN115037766A (en) Industrial equipment Internet of things data acquisition method and device
CN112668444A (en) Bird detection and identification method based on YOLOv5
CN113793080A (en) Real-time simulation method and device for warehouse operation state
CN109101974B (en) Denoising method and denoising device for linear interference
CN116703904A (en) Image-based steel bar quantity detection method, device, equipment and medium
CN117132872A (en) Intelligent collision recognition system for material transport vehicle on production line
CN115170608A (en) Material tracking method and device
CN114399657A (en) Vehicle detection model training method and device, vehicle detection method and electronic equipment
CN114119953A (en) Method for quickly positioning and correcting license plate, storage medium and equipment
CN115512283A (en) Parcel image processing method and device, computer equipment and storage medium
CN113194308B (en) Method and device for determining blocked area of transmission equipment
CN114170164A (en) Copper bar bending detection method and system
CN112069984A (en) Object frame matching display method and device
CN114519841A (en) Production line monitoring method and monitoring system thereof
CN113838110B (en) Verification method and device for target detection result, storage medium and electronic equipment
US20240020811A1 (en) Video image processing method, apparatus, and device, and storage medium
CN111091096B (en) Vehicle deviation decision method and device, storage medium and vehicle

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