[go: up one dir, main page]

CN102184405B - Image Acquisition and Analysis Method - Google Patents

Image Acquisition and Analysis Method Download PDF

Info

Publication number
CN102184405B
CN102184405B CN201110098035.XA CN201110098035A CN102184405B CN 102184405 B CN102184405 B CN 102184405B CN 201110098035 A CN201110098035 A CN 201110098035A CN 102184405 B CN102184405 B CN 102184405B
Authority
CN
China
Prior art keywords
color
commodity
image
characteristic
local
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.)
Expired - Fee Related
Application number
CN201110098035.XA
Other languages
Chinese (zh)
Other versions
CN102184405A (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.)
Tsinghua University
Original Assignee
Tsinghua University
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 Tsinghua University filed Critical Tsinghua University
Priority to CN201110098035.XA priority Critical patent/CN102184405B/en
Publication of CN102184405A publication Critical patent/CN102184405A/en
Application granted granted Critical
Publication of CN102184405B publication Critical patent/CN102184405B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Analysis (AREA)

Abstract

本发明涉及图像处理技术领域,具体公开了一种图像采集分析方法,包括:步骤1.制作若干个标尺并将其摆放在每行超市货架上,所述标尺上具有若干组编码;步骤2.采集摆放有所述标尺的货架的图像;步骤3.对采集到的所述图像分离色彩通道,在分离后的各个通道上检测标尺的编码;步骤4.根据对所述编码的检测结果对图像进行校正;步骤5.根据对所述编码的检测结果在校正后的图像上分割出图像中包含商品的区域;步骤6.在所述区域上利用颜色特征和局部纹理特征对商品进行分类,进而得到商品摆放的相关信息。本发明能够高效、准确的得到商品在货架上的摆放位置、数量等信息。而且本方法简便易行,节省大量人力物力。

Figure 201110098035

The present invention relates to the technical field of image processing, and specifically discloses an image acquisition and analysis method, comprising: Step 1. Making several scales and placing them on each row of supermarket shelves, the scales have several groups of codes; Step 2 .Collect the image of the shelf with the scale; step 3. separate the color channels for the collected image, and detect the code of the scale on each channel after separation; step 4. according to the detection result of the code Correct the image; Step 5. Segment the region containing the commodity in the image on the corrected image according to the detection result of the code; Step 6. Use the color feature and local texture feature to classify the commodity in the region , and then get the relevant information about the product placement. The invention can efficiently and accurately obtain information such as the placement position and quantity of commodities on the shelf. Moreover, the method is simple and easy, and saves a lot of manpower and material resources.

Figure 201110098035

Description

图像采集分析方法Image Acquisition and Analysis Method

技术领域 technical field

本发明涉及图像处理技术领域,特别涉及一种对采集的图像进行分析并得到商品在货架上的摆放信息的方法。The invention relates to the technical field of image processing, in particular to a method for analyzing collected images and obtaining information on placing commodities on shelves.

背景技术 Background technique

随着零售业的发展,超市已经成为大众商品的主要销售渠道。掌握商品在超市中的摆放情况有利于商品生产厂家随时把握市场动向并及时调整营销策略。目前,商品生产厂家获得商品摆放信息的途径主要是派遣工作人员到超市实地调查。被派遣的工作人员到达超市后通过目测和人工计数的方式对商品是否摆放整齐、摆放数量的多少进行统计。这种人工去现场测量的方法存在如下问题。首先,厂家需要派遣大量工作人员前往不同的销售点进行调查,效率低下;其次,目测和人工计数的方式并不准确,工作人员很难在短时间内数清某种商品的数量,同时准确评价商品摆放的整齐程度,主观性因素太强;再次,该方法采集到的数据其真实性无法保证,工作人员的疏忽大意会导致数据不准确,甚至会出现故意伪造数据的情况。总而言之,目前的方法需要投入大量人力物力成本但又不能得到准确的结果。With the development of the retail industry, supermarkets have become the main sales channel for mass commodities. Mastering the placement of commodities in supermarkets is helpful for commodity manufacturers to keep abreast of market trends and adjust marketing strategies in a timely manner. At present, the main way for commodity manufacturers to obtain commodity placement information is to send staff to conduct on-the-spot investigations in supermarkets. After the dispatched staff arrive at the supermarket, they will make statistics on whether the goods are neatly placed and the number of goods placed by visual inspection and manual counting. There are following problems in the method of manual on-site measurement. First of all, the manufacturer needs to send a large number of staff to different sales points for investigation, which is inefficient; second, the methods of visual inspection and manual counting are not accurate, and it is difficult for the staff to count the quantity of a certain product in a short period of time and accurately evaluate it at the same time. The orderliness of the goods is too subjective; again, the authenticity of the data collected by this method cannot be guaranteed, and the negligence of the staff will lead to inaccurate data, and even intentional falsification of data. All in all, the current method needs to invest a lot of manpower and material resources but cannot get accurate results.

利用计算机作为辅助工具进行商品信息统计可以在提高效率的同时保证统计结果的准确率。目前与之相关的方法包括模式识别中的目标检测和目标分类方法。这类方法首先采集超市货架图像,然后通过目标检测找到超市货架上的商品,接下来利用目标分类的方法将检测到的商品分到其所属类别,最后统计各个类别商品的数量。这类方法也存在一些缺陷。首先,其无法处理重复模式的情况,对于超市货架而言,同一类商品往往会摆放多件,这类方法通常只能判断检测到的某个商品是什么类别,但无法判断检测到的同一类别的商品是不是货架上的同一件商品,这样在统计时可能造成重复计数;其次,这类方法通常对光照条件要求较高,而不同超市的光照条件差别很大,导致这类方法不能完全推广。总的来说,即使利用了计算机,现有的方法还是不能够在高效率的同时保证准确率。The use of computer as an auxiliary tool for commodity information statistics can improve efficiency and ensure the accuracy of statistical results. Current related methods include object detection and object classification methods in pattern recognition. This type of method first collects supermarket shelf images, then finds the products on the supermarket shelves through target detection, then uses the method of target classification to classify the detected products into their categories, and finally counts the number of products in each category. This method also has some drawbacks. First of all, it cannot handle the situation of repeated patterns. For supermarket shelves, there are often multiple items of the same type of product. This type of method can usually only judge the type of a detected product, but cannot judge the same type of product detected. Whether the products in the category are the same product on the shelf, this may cause double counting during statistics; secondly, this type of method usually has high requirements on lighting conditions, and the lighting conditions of different supermarkets vary greatly, which makes this type of method not fully accurate. promote. In general, even with the use of computers, existing methods cannot guarantee accuracy while being highly efficient.

发明内容 Contents of the invention

(一)要解决的技术问题(1) Technical problems to be solved

本发明要解决的技术问题是如何能够高效准确的对拍摄的超市货架图像进行识别和分析,进而得到货架上商品的数量类别等信息。The technical problem to be solved by the present invention is how to efficiently and accurately identify and analyze captured images of supermarket shelves, and then obtain information such as the quantity and category of commodities on the shelves.

(二)技术方案(2) Technical solution

为了解决上述技术问题,本发明提供了一种图像采集分析方法,包括:In order to solve the above technical problems, the present invention provides an image acquisition and analysis method, comprising:

步骤1、制作若干个标尺并将其摆放在每行超市货架上,所述标尺上具有若干组编码;Step 1, making several scales and placing them on each row of supermarket shelves, the scales have several groups of codes;

步骤2、采集摆放有所述标尺的货架的图像;Step 2, collecting the image of the shelf with the ruler;

步骤3、对采集到的所述图像分离色彩通道,在分离后的各个通道上检测标尺的编码;Step 3, separating the color channels of the collected image, and detecting the coding of the scale on each separated channel;

步骤4、根据对所述编码的检测结果对图像进行校正;Step 4, correcting the image according to the detection result of the encoding;

步骤5、根据对所述编码的检测结果在校正后的图像上分割出图像中包含商品的区域;Step 5. Segment the region containing the commodity in the image on the corrected image according to the detection result of the code;

步骤6、在所述区域上利用颜色特征和局部纹理特征对商品进行分类,进而得到商品摆放的相关信息。Step 6: Classify the commodities by using the color features and local texture features in the area, and then obtain the relevant information about the placement of the commodities.

其中,所述编码由数字和二维码组成。Wherein, the code is composed of numbers and two-dimensional codes.

进一步地,所述二维码为彩色二维码,所述数字和彩色二维码一一对应,且各组编码都不相同。Further, the two-dimensional code is a colored two-dimensional code, the numbers correspond to the colored two-dimensional code one by one, and each group of codes is different.

在进一步地技术方案中,所述步骤3包括:In a further technical solution, said step 3 includes:

将所述图像分离色彩通道,在分离后的各个通道上利用模板匹配的方法检测数字和二维码,同时利用数字和二维码之间的一一对应关系进行交叉验证,最终得到所述标尺在图像平面的坐标。Separate the image into color channels, use template matching to detect numbers and two-dimensional codes on each separated channel, and use the one-to-one correspondence between numbers and two-dimensional codes to perform cross-validation, and finally obtain the scale Coordinates in the image plane.

在进一步地技术方案中,所述步骤4的校正包括色彩校正和畸变校正。In a further technical solution, the correction in step 4 includes color correction and distortion correction.

所述色彩校正包括分别对各个通道的色彩值求线性变换,通过所述线性变换将二维码所在区域的亮度和对比度归一化成事先设定的常数,将所述线性变换应用到整幅图像即完成了色彩校正。The color correction includes linear transformation of the color values of each channel, normalizing the brightness and contrast of the area where the two-dimensional code is located to a preset constant through the linear transformation, and applying the linear transformation to the entire image The color correction is now complete.

所述畸变校正包括对整个图像求二维仿射变换矩阵,将所述标尺在图像中的形状调整为水平直线。The distortion correction includes finding a two-dimensional affine transformation matrix for the entire image, and adjusting the shape of the scale in the image to be a horizontal straight line.

在进一步地技术方案中,所述步骤5包括:根据所述标尺的坐标、所述标尺和商品摆放区域的相对位置关系分割出图像中包含商品的区域。In a further technical solution, the step 5 includes: segmenting the region containing the commodity in the image according to the coordinates of the scale and the relative positional relationship between the scale and the commodity placement area.

所述步骤6包括:Said step 6 comprises:

在所述区域中统计待分类商品的颜色特征,并与事先制作的颜色列表作对比;Count the color features of the goods to be classified in the area, and compare them with the color list made in advance;

在所述区域中提取待分类商品的局部纹理特征,并与事先制作的纹理列表做对比,得到待分类商品所属的类别。The local texture features of the commodity to be classified are extracted in the region, and compared with the texture list made in advance, to obtain the category to which the commodity to be classified belongs.

其中,在步骤1之前还包括:Among them, before step 1, it also includes:

预先采集若干商品图像作为训练样本,对训练样本进行色彩校正和畸变校正在校正后的图像中统计其颜色出现的频率,求取频率的局部极大值,根据所述局部极大值确定和调整混合高斯模型的个数,利用所述混合高斯模型对统计的颜色出现的频率进行拟合,当某一颜色的高斯分布的中心概率密度大于设定阈值时,该高斯模型对应的颜色为主要颜色,将最后得到的主要颜色组成颜色列表;Pre-collect a number of commodity images as training samples, perform color correction and distortion correction on the training samples, count the frequency of color appearance in the corrected image, find the local maximum value of the frequency, determine and adjust according to the local maximum value The number of mixed Gaussian models, using the mixed Gaussian model to fit the frequency of statistical color appearance, when the central probability density of the Gaussian distribution of a certain color is greater than the set threshold, the color corresponding to the Gaussian model is the main color , compose the final main colors into a color list;

对每一类商品,统计所述颜色列表中各种颜色出现的频率,用统计的频率作为该类商品的颜色特征;For each type of commodity, count the frequency of appearance of each color in the color list, and use the statistical frequency as the color feature of this type of commodity;

对所述训练样本任意取一16*16像素的窗,计算所述窗的局部纹理特征,求得所述局部纹理特征的局部极大值,根据局部极大值确定和调整混合高斯模型的个数,然后利用混合高斯模型对统计的局部纹理特征出现频率进行拟合,如果某一高斯分布的中心概率密度大于事先设定的阈值,则该高斯模型对应的特征为主要局部纹理特征,将其加入局部纹理特征列表,最后得到包含所有商品主要局部特征的局部纹理特征列表。A window of 16*16 pixels is arbitrarily taken for the training sample, the local texture feature of the window is calculated, the local maximum value of the local texture feature is obtained, and the individual of the mixed Gaussian model is determined and adjusted according to the local maximum value. number, and then use the mixed Gaussian model to fit the occurrence frequency of statistical local texture features. If the central probability density of a certain Gaussian distribution is greater than the preset threshold, the corresponding feature of the Gaussian model is the main local texture feature, and its Add the list of local texture features, and finally get the list of local texture features including the main local features of all commodities.

所述在所述区域中统计待分类商品的颜色特征,并与事先制作的颜色列表作对比具体包括:The counting of the color features of the commodities to be classified in the area, and comparing with the pre-made color list specifically includes:

提取所述区域中待分类商品的颜色特征,并与所述颜色列表中的颜色特征进行比较,当所述待分类商品与某类训练样本的颜色特征差值之和最小时,所述待分类商品在颜色特征上属于该类训练样本的类别。Extract the color feature of the product to be classified in the area, and compare it with the color feature in the color list, when the sum of the color feature differences between the product to be classified and a certain type of training sample is the smallest, the product to be classified The product belongs to the category of the training sample in terms of color features.

所述在所述区域中提取待分类商品的局部纹理特征,并与事先制作的局部纹理列表做对比,得到待分类商品所属的类别具体包括:The local texture features of the commodity to be classified are extracted in the region, and compared with the local texture list made in advance, and the category of the commodity to be classified specifically includes:

对根据颜色特征分类之后得到的同一颜色特征下的每两类商品,统计其出现频率差值最大的若干个局部纹理特征,利用所述局部纹理特征出现频率的差异性判断当前商品的准确分类。For every two types of commodities under the same color feature obtained after classification according to the color feature, count several local texture features with the largest difference in frequency of occurrence, and use the difference in frequency of occurrence of the local texture features to judge the accurate classification of the current commodity.

所述步骤6之后还包括:After the step 6, also include:

根据所述步骤6得到的类别结果统计各类商品的数量和在货架上的位置,输出统计结果。According to the category result obtained in step 6, the quantity and the position on the shelf of each type of commodity are counted, and the statistical result is output.

(三)有益效果(3) Beneficial effects

上述技术方案具有如下有益效果:通过用带有数字和二维码的标尺标识商品的摆放信息,并采集有标尺的货架的图像,通过对图像进行校正、分割区域以及颜色统计等处理,能够高效、准确的得到商品的摆放位置、数量等信息。而且本方法简便易行,节省大量人力物力。The above technical solution has the following beneficial effects: by using scales with numbers and two-dimensional codes to mark the placement information of commodities, and collecting images of shelves with scales, by correcting the images, segmenting regions, and counting colors, etc., it can Efficiently and accurately obtain information such as the placement and quantity of commodities. Moreover, the method is simple and easy, and saves a lot of manpower and material resources.

附图说明 Description of drawings

图1是本发明实施例的图像采集分析方法的流程图;Fig. 1 is the flowchart of the image collection and analysis method of the embodiment of the present invention;

图2是本发明实施例的货架结构示意图;Fig. 2 is a schematic diagram of a shelf structure of an embodiment of the present invention;

图3是本发明实施例的标尺示意图;Fig. 3 is a scale schematic diagram of an embodiment of the present invention;

图4是本发明实施例的畸变校正示意图;Fig. 4 is a schematic diagram of distortion correction according to an embodiment of the present invention;

图5是本发明实施例的彩色二维码的示意图。Fig. 5 is a schematic diagram of a color two-dimensional code according to an embodiment of the present invention.

具体实施方式 Detailed ways

下面结合附图和实施例,对本发明的具体实施方式作进一步详细描述。以下实施例用于说明本发明,但不用来限制本发明的范围。The specific implementation manners of the present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. The following examples are used to illustrate the present invention, but are not intended to limit the scope of the present invention.

如图1所示,为本发明实施例的图像采集分析方法的流程图,本实施例包括以下步骤:As shown in Figure 1, it is a flow chart of the image acquisition and analysis method of the embodiment of the present invention. This embodiment includes the following steps:

步骤1、制作若干个标尺,并将标尺摆放在每行超市货架上,标尺上带有若干组由数字和二维码组成的编码;Step 1. Make several scales, and place the scales on each row of supermarket shelves, with several sets of codes composed of numbers and QR codes on the scales;

本方法设计了特殊的印有数字和二维码的彩色标尺,如图2所示,将该标尺横放于货架前的商品标签处,即图2中的D、E、F区域。本实施例的标尺在每行区域放置一个,每个标尺都是分段的,每一段具有一组编码。每一组编码具有固定长度并印有不同的数字和二维码。通过识别数字和二维码可以反推出该组编码位于哪一条标尺的哪个位置,进而得知该组编码对应的商品在货架上的位置。如图3所示,具体地,标尺上的编码包括:两位数字和二维码,可以位于每一段的两端。二维码分为两行、若干列,由行和列形成的每一小方格都印上不同颜色,每段编码的颜色排列方式都不相同。该二维码为彩色二维码,彩色二维码可以在各个色彩通道上单独编码,因而能够获得比黑白二维码更大的编码空间,图中的Ni(如N1、N2等)表示数字,Ci(如C1、C2等)为彩色二维码的颜色。数字和二维码是一一对应的,所有标尺的编码都不重复出现。这样只要识别了数字和二维码中的任何一个即可确定这一组编码在标尺中的位置。识别数字和二维码可以用模板匹配的方法。This method designs a special color scale printed with numbers and two-dimensional codes, as shown in Figure 2, and places the scale horizontally on the product label in front of the shelf, that is, the D, E, and F areas in Figure 2. In this embodiment, one scale is placed in each row area, each scale is segmented, and each segment has a set of codes. Each set of codes has a fixed length and is printed with different numbers and QR codes. By identifying the number and the two-dimensional code, it is possible to deduce which position of the scale the group of codes is on, and then know the position of the product corresponding to the group of codes on the shelf. As shown in FIG. 3 , specifically, the coding on the scale includes: two digits and a two-dimensional code, which can be located at both ends of each segment. The QR code is divided into two rows and several columns. Each small square formed by the rows and columns is printed with a different color, and the color arrangement of each segment of the code is different. The two-dimensional code is a color two-dimensional code, and the colored two-dimensional code can be coded separately on each color channel, so it can obtain a larger coding space than the black and white two-dimensional code. Ni (such as N1, N2, etc.) in the figure represents a number , Ci (such as C1, C2, etc.) is the color of the color QR code. There is a one-to-one correspondence between numbers and QR codes, and the codes of all scales do not appear repeatedly. In this way, as long as any one of the number and the two-dimensional code is recognized, the position of this group of codes in the scale can be determined. To recognize numbers and QR codes, template matching can be used.

步骤2、采集超市货架上的标尺图像;Step 2, collecting the ruler image on the supermarket shelf;

利用相机、手机等图像采集设备对摆放在超市货架上的标尺图像进行采集;利用多条标尺之间的投影变换关系可以求得拍摄者与货架平面的角度,即通过标尺可以获取拍摄者与货架的相对位置。也可以在货架的对面或合适的位置设置摄像头,将摄像头与主机连接,定时或在需要时控制摄像头采集货架图像;能够进一步节省人力物力,提高统计商品信息的准确性。Use image acquisition devices such as cameras and mobile phones to collect images of rulers placed on supermarket shelves; use the projection transformation relationship between multiple rulers to obtain the angle between the photographer and the shelf plane, that is, the angle between the photographer and the shelf plane can be obtained through the rulers. The relative position of the shelves. It is also possible to set up a camera on the opposite side of the shelf or at a suitable location, connect the camera to the host, and control the camera to collect shelf images at regular intervals or when needed; it can further save manpower and material resources and improve the accuracy of statistical commodity information.

步骤3、对采集到的图像分离色彩通道,在各通道上检测标尺上的特定标志;Step 3, separating the color channels of the collected image, and detecting the specific mark on the scale on each channel;

本实施例的特定标志即标尺上的编码:数字和二维码;The specific signs of this embodiment are the codes on the scale: numbers and two-dimensional codes;

检测二维码时,首先,要对采集到的图像分离色彩通道。When detecting a two-dimensional code, first of all, it is necessary to separate the color channels of the collected image.

分离色彩通道的方法与生成彩色二维码的方法正好相反。如果彩色二维码在RGB三个通道上分别编码然后叠加,检测标志时则将图像分解成RGB三个通道。如果彩色二维码在CMY三个通道上分别编码然后叠加,检测标志时则将图像分解成CMY三个通道。The method of separating color channels is just the opposite of the method of generating color QR codes. If the color QR code is encoded separately on the three channels of RGB and then superimposed, the image will be decomposed into three channels of RGB when detecting the mark. If the color QR code is encoded separately on the three CMY channels and then superimposed, the image will be decomposed into the three CMY channels when detecting the mark.

然后,在分离后的各通道上利用模板匹配的方法检测数字和二维码,同时利用数字和二维码之间的一一对应关系进行交叉验证,最终得到标尺在图像平面的坐标,可以用一直线方程表示。Then, use the template matching method to detect numbers and two-dimensional codes on each separated channel, and use the one-to-one correspondence between numbers and two-dimensional codes to perform cross-validation, and finally obtain the coordinates of the scale on the image plane, which can be used represented by a straight line equation.

步骤4、根据特定标志的检测结果对图像进行校正;Step 4, correcting the image according to the detection result of the specific mark;

本步骤的图像校正包括色彩校正和畸变校正。The image correction in this step includes color correction and distortion correction.

其中,色彩校正利用步骤3分离色彩通道的结果,对各个通道进行归一化。归一化时首先对三个通道的色彩值求一个线性变换,经过该变换之后二维码所在区域的亮度(灰度均值)和对比度(灰度方差)归一化成事先设定的常数。将该变换应用到整幅图像即完成了色彩校正。色彩校正需要在各个色彩通道分别进行。利用二维码中的色彩信息还可以求得各色彩通道的亮度和对比度,进行归一化后就能排除不同光照条件的影响。这里的线性变换是将各个通道的色彩值重新以不同比例进行混合。例如线性变换之前有三个通道,三个通道的色彩值分别为r、g、b,校正后的三个通道的色彩值的可能是:第一个通道的色彩值为0.9r+0.1g,第二个通道的色彩值为0.9g+0.1b,第三个通道的色彩值为0.9b+0.1r。Wherein, the color correction utilizes the result of separating the color channels in step 3, and normalizes each channel. During normalization, a linear transformation is first performed on the color values of the three channels. After the transformation, the brightness (average value of grayscale) and contrast (variance of grayscale) of the area where the two-dimensional code is located are normalized to a preset constant. Applying this transformation to the entire image completes the color correction. Color correction needs to be done separately for each color channel. The brightness and contrast of each color channel can also be obtained by using the color information in the QR code, and the influence of different lighting conditions can be eliminated after normalization. The linear transformation here is to remix the color values of each channel in different proportions. For example, there are three channels before the linear transformation, and the color values of the three channels are r, g, and b respectively. The color values of the three channels after correction may be: the color value of the first channel is 0.9r+0.1g, and the color value of the third channel is 0.9r+0.1g. The color value of the second channel is 0.9g+0.1b, and the color value of the third channel is 0.9b+0.1r.

畸变校正也要利用步骤3的结果。畸变校正首先根据步骤2中拍摄者与货架平面的角度对整个图像求一个二维仿射变换矩阵,经过该变换后标尺在图像中将是一条水平直线,如图4所示,将该变换应用到整幅图像即完成了畸变校正。Distortion correction also uses the result of step 3. Distortion correction First, according to the angle between the photographer and the shelf plane in step 2, a two-dimensional affine transformation matrix is obtained for the entire image. After this transformation, the scale will be a horizontal line in the image, as shown in Figure 4. Apply this transformation Distortion correction is completed to the entire image.

步骤5、根据特定标志的检测结果在校正后的图像上分割出待分析的商品区域;Step 5. Segment the commodity area to be analyzed on the corrected image according to the detection result of the specific mark;

图像校正后,根据标尺的坐标、利用标尺(图2中D、E、F三个区域)和商品摆放区域(图2中A、B、C三个区域)的相对位置关系分割出图像中包含商品的区域,后续处理时在该区域内提取特征。After image correction, according to the coordinates of the ruler, use the relative positional relationship between the ruler (the three areas D, E, and F in Figure 2) and the commodity placement area (the three areas A, B, and C in Figure 2) to segment the image. The region containing the product, in which features are extracted during subsequent processing.

步骤6、在步骤5得到的区域上利用色彩信息和纹理信息对商品进行分类,进而得到商品摆放的相关信息。Step 6. Using the color information and texture information to classify the commodities in the area obtained in step 5, and then obtain the relevant information on the placement of the commodities.

对于步骤5分割得到的区域:For the region obtained by step 5 segmentation:

在采用本方法之前,需要预先采集大量商品图像作为训练样本,根据标尺对样本图像色彩校正和畸变校正,在校正后的图像中统计各种颜色出现频率,即对这些训练样本提取颜色特征。根据统计的训练样本中所有颜色出现的频率,利用Mean-Shift算法求得颜色频率的局部极大值,根据局部极大值确定和调整混合高斯模型的个数,然后利用混合高斯模型对统计的颜色出现频率进行拟合。如果某一高斯分布的中心概率密度大于事先设定的阈值,则该高斯模型对应的颜色为主要颜色,将其加入颜色列表。最后得到包含所有商品主要颜色的颜色列表。Before adopting this method, it is necessary to collect a large number of commodity images in advance as training samples, correct the color and distortion of the sample images according to the scale, and count the occurrence frequency of various colors in the corrected images, that is, extract color features from these training samples. According to the frequency of all colors in the statistical training samples, the local maximum value of the color frequency is obtained by using the Mean-Shift algorithm, and the number of mixed Gaussian models is determined and adjusted according to the local maximum value, and then the mixed Gaussian model is used to analyze the statistics. The frequency of color occurrence is fitted. If the central probability density of a Gaussian distribution is greater than the preset threshold, the color corresponding to the Gaussian model will be the main color, and it will be added to the color list. In the end, you get a color list that contains the main colors of all items.

然后统计颜色特征:对于每一类商品,统计颜色列表中各种颜色出现的频率,用该频率作为这类商品的颜色特征。Then count the color features: for each type of product, count the frequency of each color in the color list, and use this frequency as the color feature of this type of product.

最后统计局部纹理特征:提取局部纹理特征时取目标图像16*16像素的窗,计算其局部纹理特征,例如Gabor特征。对每一幅商品图像,用16*16像素的窗对其进行密集采样,然后利用Mean-Shift算法求得局部纹理特征的局部极大值,根据局部极大值确定和调整混合高斯模型的个数,然后利用混合高斯模型对统计的局部纹理特征出现频率进行拟合,如果某一高斯分布的中心概率密度大于事先设定的阈值,则该高斯模型对应的特征为主要局部纹理特征,将其加入局部纹理特征列表。最后得到包含所有商品主要局部特征的局部纹理特征列表。对于每一类商品,统计局部纹理特征列表中各种纹理出现的频率,用该频率作为这类商品的局部纹理特征。Finally, count local texture features: when extracting local texture features, take a window of 16*16 pixels in the target image, and calculate its local texture features, such as Gabor features. For each commodity image, it is densely sampled with a window of 16*16 pixels, and then the local maximum value of the local texture feature is obtained by using the Mean-Shift algorithm, and the individual value of the mixed Gaussian model is determined and adjusted according to the local maximum value. number, and then use the mixed Gaussian model to fit the occurrence frequency of statistical local texture features. If the central probability density of a certain Gaussian distribution is greater than the preset threshold, the corresponding feature of the Gaussian model is the main local texture feature, and its Added to the list of local texture features. Finally, a list of local texture features including the main local features of all commodities is obtained. For each type of product, the frequency of various textures in the local texture feature list is counted, and this frequency is used as the local texture feature of this type of product.

在本步骤6识别货架上的商品时,本方法用到了两类特征,其中颜色特征用于进行粗分类,局部纹理特征用于进行细分类。When identifying the commodities on the shelf in step 6, this method uses two types of features, in which the color feature is used for rough classification, and the local texture feature is used for fine classification.

用颜色特征进行粗分类的方法如下:对步骤5得到的区域进行统计颜色特征时,该区域中每个像素的颜色被认为属于颜色列表中与其最相似的一种颜色。具体地,待分类商品的颜色特征,即主要颜色出现的频率,与事先制定的颜色列表中的已知商品的颜色特征可以定义相似度。例如对于每一种主要颜色,待分类商品出现该颜色的频率和已知商品出现该颜色的频率的差值可以作为相似度的度量,差值越小说明待分类商品越接近已知的该类商品。接下来统计每一类商品图像中各类颜色出现的频率,以此作为描述该类商品的颜色特征(模板);在商品分类的过程中,待分类商品的颜色特征与哪一类商品的模板最接近,即待分类商品与已知的若干类商品,即训练样本中各主要颜色的概率差值之和最小的一类商品模板;该待分类商品即被认为属于这一类。The method of rough classification with color features is as follows: when performing statistical color features on the region obtained in step 5, the color of each pixel in the region is considered to belong to the most similar color in the color list. Specifically, the color feature of the commodity to be classified, that is, the frequency of occurrence of the main color, and the color feature of the known commodity in the pre-established color list can define similarity. For example, for each main color, the difference between the frequency of the product to be classified and the frequency of the color of the known product can be used as a measure of similarity. The smaller the difference, the closer the product to be classified is to the known category. commodity. Next, the frequency of appearance of each color in each type of product image is counted, which is used as the color feature (template) to describe this type of product; in the process of product classification, the color feature of the product to be classified is related to the template The closest, that is, the class of commodity templates with the smallest sum of the probability differences between the commodity to be classified and several known categories of commodities, that is, the probability differences of each main color in the training sample; the commodity to be classified is considered to belong to this category.

由于不同种类的商品可能具有相同的颜色统计特性,这一步的分类结果并不准确,只能输出多个可能结果(即某一商品可能属于某几类)。进一步分类需要利用局部纹理特征。Since different types of commodities may have the same color statistical characteristics, the classification result of this step is not accurate, and only multiple possible results can be output (that is, a certain commodity may belong to certain categories). Further classification needs to utilize local texture features.

在得到粗分类结果后,本方法通过局部纹理特征区分不同种类的商品。由于粗分类得到的多个可能的商品种类具有相近的颜色特征,局部纹理特征仅在灰度图像上提取。After obtaining the rough classification results, this method distinguishes different types of commodities through local texture features. Since multiple possible commodity types obtained by rough classification have similar color features, local texture features are only extracted on grayscale images.

对粗分类之后得到的同一颜色特征下的每两类商品,统计其出现频率差值最大的若干个局部纹理特征,即在两类商品中出现频率差异最大的若干个局部纹理特征;利用所述局部纹理特征出现频率的差异性对当前商品进行准确的分类。For every two types of commodities under the same color feature obtained after rough classification, count several local texture features with the largest difference in frequency of occurrence, that is, several local texture features with the largest frequency difference in the two types of commodities; use the The difference in the frequency of local texture features can accurately classify the current commodity.

最后根据步骤6得到的类别结果统计各类商品的数量和在货架上的位置,输出统计结果。Finally, according to the category results obtained in step 6, the quantity of various commodities and their positions on the shelves are counted, and the statistical results are output.

由于商品需要更新换代,新的商品会进入市场,过时的商品会退出市场,固定不变的商品颜色模板和局部纹理特征并不能取得满意的分类结果。本方法利用当前的分类结果作为新的训练集,定时自动进行自适应训练。在将来的处理中用最新的训练结果作为参考。Because the products need to be updated, new products will enter the market, and outdated products will exit the market. The fixed product color template and local texture features cannot achieve satisfactory classification results. This method uses the current classification result as a new training set, and automatically performs self-adaptive training at regular intervals. Use the latest training results as a reference in future processing.

由以上实施例可以看出,本发明实施例通过用带有数字和二维码的标尺标识商品的摆放信息,并采集有标尺的货架的图像,通过对图像进行校正、分割区域以及颜色统计等处理,能够高效、准确的得到商品的摆放位置、数量等信息。而且本方法简便易行,节省大量人力物力。As can be seen from the above embodiments, the embodiment of the present invention uses scales with numbers and two-dimensional codes to mark the placement information of commodities, and collects images of shelves with scales, and corrects the images, divides regions, and counts colors. And other processing, can efficiently and accurately obtain information such as the location and quantity of commodities. Moreover, the method is simple and easy, and saves a lot of manpower and material resources.

以上所述仅是本发明的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明技术原理的前提下,还可以做出若干改进和变型,这些改进和变型也应视为本发明的保护范围。The above is only a preferred embodiment of the present invention, it should be pointed out that for those of ordinary skill in the art, without departing from the technical principle of the present invention, some improvements and modifications can also be made, these improvements and modifications It should also be regarded as the protection scope of the present invention.

Claims (11)

1. the IMAQ analytical approach is characterized in that, comprising:
Step 1, make several scales and it is placed on every capable supermarket shelves, have some group codings on the said scale;
Step 2, collection are placed with the image of the shelf of said scale;
Step 3, said separation of images color channel to collecting, the coding of detection scale on each passage after the separation; Said coding is made up of numeral and two-dimension code; With said separation of images color channel; On each passage after the separation, utilize the method for template matches to detect numeral and two-dimension code; Utilize the one-to-one relationship between numeral and the two-dimension code to carry out cross validation simultaneously, finally obtain the coordinate of said scale at the plane of delineation;
Step 4, basis are proofreaied and correct image the testing result of said coding;
Be partitioned into the zone that comprises commodity in the image on step 5, the image of testing result after correction of basis to said coding;
Step 6, on said zone, utilize color characteristic and local textural characteristics that commodity are classified, and then obtain the relevant information that commodity are put.
2. IMAQ analytical approach as claimed in claim 1 is characterized in that, said two-dimension code is the color 2 D sign indicating number, and said numeral and color 2 D sign indicating number are corresponding one by one, and each group coding is all inequality.
3. IMAQ analytical approach as claimed in claim 1 is characterized in that the correction of said step 4 comprises colour correction and distortion correction.
4. IMAQ analytical approach as claimed in claim 3; It is characterized in that; Said colour correction comprises asks linear transformation to the color-values of each passage;, said linear transformation is applied to entire image has promptly accomplished colour correction the constant that the brightness and contrast of two-dimension code region is normalized into prior setting through said linear transformation.
5. IMAQ analytical approach as claimed in claim 3 is characterized in that, said distortion correction comprises asks two-dimentional affine transformation matrix to entire image, is horizontal linear with the shape adjustments of said scale in image.
6. IMAQ analytical approach as claimed in claim 5 is characterized in that, said step 5 comprises: the relative position relation according to the coordinate of said scale, said scale and commodity placement area is partitioned into the zone that comprises commodity in the image.
7. IMAQ analytical approach as claimed in claim 6 is characterized in that, said step 6 comprises:
Statistics is treated the color characteristic of classified commodity in said zone, and contrasts with the colors list of prior making;
In said zone, extract the local grain characteristic of treating classified commodity, and do contrast, obtain the classification of treating that classified commodity is affiliated with the local grain tabulation of prior making.
8. IMAQ analytical approach as claimed in claim 7 is characterized in that, before step 1, also comprises:
Gather some commodity images in advance as training sample; Training sample is carried out colour correction and distortion correction; Add up the frequency that its color occurs in the image after correction, ask for the local maximum of frequency, confirm and adjust the number of mixed Gauss model according to said local maximum; Utilize said mixed Gauss model that the frequency of the color appearance of statistics is carried out match; When the center probability density of the Gaussian distribution of a certain color during greater than setting threshold, the color that this Gauss model is corresponding is main color, and the main color that obtains is at last formed colors list;
To each type commodity, add up the frequency that shades of colour occurs in the said colors list, with the color characteristic of the frequency of adding up as such commodity;
Said training sample is got the window of a 16*16 pixel arbitrarily; Calculate the local grain characteristic of said window; Try to achieve the local maximum of said local grain characteristic, confirm and the number of adjustment mixed Gauss model, utilize mixed Gauss model that the local grain characteristic frequency of occurrences of statistics is carried out match then according to local maximum; If the center probability density of a certain Gaussian distribution is greater than prior preset threshold; Then this Gauss model characteristic of correspondence is main local grain characteristic, and it is added the local grain feature list, obtains comprising the local grain feature list of the main local feature of all commodity at last.
9. IMAQ analytical approach as claimed in claim 8 is characterized in that, said in said zone statistics treat the color characteristic of classified commodity, and do contrast with the colors list of prior making and specifically comprise:
Extract the color characteristic of treating classified commodity in the said zone; And compare with color characteristic in the said colors list; When the said color characteristic difference sum of treating classified commodity and certain type of training sample hour, the said classified commodity of treating belongs to the classification of such training sample on color characteristic.
10. IMAQ analytical approach as claimed in claim 9; It is characterized in that; The said local grain characteristic treat classified commodity of in said zone, extracting, and do contrast with the local grain tabulation of prior making, obtain treating that the classification under the classified commodity specifically comprises:
To according to the per two types of commodity under the same color characteristic that obtains after the color characteristic classification, add up several maximum local grain characteristics of its frequency of occurrences difference, utilize the otherness of the said local grain characteristic frequency of occurrences that current commodity are classified.
11. IMAQ analytical approach as claimed in claim 7 is characterized in that, also comprises after the said step 6:
The classification result who obtains according to said step 6 adds up the quantity of all kinds of commodity and the position on shelf, the output statistics.
CN201110098035.XA 2011-04-19 2011-04-19 Image Acquisition and Analysis Method Expired - Fee Related CN102184405B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201110098035.XA CN102184405B (en) 2011-04-19 2011-04-19 Image Acquisition and Analysis Method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110098035.XA CN102184405B (en) 2011-04-19 2011-04-19 Image Acquisition and Analysis Method

Publications (2)

Publication Number Publication Date
CN102184405A CN102184405A (en) 2011-09-14
CN102184405B true CN102184405B (en) 2012-12-26

Family

ID=44570579

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201110098035.XA Expired - Fee Related CN102184405B (en) 2011-04-19 2011-04-19 Image Acquisition and Analysis Method

Country Status (1)

Country Link
CN (1) CN102184405B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104616131A (en) * 2015-02-16 2015-05-13 北京任我在线电子商务有限公司 Shelf management system and method
CN109784193A (en) * 2018-12-20 2019-05-21 上海扩博智能技术有限公司 Terminal data acquisition device and system for intelligent refrigerator

Families Citing this family (36)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5520992B2 (en) * 2012-03-30 2014-06-11 東芝テック株式会社 Product management device
CN102855607A (en) * 2012-07-18 2013-01-02 中国科学院自动化研究所 Remote sensing image color correcting method based on machine learning
CN102930264B (en) * 2012-09-29 2015-10-28 李炳华 Based on commodity display information acquisition and analysis system and the method for image recognition technology
CN102982332A (en) * 2012-09-29 2013-03-20 顾坚敏 Retail terminal goods shelf image intelligent analyzing system based on cloud processing method
JP6270065B2 (en) 2013-03-04 2018-01-31 日本電気株式会社 Article management system, information processing apparatus, control method thereof, and control program
CN103310258B (en) * 2013-06-09 2016-02-17 江苏科技大学 A kind of self-adaptation expansion black and white code encoding method
CN103927399A (en) * 2014-05-07 2014-07-16 苏州搜客信息技术有限公司 Information push method and device
CN104599269B (en) * 2015-01-16 2018-03-27 上海汉京知识产权服务有限公司 Grid location processing system and method based on camera technique
CN105224913A (en) * 2015-09-01 2016-01-06 上海斐讯数据通信技术有限公司 A kind of number of articles detection method and device
CN106250871A (en) * 2016-08-16 2016-12-21 桂林电子科技大学 City management case classification method and device
CN106570510B (en) * 2016-11-07 2019-06-25 南京航空航天大学 A kind of supermarket's commodity recognition method
CN107292248B (en) * 2017-06-05 2023-04-07 广州诚予国际市场信息研究有限公司 Commodity management method and system based on image recognition technology
CN109308434B (en) * 2017-07-27 2020-11-06 浙江汉朔电子科技有限公司 Electronic price tag, server and system
CN107562099A (en) * 2017-08-24 2018-01-09 武汉理工大学 A kind of novel intelligent cabinet and its management method
CN107610379A (en) * 2017-09-11 2018-01-19 江苏弘冠智能科技有限公司 One kind shopping recognition methods and shopping cart identification device
US11049279B2 (en) * 2018-03-27 2021-06-29 Denso Wave Incorporated Device for detecting positional relationship among objects
CN108805823B (en) * 2018-04-12 2021-03-12 上海扩博智能技术有限公司 Commodity image correction method, system, equipment and storage medium
CN108549870B (en) * 2018-04-16 2022-06-10 图麟信息科技(深圳)有限公司 A kind of method and device for identifying the display of articles
CN108466790A (en) * 2018-04-25 2018-08-31 合肥哈工众志自动化科技有限公司 A kind of unmanned supermarket system and sale, replenishing method
CN108846401A (en) * 2018-05-30 2018-11-20 京东方科技集团股份有限公司 Commodity detect terminal, method, system and computer equipment, readable medium
JP7199845B2 (en) 2018-06-19 2023-01-06 キヤノン株式会社 Image processing device, image processing method and program
CN108875830A (en) * 2018-06-22 2018-11-23 广州图匠数据科技有限公司 A kind of commodity on shelf identified off-line method, system and device based on image recognition
CN110633704B (en) * 2018-06-25 2022-07-26 京东方科技集团股份有限公司 Shelves and Shelf Management Systems
CN109064705A (en) * 2018-07-10 2018-12-21 上海小蚁科技有限公司 The method for early warning and device of the inspection of article point, calculate equipment at storage medium
CN110738085A (en) * 2018-07-20 2020-01-31 浙江汉朔电子科技有限公司 shelf out-of-stock checking method, device and equipment and storage medium
CN110889419B (en) * 2018-09-07 2023-04-07 杭州海康威视数字技术股份有限公司 Shelf analysis method, device and system and electronic equipment
CN109191546B (en) * 2018-09-18 2023-06-20 北京智游意动科技有限公司 Map generation method, information acquisition method, device and system
CN111274845B (en) * 2018-12-04 2023-09-05 杭州海康威视数字技术股份有限公司 Method, device and system for identifying display condition of store shelf and electronic equipment
CN111428743B (en) * 2019-01-09 2023-04-18 阿里巴巴集团控股有限公司 Commodity identification method, commodity processing device and electronic equipment
CN110059753A (en) * 2019-04-19 2019-07-26 北京朗镜科技有限责任公司 Model training method, interlayer are every recognition methods, device, equipment and medium
CN110399754B (en) * 2019-04-19 2020-02-28 泰州市朗嘉尚网络科技有限公司 Automated information reproduction system
CN110533028B (en) * 2019-07-31 2021-08-13 北京三快在线科技有限公司 Method and device for detecting commodity display state, electronic device and storage medium
CN110610149B (en) * 2019-09-03 2023-01-20 卓尔智联(武汉)研究院有限公司 Information processing method and device and computer storage medium
CN113076786A (en) * 2020-01-06 2021-07-06 韩瑞霞 Wireless communication system based on content detection
CN114494892B (en) * 2022-04-15 2022-07-15 广州市玄武无线科技股份有限公司 Goods shelf commodity display information identification method, device, equipment and storage medium
CN115861781A (en) * 2022-12-26 2023-03-28 上海汉时信息科技有限公司 Product identification method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020150291A1 (en) * 2001-02-09 2002-10-17 Gretag Imaging Trading Ag Image colour correction based on image pattern recognition, the image pattern including a reference colour
US20040208361A1 (en) * 2001-03-29 2004-10-21 Vasile Buzuloiu Automated detection of pornographic images
CN1540574A (en) * 2003-04-25 2004-10-27 德鑫科技股份有限公司 Method for identifying currency in digital image
CN101520841A (en) * 2009-03-10 2009-09-02 北京航空航天大学 Real-time and anti-interference method for positioning license plate in high-definition TV video
CN201673505U (en) * 2010-01-19 2010-12-15 朱建国 Artwork identification system based on texture analysis

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020150291A1 (en) * 2001-02-09 2002-10-17 Gretag Imaging Trading Ag Image colour correction based on image pattern recognition, the image pattern including a reference colour
US20040208361A1 (en) * 2001-03-29 2004-10-21 Vasile Buzuloiu Automated detection of pornographic images
CN1540574A (en) * 2003-04-25 2004-10-27 德鑫科技股份有限公司 Method for identifying currency in digital image
CN101520841A (en) * 2009-03-10 2009-09-02 北京航空航天大学 Real-time and anti-interference method for positioning license plate in high-definition TV video
CN201673505U (en) * 2010-01-19 2010-12-15 朱建国 Artwork identification system based on texture analysis

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104616131A (en) * 2015-02-16 2015-05-13 北京任我在线电子商务有限公司 Shelf management system and method
CN104616131B (en) * 2015-02-16 2018-12-21 北京任我在线电子商务有限公司 shelf management system and method
CN109784193A (en) * 2018-12-20 2019-05-21 上海扩博智能技术有限公司 Terminal data acquisition device and system for intelligent refrigerator

Also Published As

Publication number Publication date
CN102184405A (en) 2011-09-14

Similar Documents

Publication Publication Date Title
CN102184405B (en) Image Acquisition and Analysis Method
CN116188475B (en) Intelligent control method, system and medium for automatic optical detection of appearance defects
CN105913093B (en) A Template Matching Method for Character Recognition Processing
Oliveira et al. Automatic road crack detection and characterization
CN104794491B (en) Based on the fuzzy clustering Surface Defects in Steel Plate detection method presorted
CN110210448B (en) Intelligent face skin aging degree identification and evaluation method
CN106909941A (en) Multilist character recognition system and method based on machine vision
CN108090494B (en) Textile defect recognition method based on Gabor filter and support vector machine
CN107945200B (en) Image Binarization Segmentation Method
CN108921120B (en) Cigarette identification method suitable for wide retail scene
CN110189383B (en) Traditional Chinese medicine tongue color and fur color quantitative analysis method based on machine learning
CN114723704A (en) Textile quality evaluation method based on image processing
CN118501177B (en) Appearance defect detection method and system for formed foil
CN103439348A (en) Remote controller key defect detection method based on difference image method
CN110490826B (en) Fog drop sample image processing method in camera
CN114926410A (en) Method for detecting appearance defects of brake disc
CN102184404B (en) Method and device for acquiring palm region in palm image
CN102855485B (en) The automatic testing method of one grow wheat heading
CN115147363A (en) Image defect detection and classification method and system based on deep learning algorithm
CN108629762B (en) An image preprocessing method and system for reducing interference features of a bone age evaluation model
CN108364417A (en) Intelligent checkout system and method based on Hough circle and color euclidean distance method
CN117475432A (en) Intelligent processing method for screening and sorting bacterial strains
CN116109577A (en) Printing label defect detection system and method
CN117330582A (en) Polymer PE film surface crystal point detecting system
Vishwanath et al. Connected component analysis for Indian license plate infra-red and color image character segmentation

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20121226

CF01 Termination of patent right due to non-payment of annual fee