CN113283439A - Intelligent counting method, device and system based on image recognition - Google Patents

Intelligent counting method, device and system based on image recognition Download PDF

Info

Publication number
CN113283439A
CN113283439A CN202110660386.9A CN202110660386A CN113283439A CN 113283439 A CN113283439 A CN 113283439A CN 202110660386 A CN202110660386 A CN 202110660386A CN 113283439 A CN113283439 A CN 113283439A
Authority
CN
China
Prior art keywords
image
contour
target
image information
binarization
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110660386.9A
Other languages
Chinese (zh)
Other versions
CN113283439B (en
Inventor
马彦华
张能军
蔡扬建
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Nubomed Technology Co Ltd
Original Assignee
Shenzhen Nubomed 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 Shenzhen Nubomed Technology Co Ltd filed Critical Shenzhen Nubomed Technology Co Ltd
Priority to CN202110660386.9A priority Critical patent/CN113283439B/en
Publication of CN113283439A publication Critical patent/CN113283439A/en
Application granted granted Critical
Publication of CN113283439B publication Critical patent/CN113283439B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/28Quantising the image, e.g. histogram thresholding for discrimination between background and foreground patterns
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/20Image enhancement or restoration by the use of local operators
    • G06T5/30Erosion or dilatation, e.g. thinning
    • G06T5/70
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/30Noise filtering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/44Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/44Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
    • G06V10/457Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components by analysing connectivity, e.g. edge linking, connected component analysis or slices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/74Image or video pattern matching; Proximity measures in feature spaces
    • G06V10/75Organisation of the matching processes, e.g. simultaneous or sequential comparisons of image or video features; Coarse-fine approaches, e.g. multi-scale approaches; using context analysis; Selection of dictionaries
    • G06V10/751Comparing pixel values or logical combinations thereof, or feature values having positional relevance, e.g. template matching
    • 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

Abstract

The invention discloses an intelligent counting method, a device and a system based on image recognition, wherein the method comprises the following steps: the method comprises the steps of carrying out binarization on image information acquired by an image acquisition device to obtain a binarized image, carrying out denoising processing on the binarized image and extracting to obtain a target contour meeting a contour extraction rule, extracting a corresponding region image from the image information according to the target contour, carrying out feature matching on the region image and target features to screen out an effective region image, and carrying out quantity statistics on the effective region image to obtain a statistical value which is a counting result. The invention belongs to the technical field of intelligent image identification, and can monitor target equipment in real time, acquire and process image information to extract a target contour from the image information, acquire a corresponding region image in the image information based on the target contour and perform characteristic matching with a template image to screen out an effective region image, thereby greatly improving the accuracy and reliability of counting based on the image information and acquiring a calculation result.

Description

Intelligent counting method, device and system based on image recognition
Technical Field
The invention relates to the technical field of image intelligent identification, in particular to an intelligent counting method, device and system based on image identification.
Background
Along with the progress development of science and technology, more and more work can adopt intelligent equipment to replace, replaces manual work through intelligent equipment, can improve work efficiency by a wide margin. If when placing the medicine bottle in to the medicine box and carry out automatic counting, can adopt automation equipment to replace the manual work in order to realize carrying out intelligent automatic counting to the medicine bottle. The existing medicine bottle checking counting method generally detects a medicine box above the medicine box through arranging an automatic detection device on a mounting seat, simultaneously opens a hole at the bottom of the medicine box, and sets a graphic label right to the hole at the bottom of the medicine bottle, and utilizes a displacement device to drive an optical collecting head to move and sequentially pass through the hole so as to read and transmit the graphic label in the hole to a main control circuit board, thereby obtaining medicine information corresponding to the medicine bottle and realizing automatic checking of the medicine bottle.
However, the inventor finds that in the technical method, the mobile optical acquisition head is adopted to count the number of the medicine bottles, and the mobile optical acquisition head is required to acquire and recognize images, so that the recognition result is inaccurate due to shaking of the optical acquisition head during working, and further, the counting result of the number has a large error. Therefore, the counting method based on image recognition in the prior art has the problem of low accuracy.
Disclosure of Invention
The embodiment of the invention provides an intelligent counting method, device and system based on image recognition, and aims to solve the problem of low accuracy of a counting method based on image recognition in the prior art.
In a first aspect, an embodiment of the present invention provides an intelligent counting method based on image recognition, which is applied to an intelligent counting terminal in an intelligent counting system based on image recognition, the system further includes an image acquisition device, the image acquisition device and the intelligent counting terminal are connected via a network, and the method includes:
receiving image information of target equipment input by the image acquisition device;
carrying out binarization processing on the image information according to a preset binarization rule to obtain a corresponding binarization image;
denoising the binary image to enhance the image effect and obtain the binary image with noise points removed;
extracting the binary image without the noise points according to a preset contour extraction rule to obtain a target contour meeting the contour extraction rule;
extracting a region image corresponding to each target contour from the image information according to the target contours;
performing feature matching on each area image and a pre-stored template image according to a preset matching model so as to screen out effective area images which are different from the template images from the area images;
and counting the number of the effective area images to obtain a counting result corresponding to the image information.
In a second aspect, an embodiment of the present invention further provides an intelligent counting device based on image recognition, where the device is configured in an intelligent counting terminal in an intelligent counting system based on image recognition, the system further includes an image capturing device, and the image capturing device is connected to the intelligent counting terminal through a network, where the device includes:
an image information receiving unit for receiving the image information of the target device input by the image acquisition device
A binarization image obtaining unit, configured to perform binarization processing on the image information according to a preset binarization rule to obtain a corresponding binarization image;
the de-drying processing unit is used for de-noising the binary image to enhance the image effect and obtain the binary image with noise points removed;
the target contour extraction unit is used for extracting the binarized image without the noise points according to a preset contour extraction rule to obtain a target contour meeting the contour extraction rule;
the area image acquisition unit is used for extracting an area image corresponding to each target contour from the image information according to the target contours;
the effective area image acquisition unit is used for carrying out feature matching on each area image and a pre-stored template image according to a preset matching model so as to screen out an effective area image which is different from the template image from the area image;
and the counting result acquisition unit is used for counting the number of the effective area images to obtain a counting result corresponding to the image information.
In a third aspect, an embodiment of the present invention provides an intelligent counting system based on image recognition, where the system includes an image acquisition device and an intelligent counting terminal;
the image acquisition device is used for acquiring image information of the target equipment;
the intelligent counting terminal is used for realizing the intelligent counting method based on image recognition in the first aspect.
The embodiment of the invention provides an intelligent counting method, device and system based on image recognition. The method comprises the steps of carrying out binarization on image information acquired by an image acquisition device to obtain a binarized image, carrying out denoising processing on the binarized image and extracting to obtain a target contour meeting a contour extraction rule, extracting a corresponding region image from the image information according to the target contour, carrying out feature matching on the region image and target features to screen out an effective region image, and carrying out quantity statistics on the effective region image to obtain a statistical value which is a counting result. By the method, the target equipment can be monitored in real time, the image information can be acquired and processed to extract the target contour from the image information, the corresponding area image in the image information is acquired based on the target contour, the characteristic matching is carried out on the corresponding area image and the template image to screen out the effective area image, and the accuracy and reliability of counting based on the image information and acquiring the calculation result can be greatly improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are 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.
Fig. 1 is a schematic flowchart of an intelligent counting method based on image recognition according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of an intelligent counting system based on image recognition according to an embodiment of the present invention;
fig. 3 is a schematic effect diagram of an intelligent counting method based on image recognition according to an embodiment of the present invention;
fig. 4 is a schematic effect diagram of an intelligent counting method based on image recognition according to an embodiment of the present invention;
fig. 5 is a schematic effect diagram of an intelligent counting method based on image recognition according to an embodiment of the present invention;
fig. 6 is a schematic effect diagram of an intelligent counting method based on image recognition according to an embodiment of the present invention;
fig. 7 is a schematic effect diagram of an intelligent counting method based on image recognition according to an embodiment of the present invention;
fig. 8 is a schematic effect diagram of an intelligent counting method based on image recognition according to an embodiment of the present invention;
fig. 9 is a schematic effect diagram of an intelligent counting method based on image recognition according to an embodiment of the present invention;
fig. 10 is a schematic view of an application scenario of an intelligent counting system based on image recognition according to an embodiment of the present invention;
FIG. 11 is a schematic block diagram of a computer device provided by an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. 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 invention.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the specification of the present invention and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
Referring to fig. 1 and fig. 2, fig. 1 is a schematic flowchart of an intelligent counting method based on image recognition according to an embodiment of the present invention, and fig. 2 is a schematic structural diagram of an intelligent counting system based on image recognition according to an embodiment of the present invention; the intelligent counting method based on the image recognition is applied to an intelligent counting terminal 10 in an intelligent counting system 100 based on the image recognition, the system further comprises an image acquisition device 20, the image acquisition device 20 and the intelligent counting terminal 10 are connected through a network to realize the transmission of data information, the intelligent counting method based on the image recognition is executed through application software installed in the intelligent counting terminal 10, and the intelligent counting terminal 10 is a terminal device which can receive the image information input by the image acquisition device 20 and perform the image recognition to obtain a counting result, such as a desktop computer, a notebook computer, a tablet computer or a mobile phone. As shown in fig. 1, the method includes steps S110 to S170.
S110, receiving image information of the target equipment input by the image acquisition device;
the target equipment is specific equipment needing counting, image information of the target equipment can be collected through the image collecting device, corresponding features in the target equipment are counted based on the image information to obtain corresponding counting results, in the practical application process, the image collecting device can shoot images periodically to collect the image information of the target equipment, for example, if the shooting period is 0.5S, the image collecting device collects the image information of one piece of target equipment every 0.5S, the counting results are obtained by identifying the image information of the target equipment, and real-time monitoring of the target equipment can be achieved. For example, in this embodiment, the target device may be a medicine bottle holder, a plurality of medicine bottle placing positions are provided on the medicine bottle holder, each medicine bottle is placed to be capable of placing one medicine bottle, then the target device is counted, that is, the number of the medicine bottles placed on the medicine bottle holder is counted, and then the image information acquired by the image acquisition device is the image including each medicine bottle placing position in the medicine bottle holder.
And S120, carrying out binarization processing on the image information according to a preset binarization rule to obtain a corresponding binarization image.
And carrying out binarization processing on the image information according to a preset binarization rule to obtain a corresponding binarization image. In one embodiment, step S120 includes the sub-steps of: carrying out graying processing on the image information to obtain a corresponding grayscale image; dividing the gray-scale image into a plurality of non-overlapping image blocks according to the division size; calculating the pixel mean value of pixel points contained in each image block; taking the pixel mean value of each image block as a binarization threshold value of binarization, and performing binarization on pixels contained in each image block to obtain a plurality of corresponding binarization image blocks; and carrying out sequential seamless splicing on the plurality of binarization image blocks to obtain a binarization image corresponding to the image information.
The input image information is a color image, each pixel point in the color image corresponds to an RGB pixel value, the RGB pixel values are pixel values of pixels respectively corresponding to R (red), G (green) and B (blue) color channels, and the value ranges of the pixel values are integers within [0,255 ]; the obtained image information can be grayed firstly, that is, the RGB pixel value of the pixel is converted into a gray pixel value, the gray pixel value is a pixel value corresponding to the pixel on a gray color channel, the value range of the gray pixel value is an integer within [0,255], if the gray pixel value of a certain pixel point is 255, the pixel point is white, and if the gray pixel value of a certain pixel point is 0, the pixel point is black. For example, fig. 3 shows a grayscale image obtained by performing a graying process on image information.
The gray level image can be subjected to binarization processing according to a binarization rule, the binarization image obtained by binarization processing only contains two elements of '0' and '1', if the pixel point is '1', the pixel point is indicated to be filled with pixels with pixel values, and if the pixel point is '0', the pixel point is indicated to be pixels without pixel values. For example, fig. 4 shows a binarized image obtained by binarizing the grayscale image. Wherein the binarization rule comprises a segmentation size.
The binarization processing process comprises the following steps: the grayscale image can be divided into a plurality of non-overlapping image blocks according to a division size, for example, the division size is 4 × 4, and the grayscale image can be divided into a plurality of image blocks of 4 × 4 size, each image block being rectangular and including 16 pixels. And obtaining the gray pixel values of the pixel points in each image block, and calculating to obtain the pixel mean value of each image block, wherein the pixel mean value of each image block is the mean value of the gray pixel values of all the pixel points contained in the image block, and each image block corresponds to one pixel mean value uniquely. For example, if the image block size is 4 × 4, the gray pixel values of 16 pixels in the image block are obtained and the corresponding pixel mean value is obtained through calculation. The pixel mean value of each image block is used as a binarization threshold to binarize pixels contained in the image block, specifically, if the gray pixel value of a certain pixel point in the image block is greater than the binarization threshold of the image block, the pixel point is marked as '1', if the gray pixel value of the certain pixel point in the image block is not greater than the binarization threshold of the image block, the pixel point is marked as '0', each image block can be binarized to obtain a corresponding binarization image block by adopting the method, the obtained binarization image blocks can be seamlessly spliced according to the original position of the binarization image block in the gray image to obtain a binarization image, and the image size of the obtained binarization image is the same as the image size of the image information.
And S130, denoising the binary image to enhance the image effect and obtain the binary image without noise points.
And denoising the binary image to enhance the image effect and obtain the binary image without noise points. The obtained binary image can be further subjected to denoising processing to remove noise in the binary image to obtain the binary image with the noise removed, and the detail characteristics in the binary image can be further enhanced through pixel expansion operation in the process of denoising processing.
In one embodiment, step S130 includes the sub-steps of: carrying out median filtering processing on the binary image according to a preset image processing rule to obtain a corresponding binary filtered image; obtaining an invalid pixel connected domain in the binaryzation filtering image; filtering an invalid pixel connected domain with an area smaller than the invalid area threshold value in the binarized filtered image according to a preset invalid area threshold value to obtain a connected domain filtered image; and carrying out pixel expansion operation on the effective pixel connected domain in the connected domain filtered image to obtain a binary filtered image with noise points removed.
The median filtering processing can be carried out on the obtained binary image according to the image processing rule to obtain a corresponding binary filtering image, and the basic principle of the median filtering is to replace the value of one point in the binary image by the median of each point value in a neighborhood of the point and enable the surrounding pixel value to be close to the true value, thereby eliminating the isolated noise point. Specifically, the image processing rule includes a filtering range, and a filtering pixel value of the median filtering output can be represented by formula (1):
g(x,y)=med{f(x-k,y-j),(k,j∈W)} (1);
wherein, g (x, y) is a filtering pixel value corresponding to a pixel point with a coordinate value of (x, y) in the binarized image output by median filtering, med represents median calculation, f (x, y) is a pixel value of a pixel point with a coordinate value of (x, y) in the binarized image, W is a filtering range, and W can be determined through experiments, for example, a rectangular pixel area with a coordinate value of 17 × 17 can be determined through experiments, and can also be in other different shapes such as a linear shape, a circular shape, a cross shape, a circular shape and the like.
For example, fig. 5 shows a binarized filtered image obtained by performing median filtering on the binarized image.
After the binary filtering image is obtained, an invalid pixel connected domain in the binary filtering image can be further obtained. Specifically, an invalid pixel connected domain in the binarized filtered image can be obtained, the invalid pixel connected domain is only composed of invalid pixel points in the binarized filtered image, the invalid pixel points are pixel points marked as '0' in the binarized filtered image, the invalid pixel points in the binarized filtered image can be obtained, a plurality of the communicated invalid pixel points are combined to form an invalid pixel connected domain, namely, any two invalid pixel connected domains are not communicated with each other, the invalid pixel connected domain at least comprises one pixel point marked as '0', and any one invalid pixel connected domain at least comprises one invalid pixel point. The area of each invalid pixel connected domain can be judged whether to be smaller than a preset invalid area threshold value or not, the invalid pixel connected domains with the areas smaller than the invalid area threshold value are filtered, and the invalid pixel connected domains with the areas smaller than the invalid area threshold value can be identified as noise in the image. For example, an invalid area threshold value of 500 may be preconfigured, and if the number of invalid pixel points included in the invalid pixel connected domain is less than 500, it is determined that the area of the invalid pixel connected domain is smaller than the invalid area threshold value, and filtering is performed; and if the number of the invalid pixel points contained in the invalid pixel connected domain is not less than 500, reserving the invalid pixel connected domain.
And then, performing pixel expansion operation on the effective pixel connected domain in the obtained connected domain filtered image, wherein the region outside the residual ineffective pixel connected domain in the connected domain filtered image is the effective pixel connected domain, performing pixel expansion operation on the effective pixel connected domain, and performing pixel expansion operation on edge pixels contained in the effective pixel connected domain, namely the pixel expansion operation has the functions of filling fine holes in the region, connecting an adjacent image region and smoothing the boundary of the image region. The pixel expansion operation can be carried out on the effective pixel connected domain in the target region image to obtain an expanded pixel connected domain, and the obtained binaryzation image without the noise point contains the expanded pixel connected domain with a smooth boundary. For example, fig. 6 shows a noise-removed binarized filtered image obtained by denoising the binarized filtered image.
S140, extracting the binarized image without the noise points according to a preset contour extraction rule to obtain a target contour meeting the contour extraction rule.
And extracting the binary image without the noise points according to a preset contour extraction rule to obtain a target contour meeting the contour extraction rule. The method comprises the steps of extracting a target contour from a binarized image without noise points, wherein contour extraction rules are concrete rules for extracting the target contour from the binarized image, specifically, the contour extraction rules comprise corresponding contour parameter values, obtaining corresponding contour lines from the binarized image without the noise points, respectively judging whether each contour line meets the contour parameter values, if so, taking the corresponding contour line as the target contour, and if not, discarding the corresponding contour line.
In one embodiment, step S140 includes the sub-steps of: acquiring an image contour corresponding to the binarized image without the noise points; judging whether each contour line in the image contour is matched with a contour parameter value in the contour extraction rule so as to judge whether the contour line meets the contour extraction rule; and acquiring the contour line meeting the contour extraction rule as a target contour.
The method comprises the steps of firstly obtaining a corresponding image contour from a binary image, wherein the image contour comprises a plurality of contour lines, the contour lines are dividing lines between invalid pixel connected domains and expanded pixel connected domains in the binary image, the marks of pixel points on one side of the dividing lines are all '1', the marks of pixel points on the other side of the dividing lines are all '0', and the image contour can be correspondingly obtained from the binary image according to the marks of the pixel points. For example, an image contour extracted from the noise-removed binarized image is shown in fig. 7.
After the image contour is obtained, whether each contour line in the image contour is matched with a contour parameter value can be judged, and the specific realization method is that the circle centers (X) of all circular contour lines in the image contour are obtained through Hough Transform (HT)i,Yi) And radius RiThe contour parameter values comprise the radius range of the circular contour lines and the minimum distance value between two circle centers, and whether the radius of each circular contour line in the image contour is within the radius range or not and whether the circle center distance between the circle center of each circular contour line and the circle center of the adjacent circular contour line is not less than the minimum distance value or not can be judged. If the radius of a certain circular contour line is within the radius range, and the distance between the circle center of the circular contour line and the circle center of the adjacent circular contour line is not less than the minimum distance value, judging that the circular contour line is a contour line matched with the contour parameter value; if the radius of a certain circular contour line is not within the radius range, or the distance between the circle center of the circular contour line and the circle center of any adjacent circular contour line is smaller than the minimum distance value, the circular contour line is judged to be the contour line which is not matched with the contour parameter value. By the method, whether the contour line in the image contour meets the contour extraction rule can be judged, namely, the method can filter the circular contour line corresponding to the camera and other unsuitable circular contour lines in the image contour and can also filter out the unsuitable circular contour linesAnd obtaining a contour line meeting the contour extraction rule as a target contour according to the judgment result, wherein the obtained target contour line is a circular contour line corresponding to the medicine bottle placing position in the implementation. In other embodiments, the target contour may be an outline of other shapes such as an ellipse, a rectangle, a triangle, and the like.
S150, extracting a region image corresponding to each target contour from the image information according to the target contours.
And extracting a region image corresponding to each target contour from the image information according to the target contours. In this embodiment, the specific position of the target contour in the image information corresponds to the position of the medicine bottle placement position in the image information, an area image corresponding to the target contour may be extracted from the image information according to the target contour, the area image corresponding to the target contour is an image included in an area corresponding to the medicine bottle placement position in the image information, and each target contour may be extracted from the image information to obtain an area image. For example, as shown in fig. 8, the region image extracted from the image information according to the target contour is an image of a region corresponding to the target contour in fig. 8, a light-colored circular ring outside the black circular region is the target contour, and a light-colored point in the black circular region is a center of a circle corresponding to the target contour.
And S160, performing feature matching on each area image and a pre-stored template image according to a preset matching model so as to screen out effective area images which are different from the template images from the area images.
And performing characteristic matching on each area image and a pre-stored template image according to a preset matching model so as to screen out effective area images which are different from the template images from the area images. The matching model is a specific model for performing feature matching on the region image and the template image so as to judge whether the region image is matched with the template image, the template image is feature information which is stored in the user terminal in advance and used for performing feature matching, the template image can be feature information corresponding to an image where a medicine bottle is not placed at a medicine bottle placing position, the template image can be used for quantitatively representing the specific features of the corresponding template, and the region image which is different from the template image is screened out from the region image to be used as an effective region image based on the judgment result of judging whether the region image is matched with the template image or not by the matching model. The matching model comprises a matching degree calculation formula and a matching degree threshold value.
In one embodiment, step S160 includes the sub-steps of: respectively calculating the matching degree between each region image and the template image according to the matching degree calculation formula; and judging whether the matching degree of each region image is greater than the threshold value of the matching degree or not so as to take the region image greater than the threshold value of the matching degree as an effective region image.
The pixel information contained in each area image can be converted into a vector to be represented, the template image is also represented by the vector, and the vector dimension corresponding to the area image is equal to the vector dimension corresponding to the template image. For example, the region image may be represented by a vector of 1 × 256 dimensions, where each value corresponds to a value range of [0,255], and the template image may also be represented by a vector of 1 × 256 dimensions, where each value also has a value range of [0,255 ]. The matching degree between each region image and the template image can be calculated by a matching degree calculation formula, which can be expressed by formula (2):
Figure BDA0003114936440000091
wherein P is the calculated matching degree, TiFor the ith value, S, in any one region imageiIs the ith number in the template image, and m is the total number of values in the region image. For example, m may be 256.
The matching degree corresponding to each region image can be calculated through the calculation formula, the larger the matching degree is, the larger the difference between the region image and the template image is, and the smaller the matching degree is, the smaller the difference between the region image and the template image is. Whether the matching degree of each region image is greater than a preset matching degree threshold value or not can be judged, and if the matching degree is greater than the matching degree threshold value, the judgment result is that the region image is not matched with the template image; if the matching degree is not greater than the threshold value of the matching degree, the judgment result is that the area image is matched with the template image, each area image corresponds to one area image, and the area image which is different from the template image can be obtained according to the judgment result of each area image and serves as an effective area image.
Before calculating the matching degree between the region image and the template image, a corresponding template image can be extracted from a pre-stored template image set, the template image set comprises a plurality of template images, in this embodiment, the template image can be an image without a medicine bottle at a medicine bottle placement position, pixel information of each pixel point in each template image is respectively obtained, average calculation is respectively performed on the pixel information of all the template images in each dimension to obtain comprehensive feature information including features of all the template images, and the obtained comprehensive feature information is used as the template image extracted from the template image set and is used subsequently.
For example, as shown in fig. 9, based on the effective area image obtained by filtering the area image, the light-colored ring outside the black circular area in fig. 9 is the marking information for marking the filtered effective area image.
In an embodiment, step S160 is followed by the steps of: judging whether the number of the area images is not less than a preset number threshold value or not; if the number of the area images is smaller than the number threshold, determining that the target device is in an operated state; and if the number of the area images is not less than the number threshold, performing feature matching on each area image and a pre-stored template image according to a preset matching model to screen out effective area images which are different from the template images from the area images.
It can be determined whether the number of the region images is not less than a number threshold, and in this embodiment, the number threshold may be configured as the total number of the vial placement positions included in the vial holder. Since the target device is detected in real time in the scheme, if the user is operating the target device, the counting result of the target device cannot be correctly obtained. For example, when a user takes a medicine bottle placed on the medicine bottle support, the hand of the user can shield part of the medicine bottle placing positions, the collected image information does not contain all the medicine bottle placing positions, and accurate counting results cannot be obtained through statistics from the collected image information. Therefore, whether the number of the area images is not less than the number threshold value or not can be judged, and if the number of the area images is less than the number threshold value, the fact that the user is using the target equipment at the moment is indicated, namely the target equipment is judged to be in the operated state; if the number of the area images is not less than the number threshold, it indicates that the user does not operate the target device at this time, and the following step S160 may be executed.
S170, counting the number of the effective area images to obtain a counting result corresponding to the image information.
And counting the number of the effective area images to obtain a counting result corresponding to the image information. And counting the number of the effective area images obtained by screening to obtain a statistical value, wherein the statistical value is a counting result corresponding to the image information. In this embodiment, the counting result is the number of vials placed on the vial holder.
In an embodiment, step S170 is followed by the steps of: and deleting the image information, and returning to the step of executing the received image information of the target equipment input by the image acquisition device so as to monitor the target equipment in real time.
And after the counting result of the current target equipment is obtained, deleting the image information acquired this time, returning to the step S110, acquiring the next image information acquired by the image acquisition device, and repeatedly executing the steps S110 to S170, thereby realizing the periodic real-time monitoring of the target equipment.
In the intelligent counting method based on image recognition provided by the embodiment of the invention, the image information acquired by the image acquisition device is binarized to obtain a binarized image, the binarized image is subjected to denoising processing and extracted to obtain a target contour meeting a contour extraction rule, a corresponding region image is extracted from the image information according to the target contour, the region image and the target feature are subjected to feature matching to screen out an effective region image, and a statistical value obtained by performing quantity statistics on the effective region image is a counting result. By the method, the target equipment can be monitored in real time, the image information can be acquired and processed to extract the target contour from the image information, the corresponding area image in the image information is acquired based on the target contour, the characteristic matching is carried out on the corresponding area image and the template image to screen out the effective area image, and the accuracy and reliability of counting based on the image information and acquiring the calculation result can be greatly improved.
The embodiment of the present invention further provides an intelligent counting system 100 based on image recognition, where the intelligent counting system 100 based on image recognition includes an image acquisition device 20 and an intelligent counting terminal 10, where the intelligent counting terminal 10 may be configured in a terminal device, and the intelligent counting terminal 10 in the intelligent counting system 100 based on image recognition is configured to execute any embodiment of the foregoing intelligent counting method based on image recognition. Specifically, referring to fig. 10, fig. 10 is a schematic view of an application scenario of the intelligent counting system based on image recognition according to the embodiment of the present invention.
The intelligent counting system 100 based on image recognition comprises an image acquisition device 20 and an intelligent counting terminal 10; the image acquisition device 20 is used for acquiring image information of the target equipment; the intelligent counting terminal 10 is configured to analyze the image information to obtain a counting result corresponding to the target device through statistics, that is, to implement the above-mentioned intelligent counting method based on image recognition.
More specifically, as shown in fig. 10, the image capturing apparatus 20 includes a camera 21 disposed on the target device 30 and a mirror 22 fixedly disposed above the target device 30; the camera 21 is configured to collect light reflected by the reflector 22 from the target device 30 to obtain corresponding image information, and the camera 21 is connected to the intelligent counting terminal 10 via a network. In a more specific embodiment, the target device may further include at least one fill-in light 23, and the fill-in light 23 may be disposed on the target device 30 and oriented in the same direction as the camera 21, for example, in fig. 10, two fill-in light 23 are disposed on the target device 30 and adjacent to the camera 21; the fill-in light 23 may also be disposed on both sides of the reflector 22 and directed toward the target device 30.
The embodiment of the present invention further provides an intelligent counting device based on image recognition, which is configured in the intelligent counting terminal 10 in the intelligent counting system 100 based on image recognition, and is used for executing any one embodiment of the foregoing intelligent counting method based on image recognition, wherein the intelligent counting device based on image recognition comprises: the image information receiving unit is used for receiving the image information of the target equipment input by the image acquisition device; a binarization image obtaining unit, configured to perform binarization processing on the image information according to a preset binarization rule to obtain a corresponding binarization image; the de-drying processing unit is used for de-noising the binary image to enhance the image effect and obtain the binary image with noise points removed; the target contour extraction unit is used for extracting the binarized image without the noise points according to a preset contour extraction rule to obtain a target contour meeting the contour extraction rule; the area image acquisition unit is used for extracting an area image corresponding to each target contour from the image information according to the target contours; the effective area image acquisition unit is used for carrying out feature matching on each area image and a pre-stored template image according to a preset matching model so as to screen out an effective area image which is different from the template image from the area image; and the counting result acquisition unit is used for counting the number of the effective area images to obtain a counting result corresponding to the image information.
The image recognition-based intelligent counting device provided by the embodiment of the invention applies the image recognition-based intelligent counting method, binarizes image information acquired by an image acquisition device to obtain a binary image, performs denoising processing on the binary image and extracts a target contour meeting a contour extraction rule, extracts a corresponding region image from the image information according to the target contour, performs feature matching on the region image and target features to screen out an effective region image, and obtains a statistical value obtained by performing quantity statistics on the effective region image as a counting result. By the method, the target equipment can be monitored in real time, the image information can be acquired and processed to extract the target contour from the image information, the corresponding area image in the image information is acquired based on the target contour, the characteristic matching is carried out on the corresponding area image and the template image to screen out the effective area image, and the accuracy and reliability of counting based on the image information and acquiring the calculation result can be greatly improved.
The above-mentioned intelligent counting device based on image recognition may be implemented in the form of a computer program, which may be run on a computer apparatus as shown in fig. 11.
Referring to fig. 11, fig. 11 is a schematic block diagram of a computer device according to an embodiment of the present invention. The computer equipment can be an intelligent counting terminal used for executing an intelligent counting method based on image recognition so as to receive image information input by an image acquisition device and perform image recognition to obtain a counting result.
Referring to fig. 11, the computer device 500 includes a processor 502, memory, and a network interface 505 connected by a system bus 501, where the memory may include a storage medium 503 and an internal memory 504.
The storage medium 503 may store an operating system 5031 and a computer program 5032. The computer program 5032, when executed, may cause the processor 502 to perform an intelligent counting method based on image recognition, wherein the storage medium 503 may be a volatile storage medium or a non-volatile storage medium.
The processor 502 is used to provide computing and control capabilities that support the operation of the overall computer device 500.
The internal memory 504 provides an environment for the execution of the computer program 5032 in the storage medium 503, and when the computer program 5032 is executed by the processor 502, the processor 502 can be enabled to execute the intelligent counting method based on image recognition.
The network interface 505 is used for network communication, such as providing transmission of data information. Those skilled in the art will appreciate that the configuration shown in fig. 11 is a block diagram of only a portion of the configuration associated with aspects of the present invention and is not intended to limit the computing device 500 to which aspects of the present invention may be applied, and that a particular computing device 500 may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
The processor 502 is configured to run a computer program 5032 stored in the memory to implement the corresponding functions of the intelligent counting method based on image recognition.
In another embodiment of the invention, a computer-readable storage medium is provided. The computer readable storage medium may be a volatile or non-volatile computer readable storage medium. The computer readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps included in the above-mentioned intelligent counting method based on image recognition.
While the invention has been described with reference to specific embodiments, the invention is not limited thereto, and various equivalent modifications and substitutions can be easily made by those skilled in the art within the technical scope of the invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (10)

1. An intelligent counting method based on image recognition is applied to an intelligent counting terminal in an intelligent counting system based on image recognition, the system also comprises an image acquisition device, and the image acquisition device is connected with the intelligent counting terminal through a network, and the method is characterized by comprising the following steps:
receiving image information of target equipment input by the image acquisition device;
carrying out binarization processing on the image information according to a preset binarization rule to obtain a corresponding binarization image;
denoising the binary image to enhance the image effect and obtain the binary image with noise points removed;
extracting the binary image without the noise points according to a preset contour extraction rule to obtain a target contour meeting the contour extraction rule;
extracting a region image corresponding to each target contour from the image information according to the target contours;
performing feature matching on each area image and a pre-stored template image according to a preset matching model so as to screen out effective area images which are different from the template images from the area images;
and counting the number of the effective area images to obtain a counting result corresponding to the image information.
2. The intelligent counting method based on image recognition according to claim 1, wherein the binarization rule includes a segmentation size, and the binarizing processing on the image information according to a preset binarization rule to obtain a corresponding binarized image comprises:
carrying out graying processing on the image information to obtain a corresponding grayscale image;
dividing the gray-scale image into a plurality of non-overlapping image blocks according to the division size;
calculating the pixel mean value of pixel points contained in each image block;
taking the pixel mean value of each image block as a binarization threshold value of binarization, and performing binarization on pixels contained in each image block to obtain a plurality of corresponding binarization image blocks;
and carrying out sequential seamless splicing on the plurality of binarization image blocks to obtain a binarization image corresponding to the image information.
3. The intelligent counting method based on image recognition according to claim 1, wherein the image information is an image formed by shooting the target device through a camera in the image acquisition device and reflecting the target device by a reflector, and the denoising processing is performed on the binarized image to enhance the image effect, so as to obtain the binarized image without noise, and the method comprises the following steps:
carrying out median filtering processing on the binary image according to a preset image processing rule to obtain a corresponding binary filtered image;
obtaining an invalid pixel connected domain in the binaryzation filtering image;
filtering an invalid pixel connected domain with an area smaller than the invalid area threshold value in the binarized filtered image according to a preset invalid area threshold value to obtain a connected domain filtered image;
and carrying out pixel expansion operation on the effective pixel connected domain in the connected domain filtered image to obtain a binary filtered image with noise points removed.
4. The image recognition-based intelligent counting method according to claim 1, wherein the extracting the noise-removed binarized image according to a preset contour extraction rule to obtain a target contour satisfying the contour extraction rule comprises:
acquiring an image contour corresponding to the binarized image without the noise points;
judging whether each contour line in the image contour is matched with a contour parameter value in the contour extraction rule so as to judge whether the contour line meets the contour extraction rule;
and acquiring the contour line meeting the contour extraction rule as a target contour.
5. The intelligent counting method based on image recognition according to claim 1, wherein the matching model comprises a matching degree calculation formula and a matching degree threshold, and the performing feature matching on each region image and a pre-stored template image according to a preset matching model to screen out an effective region image from the region images, which is different from the template images, comprises:
respectively calculating the matching degree between each region image and the template image according to the matching degree calculation formula;
and judging whether the matching degree of each region image is greater than the threshold value of the matching degree or not so as to take the region image greater than the threshold value of the matching degree as an effective region image.
6. The intelligent counting method based on image recognition according to claim 1, wherein after extracting the region image corresponding to each target contour from the image information according to the target contour, the method further comprises:
judging whether the number of the area images is not less than a preset number threshold value or not;
if the number of the area images is smaller than the number threshold, determining that the target device is in an operated state;
and if the number of the area images is not less than the number threshold, performing feature matching on each area image and a pre-stored template image according to a preset matching model to screen out effective area images which are different from the template images from the area images.
7. The intelligent counting method based on image recognition according to claim 1, wherein after counting the number of the effective area images and obtaining a counting result corresponding to the image information, the method further comprises:
and deleting the image information, and returning to the step of executing the received image information of the target equipment input by the image acquisition device so as to monitor the target equipment in real time.
8. An intelligent counting device based on image recognition, which is characterized in that the intelligent counting device is configured at an intelligent counting terminal in an intelligent counting system based on image recognition, the system further comprises an image acquisition device, and the image acquisition device is connected with the intelligent counting terminal through a network, and the device comprises:
the image information receiving unit is used for receiving the image information of the target equipment input by the image acquisition device;
a binarization image obtaining unit, configured to perform binarization processing on the image information according to a preset binarization rule to obtain a corresponding binarization image;
the de-drying processing unit is used for de-noising the binary image to enhance the image effect and obtain the binary image with noise points removed;
the target contour extraction unit is used for extracting the binarized image without the noise points according to a preset contour extraction rule to obtain a target contour meeting the contour extraction rule;
the area image acquisition unit is used for extracting an area image corresponding to each target contour from the image information according to the target contours;
the effective area image acquisition unit is used for carrying out feature matching on each area image and a pre-stored template image according to a preset matching model so as to screen out an effective area image which is different from the template image from the area image;
and the counting result acquisition unit is used for counting the number of the effective area images to obtain a counting result corresponding to the image information.
9. An intelligent counting system based on image recognition is characterized by comprising an image acquisition device and an intelligent counting terminal;
the image acquisition device is used for acquiring image information of the target equipment;
the intelligent counting terminal is used for realizing the intelligent counting method based on image recognition according to any one of claims 1 to 7.
10. The intelligent counting system based on image recognition according to claim 9, wherein the image acquisition device comprises a camera arranged on the target device and a reflector fixedly arranged above the target device; the camera is used for collecting light rays reflected by the target equipment through the reflector to obtain corresponding image information, and the camera is connected with the intelligent counting terminal through a network.
CN202110660386.9A 2021-06-15 2021-06-15 Intelligent counting method, device and system based on image recognition Active CN113283439B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110660386.9A CN113283439B (en) 2021-06-15 2021-06-15 Intelligent counting method, device and system based on image recognition

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110660386.9A CN113283439B (en) 2021-06-15 2021-06-15 Intelligent counting method, device and system based on image recognition

Publications (2)

Publication Number Publication Date
CN113283439A true CN113283439A (en) 2021-08-20
CN113283439B CN113283439B (en) 2022-09-23

Family

ID=77284482

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110660386.9A Active CN113283439B (en) 2021-06-15 2021-06-15 Intelligent counting method, device and system based on image recognition

Country Status (1)

Country Link
CN (1) CN113283439B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114373196A (en) * 2021-12-31 2022-04-19 北京极豪科技有限公司 Effective acquisition region determining method, program product, storage medium, and electronic device
CN115223293A (en) * 2022-07-14 2022-10-21 深圳诺博医疗科技有限公司 Taking verification method, device, system and equipment for consumable cabinet

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1685373A (en) * 2003-03-14 2005-10-19 富士通株式会社 Paper sheet identifying method and paper sheet identifying device
CN102156868A (en) * 2011-03-31 2011-08-17 汉王科技股份有限公司 Image binaryzation method and device
CN103413124A (en) * 2013-08-19 2013-11-27 中国科学院自动化研究所 Method for detecting round traffic sign
CN104517101A (en) * 2014-12-19 2015-04-15 中南大学 Game poker card recognition method based on pixel square difference matching
CN106780435A (en) * 2016-11-18 2017-05-31 郑州云海信息技术有限公司 A kind of object count method and device
CN108549874A (en) * 2018-04-19 2018-09-18 广州广电运通金融电子股份有限公司 A kind of object detection method, equipment and computer readable storage medium
CN110298860A (en) * 2019-05-31 2019-10-01 河池学院 A kind of high bar silk ball detection number system based on machine vision

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1685373A (en) * 2003-03-14 2005-10-19 富士通株式会社 Paper sheet identifying method and paper sheet identifying device
CN102156868A (en) * 2011-03-31 2011-08-17 汉王科技股份有限公司 Image binaryzation method and device
CN103413124A (en) * 2013-08-19 2013-11-27 中国科学院自动化研究所 Method for detecting round traffic sign
CN104517101A (en) * 2014-12-19 2015-04-15 中南大学 Game poker card recognition method based on pixel square difference matching
CN106780435A (en) * 2016-11-18 2017-05-31 郑州云海信息技术有限公司 A kind of object count method and device
CN108549874A (en) * 2018-04-19 2018-09-18 广州广电运通金融电子股份有限公司 A kind of object detection method, equipment and computer readable storage medium
CN110298860A (en) * 2019-05-31 2019-10-01 河池学院 A kind of high bar silk ball detection number system based on machine vision

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
古亭等: "基于距离变换的粘连蚕茧分割方法", 《计算机工程与应用》 *
黄丹平等: "基于机器视觉瓦楞纸板自动计数系统研究", 《机械工程学报》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114373196A (en) * 2021-12-31 2022-04-19 北京极豪科技有限公司 Effective acquisition region determining method, program product, storage medium, and electronic device
CN114373196B (en) * 2021-12-31 2023-09-19 天津极豪科技有限公司 Effective acquisition area determination method, program product, storage medium and electronic device
CN115223293A (en) * 2022-07-14 2022-10-21 深圳诺博医疗科技有限公司 Taking verification method, device, system and equipment for consumable cabinet
CN115223293B (en) * 2022-07-14 2023-06-02 深圳诺博医疗科技有限公司 Taking verification method, device, system and equipment for consumable cabinet

Also Published As

Publication number Publication date
CN113283439B (en) 2022-09-23

Similar Documents

Publication Publication Date Title
CN110060237B (en) Fault detection method, device, equipment and system
CN107545239B (en) Fake plate detection method based on license plate recognition and vehicle characteristic matching
JP4528309B2 (en) Object detection method, object detection apparatus, and object detection program
CN111179243A (en) Small-size chip crack detection method and system based on computer vision
CN109409355B (en) Novel transformer nameplate identification method and device
EP2833288A1 (en) Face calibration method and system, and computer storage medium
CN113283439B (en) Intelligent counting method, device and system based on image recognition
CN112686858A (en) Visual defect detection method, device, medium and equipment for mobile phone charger
CN110909640A (en) Method and device for determining water level line, storage medium and electronic device
CN111382704A (en) Vehicle line-pressing violation judgment method and device based on deep learning and storage medium
CN105447489B (en) A kind of character of picture OCR identifying system and background adhesion noise cancellation method
CN111259891B (en) Method, device, equipment and medium for identifying identity card in natural scene
CN115205223B (en) Visual inspection method and device for transparent object, computer equipment and medium
CN114494017B (en) Method, device, equipment and medium for adjusting DPI (deep packet inspection) image according to scale
CN110415208A (en) A kind of adaptive targets detection method and its device, equipment, storage medium
CN110378351B (en) Seal identification method and device
CN111626941A (en) Document correction method based on deep learning semantic segmentation
CN111784675A (en) Method and device for processing article texture information, storage medium and electronic equipment
CN108171098A (en) A kind of code detection method and equipment
CN110795955A (en) System and method for rapidly identifying multiple bar codes
CN111695374B (en) Segmentation method, system, medium and device for zebra stripes in monitoring view angles
CN110264463A (en) A kind of material counting method based on matlab image procossing
CN113689378B (en) Determination method and device for accurate positioning of test strip, storage medium and terminal
CN112785550A (en) Image quality value determination method, image quality value determination device, storage medium, and electronic device
CN111626299A (en) Outline-based digital character recognition method

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