CN116597431A - Commodity outer package information detection method, commodity outer package information detection device, electronic equipment and storage medium - Google Patents

Commodity outer package information detection method, commodity outer package information detection device, electronic equipment and storage medium Download PDF

Info

Publication number
CN116597431A
CN116597431A CN202310409393.0A CN202310409393A CN116597431A CN 116597431 A CN116597431 A CN 116597431A CN 202310409393 A CN202310409393 A CN 202310409393A CN 116597431 A CN116597431 A CN 116597431A
Authority
CN
China
Prior art keywords
commodity
image
detected
type
text
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
CN202310409393.0A
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.)
Bank of China Financial Technology Co Ltd
Original Assignee
Bank of China Financial 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 Bank of China Financial Technology Co Ltd filed Critical Bank of China Financial Technology Co Ltd
Priority to CN202310409393.0A priority Critical patent/CN116597431A/en
Publication of CN116597431A publication Critical patent/CN116597431A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/60Type of objects
    • G06V20/62Text, e.g. of license plates, overlay texts or captions on TV images
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/14Image acquisition
    • G06V30/1444Selective acquisition, locating or processing of specific regions, e.g. highlighted text, fiducial marks or predetermined fields
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/14Image acquisition
    • G06V30/148Segmentation of character regions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/19Recognition using electronic means
    • G06V30/191Design or setup of recognition systems or techniques; Extraction of features in feature space; Clustering techniques; Blind source separation
    • G06V30/19147Obtaining sets of training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/19Recognition using electronic means
    • G06V30/191Design or setup of recognition systems or techniques; Extraction of features in feature space; Clustering techniques; Blind source separation
    • G06V30/19173Classification techniques
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Landscapes

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

Abstract

The invention provides a commodity outer package information detection method, a commodity outer package information detection device, electronic equipment and a storage medium, and belongs to the technical field of computers. The commodity outer package information detection method comprises the following steps: acquiring an image of a target commodity, and preprocessing the image of the target commodity to obtain a commodity image to be detected; detecting text areas of the commodity images to be detected to obtain text area images of the commodity images to be detected; carrying out commodity type identification on the commodity image to be detected to obtain the type of the target commodity; and carrying out text recognition on the text region image by utilizing a word stock corresponding to the type of the target commodity to obtain the outer package information of the target commodity. According to the invention, text region detection is carried out on the commodity image to be detected, and then text recognition is carried out on the text region image by utilizing the word stock corresponding to the type of the target commodity, so that the outer package information of the target commodity is obtained, the text positioning precision can be improved, and the recognition accuracy of the outer package information of the commodity can be improved.

Description

Commodity outer package information detection method, commodity outer package information detection device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and apparatus for detecting information on an outer package of a commodity, an electronic device, and a storage medium.
Background
With the development of economy, various commodities are filled everywhere in life, and how to quickly and efficiently detect commodity external packing information becomes a problem to be solved urgently. At present, since the image background is generally single in the industrial field, most of the methods for detecting the commodity outer packing information adopt a color positioning algorithm for positioning, and a computer is used for identifying the color of the commodity outer packing information so as to separate the commodity outer packing information from the background, thereby positioning the commodity outer packing information. During detection, the computer obtains the characteristics such as mass center, angle and the like through the whole pixels of the commodity outer package information. If the background where the commodity outer packing information is located is interfered by color, the computer cannot accurately position the commodity outer packing information, so that the positioning accuracy of the commodity outer packing information is reduced, and the acquisition of the position characteristics of the commodity outer packing information is affected. Meanwhile, when character extraction and recognition are carried out on partial commodity images, problems of light reflection, small printed characters, professional vocabulary and the like caused by commodity materials are solved, so that the recognition error rate of commodity external package information is high.
Disclosure of Invention
The invention provides a commodity outer package information detection method, a commodity outer package information detection device, electronic equipment and a storage medium, which are used for solving the defects that the commodity outer package information positioning precision is low and the commodity outer package information identification error rate is high when commodity outer package information is detected in the prior art.
In a first aspect, the present invention provides a method for detecting information on a commodity outer package, including:
acquiring an image of a target commodity, and preprocessing the image of the target commodity to obtain a commodity image to be detected;
performing text region detection on the commodity image to be detected to obtain a text region image of the commodity image to be detected;
carrying out commodity type identification on the commodity image to be detected to obtain the type of the target commodity;
and carrying out text recognition on the text region image by utilizing a word stock corresponding to the type of the target commodity to obtain the outer package information of the target commodity.
In some embodiments, the preprocessing the image of the target commodity to obtain an image of the commodity to be detected includes:
and performing exposure correction, distortion correction and image restoration processing on the image of the target commodity to obtain a commodity image to be detected.
In some embodiments, the text region detection of the to-be-detected commodity image to obtain a text region image of the to-be-detected commodity image includes:
text positioning is carried out on the commodity image to be detected, the region containing the text in the commodity image to be detected is determined, the commodity image to be detected is segmented, and the effective region containing the text is extracted;
and determining the outline of the effective text-containing area, and surrounding the outline by using an external minimum polygon to obtain a text area image of the commodity image to be detected.
In some embodiments, the identifying the commodity type of the commodity image to be detected to obtain the type of the target commodity includes:
inputting the commodity image to be detected into a commodity type detection model, and obtaining the type of the target commodity output by the commodity type detection model;
the commodity type detection model is obtained through training based on a commodity image sample and commodity type labels corresponding to the commodity image sample.
In some embodiments, the method further comprises:
training to obtain a word stock set, wherein the word stock set comprises word stocks corresponding to various commodity types;
and matching and acquiring a word stock corresponding to the type of the target commodity from the word stock set based on the type of the target commodity.
In some embodiments, the training results in a word stock set comprising:
constructing a training sample set, wherein the training sample set comprises training samples of various commodity types;
training a standard word stock by utilizing training samples of all target commodity types, and obtaining a word stock corresponding to the target commodity types after training is finished; the target commodity type is any commodity type of the plurality of commodity types.
In a second aspect, the present invention provides a commodity exterior package information detection apparatus, comprising:
the preprocessing unit is used for acquiring an image of a target commodity, preprocessing the image of the target commodity and obtaining a commodity image to be detected;
the text region detection unit is used for detecting text regions of the commodity image to be detected to obtain a text region image of the commodity image to be detected;
the type identification unit is used for carrying out commodity type identification on the commodity image to be detected to obtain the type of the target commodity;
and the text recognition unit is used for carrying out text recognition on the text region image by utilizing the word stock corresponding to the type of the target commodity to obtain the outer package information of the target commodity.
In some embodiments, the apparatus further comprises:
the word stock training unit is used for training to obtain a word stock set, wherein the word stock set comprises word stocks corresponding to various commodity types;
and the word stock matching unit is used for matching and acquiring the word stock corresponding to the type of the target commodity from the word stock set based on the type of the target commodity.
In a third aspect, the present invention provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the method for detecting information on wrapping information of goods according to any one of the first aspects when executing the program.
In a fourth aspect, the present invention provides a non-transitory computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the merchandise overwrap information detection method of any one of the first aspects.
In a fifth aspect, the present invention also provides a computer program product comprising a computer program which, when executed by a processor, implements the method for detecting merchandise overwrap information according to any one of the first aspects.
According to the commodity outer packing information detection method, the device, the electronic equipment and the storage medium, the image of the target commodity is obtained, the image of the target commodity is preprocessed, the image of the commodity to be detected is obtained, then the text region of the image of the commodity to be detected is detected, the text region image of the commodity to be detected is obtained, the text region can be effectively identified, the positioning precision of commodity outer packing information is improved, the type of the target commodity is further identified, the type of the target commodity is determined, then the text recognition is carried out on the text region image by utilizing the word stock corresponding to the type of the target commodity, and as the word stock is the word stock matched with the type of the target commodity, the outer packing information of the target commodity can be more accurately identified, and the identification accuracy of the commodity outer packing information can be effectively improved.
Drawings
In order to more clearly illustrate the invention or the technical solutions of the prior art, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are some embodiments of the invention, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic flow chart of a method for detecting information of package information of a commodity according to an embodiment of the present invention;
FIG. 2 is a second flow chart of a method for detecting information of package information of a commodity according to an embodiment of the present invention;
FIG. 3 is a third flow chart of a method for detecting information of package information of a commodity according to an embodiment of the present invention;
FIG. 4 is a flow chart of a method for detecting package information of a commodity according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a commodity outer package information detecting apparatus according to an embodiment of the present invention;
fig. 6 is a schematic physical structure of an electronic device according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
In the prior art, when detecting the commodity outer packing information, the defects of low text positioning precision and high commodity outer packing information identification error rate exist, and in order to solve or partially solve the problems in the prior art, the invention provides a commodity outer packing information detection method, a commodity outer packing information detection device, electronic equipment and a storage medium.
The main body of execution of the commodity outer package information detection method provided by the invention can be a commodity outer package information detection device which can be realized by software and/or hardware, and the device can be integrated in electronic equipment, and the electronic equipment can be mobile electronic equipment or non-mobile electronic equipment. By way of example, the mobile electronic device may be a cell phone, tablet, notebook, palmtop, ultra-mobile personal computer (ultra-mobile personal computer, UMPC), netbook or personal digital assistant (personal digital assistant, PDA), etc., and the non-mobile electronic device may be a server, network attached storage (Network Attached Storage, NAS) or personal computer (personal computer, PC), etc., the invention is not particularly limited.
The present invention will be described below with reference to fig. 1 to 6 by taking an example in which the execution subject is a commodity exterior package information detecting device.
Fig. 1 is a schematic flow chart of a method for detecting information of package information of a commodity according to an embodiment of the present invention. As shown in fig. 1, the method comprises the steps of: step 110, step 120, step 130 and step 140. The method flow steps are only one possible implementation of the invention.
Step 110, acquiring an image of a target commodity, and preprocessing the image of the target commodity to obtain a commodity image to be detected;
alternatively, the image of the target commodity may be captured by an image capturing apparatus, which may be a mobile phone, a digital camera, or other similar device, or the image of the target commodity may be recalled from a database.
Alternatively, the image format of the target commodity may be jpg, png, rgb format, or other image format.
The embodiment of the invention does not limit the specific mode and the image format for acquiring the image of the target commodity.
It can be understood that the quality of the digital image is a key point affecting the information extraction effect in the image, however, in the image acquisition process of the target commodity, some situations may occur, so that the quality of the image is poor, for example, the shooting angle is askew, the illumination of the shooting environment is uneven, the commodity packaging material reflects light, and the like, which easily causes the loss of the key information of the commodity.
In order to solve the problems, the method is based on analysis of problems such as scene ambient light, commodity materials and shooting angles, and the like, and obtains the commodity image to be detected by preprocessing the obtained image of the target commodity so as to improve the quality of the commodity image to be detected and prepare for identification of the external package information of the subsequent commodity.
Optionally, preprocessing the image of the target commodity to obtain an image of the commodity to be detected, including:
and performing exposure correction, distortion correction and image restoration processing on the image of the target commodity to obtain a commodity image to be detected.
The exposure correction means that overexposure and underexposure of an image are corrected by using a digital image processing technology. Light enters from the lens to make the negative film or the photosensitive element sensitive to form an image, the process is called exposure, the brightness of the image reaches normal or the requirement of a photographer is that the exposure is normal, the brightness is overexposure, and the darkness is underexposure.
Distortion correction refers to the correction of an image by signal processing errors caused by lens distortion using digital image processing techniques. The image imaging process is actually a process of converting points of a world coordinate system into an image sensor coordinate system, projecting to obtain an image coordinate system, and further converting the image coordinate system into a pixel coordinate system. Distortion is introduced by lens accuracy and technology, and by distortion, a straight line in a world coordinate system of a picture or an object is converted into other coordinate systems and displayed as a curve, so that the distortion is caused. Therefore, in order to improve the quality of an image, it is necessary to correct distortion of the image.
Image restoration refers to restoration and reconstruction of a damaged image by using a digital image processing technology, and lost information is restored through the existing information of the image. The method can be used for recovering lost information in old photos, removing video characters, hiding video errors and the like. In short, image restoration is a process of filling information into an information defect area on an image, and aims to restore the image with the information defect to restore the original state of the image.
For example, when the acquired image of the target commodity is a commodity packaging image with light spot shielding, the highlight removing operation needs to be performed in steps. First, determining the removal sequence, and determining the priority of the repair area by using a weight function. Searching the texture similarity, searching the best matching block in the area to be repaired, copying the best matching block to the corresponding target area position, updating the boundary of the target area and the corresponding weight value, and repeating the steps until the removal is completed. And (3) carrying out image restoration processing on the obtained image of the target commodity to obtain an image of the commodity to be detected, so that the image recognition rate of the commodity to be detected can be improved.
Step 120, performing text region detection on the commodity image to be detected to obtain a text region image of the commodity image to be detected;
optionally, the commodity image to be measured includes a text area and a non-text area, wherein the text area includes but is not limited to at least one of the following text information: the name of the commodity, the date of production, the expiration date, the method of use, the commodity identification code, etc.
In some embodiments, inputting the commodity image to be detected into a text detection model to detect the text region of the commodity image to be detected, and obtaining an output result of the text detection model to obtain the text region image of the commodity image to be detected.
Wherein the text detection model has the capabilities of text localization and text segmentation.
The text detection model may adopt a Neural Network (NNS), a Long Short-Term Memory (LSTM), a deep Neural Network (Deep Neural Networks, DNN), a full convolution Neural Network (Fully Convolutional Neuron Networks, FCN), a Residual Network (res net), a feature pyramid Network, a mask sub-Network, a parallel classification sub-Network, a regression sub-Network, and the like to perform text detection on the commodity image, which is not limited in the present invention.
Optionally, the text detection model may be trained based on a commodity image sample and a text region label corresponding to the commodity image sample.
In other embodiments, the image of the commodity to be detected is input into a text positioning model to perform text region positioning on the image of the commodity to be detected, and an output result of the text positioning network is obtained, so that the position information of the region containing the text in the image of the commodity to be detected is obtained.
The text region positioning model may adopt Neural Networks (NNS), a Long Short-Term Memory (LSTM), a deep Neural Network (Deep Neural Networks, DNN), a full convolution Neural Network (Fully Convolutional Neuron Networks, FCN), a Residual Network (res net), a feature pyramid Network, and the like to position the text region of the commodity image, which is not limited in the present invention.
Optionally, the text region positioning model may be obtained by training based on the commodity image sample and a position tag corresponding to the text region in the commodity image sample.
Further, based on the position information of the region containing the text in the commodity image to be detected, inputting the commodity image to be detected into a text segmentation model for text segmentation, thereby obtaining a text region image of the commodity image to be detected.
The text segmentation model can adopt a mask sub-network, a parallel classification sub-network, a regression sub-network and the like to carry out text segmentation on the commodity image, and the invention is not limited to the above.
Alternatively, the text segmentation model may be obtained by training based on the commodity image sample, the location information of the text-containing region in the commodity image sample, and the text region label corresponding to the commodity image sample.
According to the invention, the text region detection is carried out on the commodity image to be detected, so that the text region image of the commodity image to be detected is obtained, and compared with the detection of commodity outer package information by adopting a color positioning algorithm in the prior art, the text region can be effectively identified, and the text positioning precision is improved.
130, identifying the commodity type of the commodity image to be detected to obtain the type of the target commodity;
and carrying out commodity type identification on the commodity image to be detected, and determining a word stock corresponding to the type of the target commodity.
In the implementation, the type of the target commodity is obtained by identifying the commodity type, and a word stock corresponding to the type of the target commodity can be determined later based on the type of the target commodity.
Optionally, the identifying the commodity type of the commodity image to be detected to obtain the type of the target commodity includes:
inputting the commodity image to be detected into a commodity type detection model, and obtaining the type of the target commodity output by the commodity type detection model;
the commodity type detection model is obtained through training based on a commodity image sample and commodity type labels corresponding to the commodity image sample.
The commodity type detection model may identify the commodity type by using a Neural Network (NNS), a Long Short-Term Memory (LSTM), a deep Neural Network (Deep Neural Networks, DNN), a full convolution Neural Network (Fully Convolutional Neuron Networks, FCN), a Residual Network (res net), a feature pyramid Network, and the like, which is not limited in the present invention.
It can be understood that the commodity type detection model is used for detecting the commodity type, inputting the commodity image to be detected, and outputting the commodity image to be detected as the type of the target commodity.
And 140, performing text recognition on the text region image by using a word stock corresponding to the type of the target commodity to obtain the outer package information of the target commodity.
The word stock is a collection library of foreign fonts, chinese fonts and electronic text fonts of related characters, and is widely applied to computers, networks and related electronic products.
It can be understood that each commodity has specificity based on the characteristics of the commodity, so that word stock training is performed on different commodity types, one-to-one correspondence is established between commodity types and word stock, and the word stock corresponding to the type of the target commodity is obtained.
When the commodity outer packing information is detected, the word stock corresponding to the type of the target commodity can be rapidly determined by identifying the commodity type, and the text region image is subjected to text identification by utilizing the word stock corresponding to the type of the target commodity, so that the identification accuracy of the commodity outer packing information can be improved.
Optionally, the character library corresponding to the type of the target commodity is utilized, a projection method is utilized to segment characters in the text region image, the text region image is subjected to text recognition by researching a printing body number recognition algorithm and adopting an optical character recognition (Optical Character Recognition, OCR) technology, target text information in the text region image is extracted, and jpg, png, txt files or other format files are generated, so that the outer package information of the target commodity is obtained, and the recognition accuracy of the outer package information of the commodity can be improved.
In the embodiment of the invention, the image of the target commodity is obtained, the image of the target commodity is preprocessed to obtain the image of the commodity to be detected, then the text region of the image of the commodity to be detected is detected to obtain the text region image of the commodity to be detected, the text region can be effectively identified, the text positioning precision is improved, and further, the type of the target commodity is obtained by identifying the commodity type of the image of the commodity to be detected; and then, text recognition is carried out on the text region image by utilizing a word stock corresponding to the type of the target commodity, so that the outer package information of the target commodity is obtained, and the recognition accuracy of the outer package information of the commodity can be improved.
In some embodiments, fig. 2 is a second flowchart of a method for detecting information on an outer package of a commodity according to an embodiment of the present invention, as shown in fig. 2, in step 120, text region detection is performed on the image of the commodity to be detected, to obtain a text region image of the commodity to be detected, including:
step 210, text positioning is carried out on the commodity image to be detected, a region containing text in the commodity image to be detected is determined, the commodity image to be detected is segmented, and an effective region containing text is extracted;
and 220, determining the outline of the effective text-containing area, and surrounding the outline by using an external minimum polygon to obtain a text area image of the commodity image to be detected.
Optionally, the image enhancement restoration technology based on Opencv is used for weakening the noise of the restored image, then the ROI is used for carrying out text positioning on the commodity image to be detected, determining the region containing the text in the commodity image to be detected, and dividing the commodity image to be detected to extract the effective region containing the text.
Further, extracting, analyzing and processing the extracted effective text-containing region, searching and drawing the outline in the image region, surrounding the outline by using an external minimum polygon, and accurately positioning the text-containing regions at a plurality of different positions to obtain the text region image of the commodity image to be detected.
In the embodiment of the invention, the text region image of the commodity image to be detected is obtained by carrying out text positioning on the commodity image to be detected, determining the region containing the text in the commodity image to be detected, dividing the commodity image to be detected, extracting the effective region containing the text, determining the outline of the effective region containing the text, surrounding the outline by using the circumscribed minimum polygon, and accurately positioning the text region in the commodity image to be detected and improving the text positioning precision.
In some embodiments, fig. 3 is a third flowchart of a method for detecting information on a package of a commodity according to an embodiment of the present invention, as shown in fig. 3, where the method further includes:
step 310, training to obtain a word stock set, wherein the word stock set comprises word stock corresponding to various commodity types;
step 320, based on the type of the target commodity, matching and obtaining a word stock corresponding to the type of the target commodity from the word stock set.
In specific implementation, word stock training is performed on the description information of the specific commodity to obtain word stock corresponding to the specific commodity, and the word stock corresponding to the specific commodity is gathered together to form a word stock set, namely the word stock set comprises word stocks corresponding to the commodity types.
Based on the type of the target commodity, matching and obtaining the word stock corresponding to the type of the target commodity from the word stock set can improve the identification accuracy of the word information.
Optionally, the word stock training is not required every time when the description information of the specific commodity is used, and when the commodity is printed with clear fonts, high image quality or no special vocabulary, the Tesseact original word stock can be accurately identified, and the word stock training is not required.
In the embodiment of the invention, the word stock set is obtained through training, the word stock set comprises word stocks corresponding to various commodity types, the word stocks corresponding to the types of the target commodity are matched and obtained from the word stock set based on the types of the target commodity, and the word stock training method is fused in the commodity outer package information detection method, so that the recognition accuracy of the commodity outer package information can be improved.
In some embodiments, fig. 4 is a flowchart illustrating a method for detecting information on a package of a commodity according to an embodiment of the present invention, as shown in fig. 4, where training in step 310 includes:
step 410, constructing a training sample set, wherein the training sample set comprises training samples of various commodity types;
step 420, training a standard word stock by using training samples of all target commodity types, and obtaining a word stock corresponding to the target commodity types after training is finished; the target commodity type is any commodity type of the plurality of commodity types.
In the embodiment of the invention, the training process of the word stock set is described, the training sample set is constructed, the training sample set comprises training samples of various commodity types, the standard word stock is trained by utilizing the training samples of all target commodity types, after the training is finished, the word stock corresponding to the target commodity type is obtained, and the target commodity type is any commodity type in the various commodity types.
The present invention will be described below with reference to the provision of a commodity exterior information detecting apparatus, and the commodity exterior information detecting apparatus described below and the commodity exterior information detecting apparatus described above may be referred to in correspondence with each other.
Fig. 5 is a schematic structural diagram of a commodity exterior information detection apparatus according to an embodiment of the present invention, and as shown in fig. 5, the commodity exterior information detection apparatus 500 includes:
the preprocessing unit 510 is configured to obtain an image of a target commodity, and perform preprocessing on the image of the target commodity to obtain a commodity image to be detected;
the text region detection unit 520 is configured to perform text region detection on the to-be-detected commodity image, so as to obtain a text region image of the to-be-detected commodity image;
a type identifying unit 530, configured to identify a type of the commodity in the image of the commodity to be detected, so as to obtain a type of the target commodity;
the text recognition unit 540 is configured to perform text recognition on the text region image by using a word stock corresponding to the type of the target commodity, so as to obtain the outer package information of the target commodity.
In some embodiments, the preprocessing the image of the target commodity to obtain an image of the commodity to be detected includes:
and performing exposure correction, distortion correction and image restoration processing on the image of the target commodity to obtain a commodity image to be detected.
In some embodiments, the text region detection of the to-be-detected commodity image to obtain a text region image of the to-be-detected commodity image includes:
text positioning is carried out on the commodity image to be detected, the region containing the text in the commodity image to be detected is determined, the commodity image to be detected is segmented, and the effective region containing the text is extracted;
and determining the outline of the effective text-containing area, and surrounding the outline by using an external minimum polygon to obtain a text area image of the commodity image to be detected.
In some embodiments, the identifying the commodity type of the commodity image to be detected to obtain the type of the target commodity includes:
inputting the commodity image to be detected into a commodity type detection model, and obtaining the type of the target commodity output by the commodity type detection model;
the commodity type detection model is obtained through training based on a commodity image sample and commodity type labels corresponding to the commodity image sample.
In some embodiments, the apparatus further comprises:
the word stock training unit is used for training to obtain a word stock set, wherein the word stock set comprises word stocks corresponding to various commodity types;
and the word stock matching unit is used for matching and acquiring the word stock corresponding to the type of the target commodity from the word stock set based on the type of the target commodity.
In some embodiments, the training process of the word stock training unit includes:
constructing a training sample set, wherein the training sample set comprises training samples of various commodity types;
training a standard word stock by utilizing training samples of all target commodity types, and obtaining a word stock corresponding to the target commodity types after training is finished; the target commodity type is any commodity type of the plurality of commodity types.
It should be noted that, the apparatus for detecting information on outer package of commodity according to the embodiment of the present invention can implement all the method steps implemented by the embodiment of the method for detecting information on outer package of commodity, and can achieve the same technical effects, and detailed descriptions of the same parts and beneficial effects as those of the embodiment of the method in this embodiment are omitted.
Fig. 6 is a schematic physical structure of an electronic device according to an embodiment of the present invention, as shown in fig. 6, the electronic device may include: processor 610, communication interface (Communications Interface) 620, memory 630, and communication bus 640, wherein processor 610, communication interface 620, and memory 630 communicate with each other via communication bus 640. The processor 610 may invoke logic instructions in the memory 630 to perform a merchandise overwrap information detection method comprising: acquiring an image of a target commodity, and preprocessing the image of the target commodity to obtain a commodity image to be detected; performing text region detection on the commodity image to be detected to obtain a text region image of the commodity image to be detected; carrying out commodity type identification on the commodity image to be detected to obtain the type of the target commodity; and carrying out text recognition on the text region image by utilizing a word stock corresponding to the type of the target commodity to obtain the outer package information of the target commodity.
Further, the logic instructions in the memory 630 may be implemented in the form of software functional units and stored in a computer-readable storage medium when sold or used as a stand-alone product. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In another aspect, the present invention also provides a computer program product, where the computer program product includes a computer program, where the computer program can be stored on a non-transitory computer readable storage medium, and when the computer program is executed by a processor, the computer can execute the method for detecting the package information of the commodity provided by the above methods, and the method includes: acquiring an image of a target commodity, and preprocessing the image of the target commodity to obtain a commodity image to be detected; performing text region detection on the commodity image to be detected to obtain a text region image of the commodity image to be detected; carrying out commodity type identification on the commodity image to be detected to obtain the type of the target commodity; and carrying out text recognition on the text region image by utilizing a word stock corresponding to the type of the target commodity to obtain the outer package information of the target commodity.
In yet another aspect, the present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, is implemented to perform the method for detecting package information of goods provided by the above methods, the method comprising: acquiring an image of a target commodity, and preprocessing the image of the target commodity to obtain a commodity image to be detected; performing text region detection on the commodity image to be detected to obtain a text region image of the commodity image to be detected; carrying out commodity type identification on the commodity image to be detected to obtain the type of the target commodity; and carrying out text recognition on the text region image by utilizing a word stock corresponding to the type of the target commodity to obtain the outer package information of the target commodity.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on this understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the respective embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (10)

1. A method for detecting information on a commodity outer package, comprising:
acquiring an image of a target commodity, and preprocessing the image of the target commodity to obtain a commodity image to be detected;
performing text region detection on the commodity image to be detected to obtain a text region image of the commodity image to be detected;
carrying out commodity type identification on the commodity image to be detected to obtain the type of the target commodity;
and carrying out text recognition on the text region image by utilizing a word stock corresponding to the type of the target commodity to obtain the outer package information of the target commodity.
2. The method for detecting information on a commodity exterior according to claim 1, wherein said preprocessing the image of the target commodity to obtain an image of the commodity to be detected comprises:
and performing exposure correction, distortion correction and image restoration processing on the image of the target commodity to obtain a commodity image to be detected.
3. The method for detecting information on a package of a commodity according to claim 1, wherein said performing text region detection on said commodity image to be detected to obtain a text region image of said commodity image to be detected comprises:
text positioning is carried out on the commodity image to be detected, the region containing the text in the commodity image to be detected is determined, the commodity image to be detected is segmented, and the effective region containing the text is extracted;
and determining the outline of the effective text-containing area, and surrounding the outline by using an external minimum polygon to obtain a text area image of the commodity image to be detected.
4. The method for detecting information on a commodity exterior according to claim 1, wherein said performing commodity type identification on said commodity image to be detected to obtain the type of said target commodity comprises:
inputting the commodity image to be detected into a commodity type detection model, and obtaining the type of the target commodity output by the commodity type detection model;
the commodity type detection model is obtained through training based on a commodity image sample and commodity type labels corresponding to the commodity image sample.
5. The commodity exterior information detection method according to claim 1, wherein said method further comprises:
training to obtain a word stock set, wherein the word stock set comprises word stocks corresponding to various commodity types;
and matching and acquiring a word stock corresponding to the type of the target commodity from the word stock set based on the type of the target commodity.
6. The method for detecting information on a commodity outer package according to claim 5, wherein said training results in a word stock set comprising:
constructing a training sample set, wherein the training sample set comprises training samples of various commodity types;
training a standard word stock by utilizing training samples of all target commodity types, and obtaining a word stock corresponding to the target commodity types after training is finished; the target commodity type is any commodity type of the plurality of commodity types.
7. A commodity exterior package information detection device, comprising:
the preprocessing unit is used for acquiring an image of a target commodity, preprocessing the image of the target commodity and obtaining a commodity image to be detected;
the text region detection unit is used for detecting text regions of the commodity image to be detected to obtain a text region image of the commodity image to be detected;
the type identification unit is used for carrying out commodity type identification on the commodity image to be detected to obtain the type of the target commodity;
and the text recognition unit is used for carrying out text recognition on the text region image by utilizing the word stock corresponding to the type of the target commodity to obtain the outer package information of the target commodity.
8. The apparatus for detecting information on a commodity outer package according to claim 7, wherein said apparatus further comprises:
the word stock training unit is used for training to obtain a word stock set, wherein the word stock set comprises word stocks corresponding to various commodity types;
and the word stock matching unit is used for matching and acquiring the word stock corresponding to the type of the target commodity from the word stock set based on the type of the target commodity.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method for detecting the package information of a commodity according to any one of claims 1 to 6 when the program is executed by the processor.
10. A non-transitory computer-readable storage medium having stored thereon a computer program, wherein the computer program when executed by a processor implements the commodity overwrap information detection method according to any one of claims 1 to 6.
CN202310409393.0A 2023-04-14 2023-04-14 Commodity outer package information detection method, commodity outer package information detection device, electronic equipment and storage medium Pending CN116597431A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310409393.0A CN116597431A (en) 2023-04-14 2023-04-14 Commodity outer package information detection method, commodity outer package information detection device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310409393.0A CN116597431A (en) 2023-04-14 2023-04-14 Commodity outer package information detection method, commodity outer package information detection device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116597431A true CN116597431A (en) 2023-08-15

Family

ID=87603518

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310409393.0A Pending CN116597431A (en) 2023-04-14 2023-04-14 Commodity outer package information detection method, commodity outer package information detection device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116597431A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118135552A (en) * 2024-05-06 2024-06-04 深圳市力生视觉智能科技有限公司 Method, device, equipment and storage medium for identifying non-tag commodity information

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118135552A (en) * 2024-05-06 2024-06-04 深圳市力生视觉智能科技有限公司 Method, device, equipment and storage medium for identifying non-tag commodity information

Similar Documents

Publication Publication Date Title
CN111369545B (en) Edge defect detection method, device, model, equipment and readable storage medium
CN110827247B (en) Label identification method and device
TWI744283B (en) Method and device for word segmentation
CN111681273B (en) Image segmentation method and device, electronic equipment and readable storage medium
CN110647829A (en) Bill text recognition method and system
CN111680690B (en) Character recognition method and device
US20200134382A1 (en) Neural network training utilizing specialized loss functions
CN112070649B (en) Method and system for removing specific character string watermark
CN113505781B (en) Target detection method, target detection device, electronic equipment and readable storage medium
CN112434690A (en) Method, system and storage medium for automatically capturing and understanding elements of dynamically analyzing text image characteristic phenomena
CN110942456B (en) Tamper image detection method, device, equipment and storage medium
CN112101386B (en) Text detection method, device, computer equipment and storage medium
CN111340796A (en) Defect detection method and device, electronic equipment and storage medium
CN112001200A (en) Identification code identification method, device, equipment, storage medium and system
CN116597431A (en) Commodity outer package information detection method, commodity outer package information detection device, electronic equipment and storage medium
CN114723677A (en) Image defect detection method, image defect detection device, image defect detection equipment and storage medium
CN114429636A (en) Image scanning identification method and device and electronic equipment
Suh et al. Fusion of global-local features for image quality inspection of shipping label
CN108664906B (en) Method for detecting content in fire scene based on convolutional network
CN114445841A (en) Tax return form recognition method and device
US20230245483A1 (en) Handwriting recognition method and apparatus, and electronic device and storage medium
CN112396594A (en) Change detection model acquisition method and device, change detection method, computer device and readable storage medium
CN117115823A (en) Tamper identification method and device, computer equipment and storage medium
CN110210314B (en) Face detection method, device, computer equipment and storage medium
CN114581911B (en) Steel coil label identification method and system

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