CN109215048A - Pipe tobacco length determining method and system based on machine vision - Google Patents

Pipe tobacco length determining method and system based on machine vision Download PDF

Info

Publication number
CN109215048A
CN109215048A CN201811109206.2A CN201811109206A CN109215048A CN 109215048 A CN109215048 A CN 109215048A CN 201811109206 A CN201811109206 A CN 201811109206A CN 109215048 A CN109215048 A CN 109215048A
Authority
CN
China
Prior art keywords
image
cut tobacco
length
area
pipe tobacco
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201811109206.2A
Other languages
Chinese (zh)
Other versions
CN109215048B (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.)
China Tobacco Yunnan Industrial Co Ltd
Original Assignee
China Tobacco Yunnan Industrial 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 China Tobacco Yunnan Industrial Co Ltd filed Critical China Tobacco Yunnan Industrial Co Ltd
Priority to CN201811109206.2A priority Critical patent/CN109215048B/en
Publication of CN109215048A publication Critical patent/CN109215048A/en
Application granted granted Critical
Publication of CN109215048B publication Critical patent/CN109215048B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/187Segmentation; Edge detection involving region growing; involving region merging; involving connected component labelling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • G06T7/62Analysis of geometric attributes of area, perimeter, diameter or volume

Landscapes

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

Abstract

The invention discloses a kind of pipe tobacco length determining method and system based on machine vision, the method comprising the steps of: obtaining the camera image of tested pipe tobacco;The camera image of tested pipe tobacco is pre-processed, bianry image is converted to;The area of each connected region in the bianry image of tested pipe tobacco is calculated, and the connected region that area is less than the area threshold of setting is rejected, Retention area is more than or equal to the connected region of the area threshold;Seek the minimum circumscribed rectangle of the connected region retained;The image length of tested pipe tobacco is sought according to minimum circumscribed rectangle, and according to the ratio data of the image length of master sample and physical length, the image length of tested pipe tobacco is scaled physical length.By the method for the invention and system, the length of pipe tobacco can be accurately determined out.

Description

Pipe tobacco length determining method and system based on machine vision
Technical field
The present invention relates to technical field of tobacco, and in particular to a kind of pipe tobacco length determining method based on machine vision and System.
Background technique
Tobacco structure has a great impact to the releasing content of coke tar of cigarette smoke and tobacco fill value etc., and the coke of cigarette Oil and tobacco fill value etc. have extremely important influence to the analysis of cigarette sense organ product, therefore tobacco structure has cigarette quality Great influence, tobacco structure whether stabilizing influence the stabilization of cigarette quality.
During cigarette primary processing, after cut width determines, so-called tobacco structure is primarily referred to as different length tobacco quality Shared ratio.Have and studies the whole aesthetic quality it has been shown that length>4.75mm pipe tobacco and length<4.00mm pipe tobacco There are significant differences, are mainly reflected on the aroma quality, miscellaneous gas, the fine and smooth organoleptic indicators such as degree and irritation of flue gas, and With the reduction of pipe tobacco length, aesthetic quality is totally on a declining curve.In cigarette composition, the otherness of pipe tobacco length be by What its chemical characteristic was determined.Tobacco leaf or pipe tobacco intrinsic chemical characteristic are the material bases for determining its physical characteristic, multiple beating leaf Roasting and throwing stage, the poor tobacco leaf of crush resistance and pipe tobacco are easy to happen and make broken phenomenon, formed lesser cigarette of area and The shorter pipe tobacco of length.Therefore, the chemical component and its aesthetic quality of different size piece cigarettes and different length finished cut tobacco can deposit In significant difference, to obtain ideal cigarette physical index and its stability, the most probable length of tobacco structure distribution is answered For 2.00~4.75mm, the pipe tobacco less than 1.40mm should be reduced to the greatest extent.
Existing tobacco structure test separates the pipe tobacco of different length, as a result with each mainly using the method for screening Mass accumulation on layer or certain layer of sieve accounts for the ratio of gross mass to indicate.The detection method is slightly wide, detects the quantity of pipe tobacco More and in irregular shape, when pipe tobacco is overlapped, overlapping pipe tobacco separation can not be caused pipe tobacco detection error larger by vibrating sieving machine.
Summary of the invention
To solve above-mentioned deficiency in the prior art, the present invention provides a kind of, and the pipe tobacco length based on machine vision is true Determine method and system.
To achieve the above objectives, The technical solution adopted by the invention is as follows:
A kind of pipe tobacco length determining method based on machine vision, comprising the following steps:
Step 1, the camera image of tested pipe tobacco is obtained;
Step 2, the camera image of tested pipe tobacco is pre-processed, is converted to bianry image;
Step 3, the area of each connected region in the bianry image of tested pipe tobacco is calculated, and area is less than to the face of setting The connected region of product threshold value is rejected, and Retention area is more than or equal to the connected region of the area threshold;
Step 4, the minimum circumscribed rectangle of the connected region retained is sought;
Step 5, the image length of tested pipe tobacco is sought according to minimum circumscribed rectangle, and long according to the image of master sample The ratio data of degree and physical length, is scaled physical length for the image length of tested pipe tobacco.
On the other hand, the present invention also provides a kind of pipe tobacco length based on machine vision to determine system, including with lower die Block:
Image collection module, for obtaining the camera image of tested pipe tobacco;
Image conversion module is converted to bianry image for pre-processing the camera image of tested pipe tobacco;
Area calculation module, the area of each connected region in the bianry image for calculating tested pipe tobacco, and area is small It is rejected in the connected region of the area threshold of setting, Retention area is more than or equal to the connected region of the area threshold;
Boundary rectangle seeks module, the minimum circumscribed rectangle of the connected region for seeking retaining;
Length computation module, for seeking the image length of tested pipe tobacco according to minimum circumscribed rectangle, and according to standard sample The ratio data of image length originally and physical length, is scaled physical length for the image length of tested pipe tobacco.
In another aspect, the present invention also provides a kind of electronic equipment, including memory, processor and it is stored in memory The step of computer program that is upper and can running on a processor, the processor executes the method for the invention.
In another aspect, it is stored thereon with computer program the present invention also provides a kind of computer readable storage medium, The step of program realizes the method for the invention when being executed by processor.
Compared with prior art, the invention has the following advantages:
1) this method detects sample using machine vision, the influence so as to avoid manual intervention to detection, It also avoids screening and detects the big problem of the difficult separation of existing pipe tobacco overlapping, detection error, realize quick, lossless efficient Detection.
2) pipe tobacco is divided into two class of regular and irregular, with different preprocess method and length calculation method, And different reference substances has been formulated by a large amount of experiment, the drawbacks of different type pipe tobacco is measured with Same Way is avoided, is The accuracy of pipe tobacco linear measure longimetry provides guarantee.
3) this method is also applied not only to pipe tobacco measurement of length, while it is long to apply also for other shapes elongated and narrow object The measurement of degree.
Detailed description of the invention
Fig. 1 shows the supplemental characteristic of the experimental standard sample of linear type pipe tobacco;
Fig. 2 shows the supplemental characteristic of the experimental standard sample of 1/4 round pipe tobacco;
Fig. 3 shows the supplemental characteristic of the experimental standard sample of 1/2 round pipe tobacco;
Fig. 4 shows the supplemental characteristic of the experimental standard sample of S-shaped type pipe tobacco;
Fig. 5 a-b is respectively that regular pipe tobacco pre-processes forward and backward comparison diagram;
Fig. 6 a-d is respectively figure, the filled figure after the original graph of irregular pipe tobacco, filtered figure, corrosion;
Fig. 7 is that regular pipe tobacco rejects image after small area;
Fig. 8 is that irregular pipe tobacco rejects image after small area;
Fig. 9 is the external matrix figure of regular pipe tobacco marker number;
Figure 10 is the external matrix figure of irregular pipe tobacco note number;
Figure 11 is the flow chart of the pipe tobacco length determining method based on machine vision.
Figure 12 is the functional block diagram that system is determined based on the pipe tobacco length of machine vision.
Figure 13 is the functional block diagram of electronic equipment described in embodiment.
Specific embodiment
Below in conjunction with attached drawing in the embodiment of the present invention, technical solution in the embodiment of the present invention carries out clear, complete Ground description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.Usually exist The component of the embodiment of the present invention described and illustrated in attached drawing can be arranged and be designed with a variety of different configurations herein.Cause This, is not intended to limit claimed invention to the detailed description of the embodiment of the present invention provided in the accompanying drawings below Range, but be merely representative of selected embodiment of the invention.Based on the embodiment of the present invention, those skilled in the art are not having Every other embodiment obtained under the premise of creative work is made, shall fall within the protection scope of the present invention.
Please refer to Fig. 1-4, respectively show the master sample of regular pipe tobacco data and irregular pipe tobacco master sample Data, since pipe tobacco has different shape, using the linear type master sample of PS technology film production rule pipe tobacco, irregularly The 1/2 of pipe tobacco is round, 1/4 round, S-shaped type master sample, i.e. 4 master samples of different shapes, each shape 10 is not With the sample of size.By the way that the adjustment of 10 samples of each shape is disposed vertically, is horizontally arranged, the right oblique 45 degree placements of sample, Left oblique 45 degree of placements of sample etc. are utilized respectively following rule detection methods of the invention, anormal detection method (executes step 1 to arrive Step 6 only calculates image length in step 6) detection 10 times is repeated, by 10 samples of each shape respectively at 10 Different location detection as a result, the average image length of 10 samples 10 positions of each shape is calculated, for linear type Master sample re-records the actual (tube) length of each master sample using the average image length as the image length of the master sample The parameters such as degree, for irregular master sample, using 10 samples of 3 shapes 10 positions the average image length as The image length of the master sample re-records the parameters such as the physical length of each master sample, as shown in Figs 1-4.
Can be refering to Fig. 5-11, a kind of pipe tobacco length determining method based on machine vision provided in the present embodiment, packet Include following steps:
Step 1 obtains the image of tested pipe tobacco.In the present embodiment, 10 tested pipe tobaccos are placed on obturator sample Product placement region, by resolution ratio 1292 (H) * 964 (V), the area array cameras of frame frequency 43fps scans pipe tobacco, is converted into image letter Number, image processing software is transferred to by Ethernet.
In the present embodiment, pipe tobacco is divided into regular pipe tobacco and irregular pipe tobacco, wherein regular pipe tobacco, which refers to, is projected as straight line Pipe tobacco, irregular pipe tobacco refer to the pipe tobacco for being projected as non-rectilinear (such as 1/2 is round, 1/4 round, S type).
Step 2 pre-processes the image of acquisition, handles as bianry image.
In this step, different pretreatment modes is respectively adopted for regular pipe tobacco and irregular pipe tobacco, specifically such as Under:
It is directed to regular pipe tobacco: coloring image into logic matrix, i.e., all convert the pixel of color image One color threshold p, such as 95 are defined according to the wave lower position of grey level histogram at Logical data type, color is big Pixel in 95 is wholly converted into 1, and color is black, that is, background, other pixels are converted to 0, and color is that white is cigarette Silk, image before and after the processing is as shown in Fig. 5 a, Fig. 5 b.
Be directed to irregular pipe tobacco: irregular pipe tobacco image shape is curve, and the simple binary picture that carries out is located in advance Reason, will lead to and filter out true pipe tobacco image border profile, therefore be pre-processed using following steps:
1. filtering: image obtained in step 1 being carried out Local standard deviation filtering, such as chooses the 3 rank unit squares of 3*3 Battle array, is defined as 0 element for the pixel quantity in 3 rank fields in image, the pixel quantity for being unable to designated field is defined as 1 member Element.
The standard deviation of the method for seeking Hessian matrix using the second dervative of Gaussian convolution core, Gaussian function indicates convolution Scale, gaussian filtering be according to Gaussian function at certain point and its surrounding pixel set weight, weighting be averaging.So false If convolution scale ratio pipe tobacco width is much larger, then obtained convolution results will be dragged down at background, because of the ash at background It is lesser for spending change of gradient, and when convolution scale ratio pipe tobacco width is much smaller, no matter noise or boxed area all can Retained by filter, therefore the garbages such as noise can be filtered out using the above method.
2. corrosion: one reasonable corrosion structure object window of creation, such as the window that disc radius is 2, after filtering Image gradually corroded, the boundary for eliminating image has some small and meaningless pixel.
3. refinement: the image after excessive erosion, under conditions of not changing the basic structure of image, by all objects Continuous lines are all simplified to, the elementary contour of image is retained.
4. Contour filling: being filled to the profile diagram after refinement, the region in lines is all changed to white, pixel It is wholly converted into 0, i.e. pipe tobacco information, the region outside lines is changed to black, and pixel is wholly converted into 1.Entire preprocessing process Comparison diagram as shown in Fig. 6 a-d.
Step 3 calculates the area of bianry image obtained in step 2, i.e., the pixel that pixel is 0 in bianry image Number.For example, the connection n of one n*n of creation ties up unit matrix, such as 3 dimension connected region matrixes of 8 neighborhoods, 8- neighborhood It is to say a pixel, if connected with other pixels in upper and lower, left and right, the upper left corner, the lower left corner, the upper right corner or the lower right corner , then it is assumed that they are connection, and visually apparently, the point to communicate with each other forms a region, and disconnected dot It is 0 by the pixel definition in the region of connection, i.e., the label of white pixel (target), allows in bianry image at different regions Each individually connected region forms an identified block, and calculates the area of the i.e. each connected region of each home block. A piece pipe tobacco is that multiple neighborhoods are formed, one connected region of every pipe tobacco.
Step 4, since image and background are not two single levels, useless information is treated as in binary picture Target point is marked as 1, forms small bianry image area, needs the area useless to these to reject, due to garbage Point is more, avoids weeding out useful information, therefore define a reasonable connected region area threshold, such as 200, by area Connected region less than 200 is rejected.
Remaining connected region area is converted into connected region pixel by step 5, i.e., after rejecting small area image Every pipe tobacco bianry image, take 8- connection matrix, to belong to the same pixel connected region all pixels point distribute phase Same number, distributes different numbers to the pixel connected region for belonging to different, according to the pixels of different number labels, meter Calculate the minimum circumscribed rectangle of each pixel connected region.Regular pipe tobacco label is as shown in fig. 7, irregular pipe tobacco label such as figure Shown in 8.
Step 6 calculates the length of tested pipe tobacco, and being directed to regular pipe tobacco and irregular pipe tobacco has different calculating sides Method is specifically, as follows:
For regular pipe tobacco: the minimum circumscribed rectangle length of each not isolabeling is the image length of every pipe tobacco, due to Image length is not the physical length of pipe tobacco, therefore further according to image length and actual (tube) length in the master sample of regular pipe tobacco Ratio data relationship between degree, converses the physical length of every tested pipe tobacco.
For irregular pipe tobacco: the quantity of pixel shared by every tested pipe tobacco in bianry image is calculated, according to irregular The data of the master sample of pipe tobacco, calculate the corresponding physical length of each pixel, then after being fitted center line to pipe tobacco, thus Calculate the sum of each length on center line, the actual length of as tested pipe tobacco.Specific formula is as follows:
Y=x1+x2+x3+ ...+xm-2+xm-1+xm
Wherein, y is the actual length of tested pipe tobacco;X is the corresponding physical length of each pixel;M is every tested cigarette The quantity of pixel shared by silk.
Figure 12 is please referred to, identical inventive concept is based on, additionally provides a kind of cigarette based on machine vision in the present embodiment Filament length degree determines system, comprises the following modules:
Image collection module, for obtaining the camera image of tested pipe tobacco;
Image conversion module is converted to bianry image for pre-processing the camera image of tested pipe tobacco;
Area calculation module, the area of each connected region in the bianry image for calculating tested pipe tobacco, and area is small It is rejected in the connected region of the area threshold of setting, Retention area is more than or equal to the connected region of the area threshold;
Boundary rectangle seeks module, the minimum circumscribed rectangle of the connected region for seeking retaining;
Length computation module, for seeking the image length of tested pipe tobacco according to minimum circumscribed rectangle, and according to standard sample The ratio data of image length originally and physical length, is scaled physical length for the image length of tested pipe tobacco.
For the function and concrete processing procedure of modules, the correlation of above-mentioned compression method in embodiment may refer to Description and attached drawing 5-11, details are not described herein again.
As shown in figure 13, a kind of electronic equipment is provided simultaneously in the embodiment of the present invention, which can be The equipment that server, computer etc. have data-handling capacity.As shown in figure 13, electronic equipment 100 include: memory 110, Processor 120 and network module 130.
The memory 110, processor 120 and network module 130 are directly or indirectly electrically connected between each other, To realize the transmission or interaction of data.The compressibility of adaptive real time spectrum data is stored in memory 110, it is described The compressibility of adaptive real time spectrum data includes that at least one can be stored in the form of software or firmware (firmware) Software function module in the memory 110, the software that the processor 120 is stored in memory 110 by operation Program and module, such as the compressibility of the adaptive real time spectrum data in the embodiment of the present invention, thereby executing various function It can apply and data processing, i.e. the compression method of adaptive real time spectrum data in the realization embodiment of the present invention.
Wherein, the memory 110 may be, but not limited to, random access memory (Random Access Memory, RAM), read-only memory (Read Only Memory, ROM), programmable read only memory (Programmable Read-Only Memory, PROM), erasable read-only memory (Erasable Programmable Read-Only Memory, EPROM), electricallyerasable ROM (EEROM) (Electric Erasable Programmable Read-Only Memory, EEPROM) etc..Wherein, memory 110 is for storing program, the processor 120 after receiving and executing instruction, Execute described program.
The processor 120 may be a kind of IC chip, the processing capacity with signal.Above-mentioned processor 120 can be general processor, including central processing unit (Central Processing Unit, CPU), network processing unit (Network Processor, NP) etc..Can also be digital signal processor (DSP)), it is specific integrated circuit (ASIC), existing Field programmable gate array (FPGA) either other programmable logic device, discrete gate or transistor logic, discrete hardware Component.It may be implemented or execute disclosed each method, step and the logic diagram in the embodiment of the present invention.General processor It can be microprocessor or the processor be also possible to any conventional processor etc..
Network module 130 is used to establish the communication connection between electronic equipment 100 and external communications terminals by network, Realize the transmitting-receiving operation of network signal and data.Above-mentioned network signal may include wireless signal or wire signal.
It is appreciated that structure shown in Figure 13 is only to illustrate, electronic equipment 100 may also include more than shown in Figure 13 Perhaps less component or with the configuration different from shown in Figure 13.Each component shown in Figure 13 can using hardware, Software or combinations thereof is realized.
The above description is merely a specific embodiment, but scope of protection of the present invention is not limited thereto, appoints What those familiar with the art in the technical scope disclosed by the present invention, can easily think of the change or the replacement, answer It is included within the scope of the present invention.

Claims (9)

1.一种基于机器视觉的烟丝长度确定方法,其特征在于,包括以下步骤:1. a method for determining the length of cut tobacco based on machine vision, is characterized in that, comprises the following steps: 步骤1,获取被测烟丝的相机图像;Step 1, obtain the camera image of the cut tobacco to be tested; 步骤2,将被测烟丝的相机图像进行预处理,转换为二值图像;Step 2: Preprocess the camera image of the cut tobacco to be tested and convert it into a binary image; 步骤3,计算被测烟丝的二值图像中各连通区域的面积,并将面积小于设定的面积阈值的连通区域剔除,保留面积大于等于所述面积阈值的连通区域;Step 3: Calculate the area of each connected area in the binary image of the cut tobacco to be tested, and remove the connected area whose area is less than the set area threshold, and retain the connected area whose area is greater than or equal to the area threshold; 步骤4,求取保留的连通区域的最小外接矩形;Step 4, find the minimum circumscribed rectangle of the reserved connected region; 步骤5,根据最小外接矩形求取被测烟丝的图像长度,并根据标准样本的图像长度与实际长度的比例数据,将被测烟丝的图像长度换算为实际长度。Step 5: Calculate the image length of the cut tobacco under test according to the minimum circumscribed rectangle, and convert the image length of the cut tobacco under test to the actual length according to the ratio data of the image length of the standard sample and the actual length. 2.根据权利要求1所述的方法,其特征在于,所述步骤2中,包括以下步骤:2. method according to claim 1, is characterized in that, in described step 2, comprises the following steps: 判断被测烟丝的类型,定义投影为直线的烟丝为规则烟丝,否则为不规则烟丝;Determine the type of the cut tobacco to be tested, and define the cut tobacco projected as a straight line as regular cut tobacco, otherwise it is irregular cut tobacco; 若被测烟丝为规则烟丝,则将颜色大于设定的颜色阈值的像素点换算成1,将颜色小于等于所述颜色阈值的像素点换算成0,得到所述二值图像;If the measured cut tobacco is regular cut tobacco, then convert the pixel points whose color is greater than the set color threshold into 1, and convert the pixel points whose color is less than or equal to the color threshold into 0, to obtain the binary image; 若被测烟丝为不规则烟丝,则先将相机图像进行局部标准差滤波处理,再创建一个腐蚀结构对象窗口,将滤波后的图像进行逐步腐蚀处理,再将经过腐蚀处理后的图像在不改变图像的基本结构的条件下,将所有的对象都简化成连续的线条,保留图像的基本轮廓,最后对轮廓图进行填充,将线条内的区域像素全部转换成0,线条外面的区域全部转换成1,得到所述二值图像。If the cut tobacco to be tested is irregular cut tobacco, the camera image is first subjected to local standard deviation filtering, and then a corroded structure object window is created, and the filtered image is gradually corroded, and then the corroded image is not changed. Under the condition of the basic structure of the image, all objects are simplified into continuous lines, the basic outline of the image is preserved, and finally the outline map is filled, and all the pixels in the area inside the line are converted into 0, and all the areas outside the line are converted into 0. 1. Obtain the binary image. 3.根据权利要求1所述的方法,其特征在于,所述步骤3中,计算被测烟丝的二值图像中各连通区域的面积,包括:3. The method according to claim 1, wherein, in the step 3, calculating the area of each connected region in the binary image of the cut tobacco under test, comprising: 创建一个n维单位矩阵,根据单位矩阵找到二值图像的连通区域,并计算各个连通区域的面积。Create an n-dimensional identity matrix, find the connected regions of the binary image according to the identity matrix, and calculate the area of each connected region. 4.根据权利要求1所述的方法,其特征在于,所述步骤4中,包括:4. The method according to claim 1, wherein in the step 4, comprising: 对属于同一个像素连通区域的所有像素点分配相同的编号,对属于不同的像素连通区域分配不同的编号,根据不同编号标记的像素点,计算出每个像素连通区域的最小外接矩形。Assign the same number to all pixels belonging to the same pixel connected area, assign different numbers to different pixel connected areas, and calculate the minimum circumscribed rectangle of each pixel connected area according to the pixels marked with different numbers. 5.根据权利要求4所述的方法,其特征在于,所述步骤5中,5. The method according to claim 4, wherein in the step 5, 若被测烟丝为规则烟丝,最小外接矩形的长度即为被测烟丝的图像长度;If the cut tobacco to be tested is regular cut tobacco, the length of the minimum circumscribed rectangle is the image length of the cut tobacco to be tested; 若被测烟丝为不规则烟丝,求取最小外接矩形中被测烟丝所占像素点的数量m,根据不规则烟丝的标准样本的数据,计算每个像素点对应的实际长度,则为被测烟丝的实际长度y=x1+x2+x3+…+xm-2+xm-1+xmIf the cut tobacco to be tested is irregular cut tobacco, obtain the number m of pixels occupied by the cut tobacco cut in the smallest circumscribed rectangle, and calculate the actual length corresponding to each pixel point according to the data of the standard sample of irregular cut tobacco, which is the measured cut tobacco. The actual length of the cut tobacco y=x1+x2+x3+...+x m-2 +x m-1 +x m ; 其中,y是计算出的被测烟丝的实际长度,x是每个像素点对应的实际长度;m是每根被测烟丝所占像素点的数量。Among them, y is the calculated actual length of the cut tobacco to be tested, x is the actual length corresponding to each pixel point; m is the number of pixels occupied by each cut tobacco to be tested. 6.根据权利要求4所述的方法,其特征在于,所述标准样本的图像长度与实际长度的比例数据的获取步骤,包括:6. The method according to claim 4, wherein the step of obtaining the ratio data of the image length of the standard sample and the actual length comprises: 对已知长度的标准样本,按照上述步骤1-4相同的步骤进行处理,得到标准样本的最小外接矩形后,根据最小外接矩形求取标准样本的图像长度,建立标准样本的图像长度与实际长度的比例关系。For the standard sample of known length, follow the same steps as the above steps 1-4, after obtaining the minimum circumscribed rectangle of the standard sample, obtain the image length of the standard sample according to the minimum circumscribed rectangle, and establish the image length and actual length of the standard sample. proportional relationship. 7.一种基于机器视觉的烟丝长度确定系统,其特征在于,包括以下模块:7. A system for determining the length of cut tobacco based on machine vision, is characterized in that, comprises the following modules: 图像获取模块,用于获取被测烟丝的相机图像;The image acquisition module is used to acquire the camera image of the tested cut tobacco; 图像转换模块,用于将被测烟丝的相机图像进行预处理,转换为二值图像;The image conversion module is used to preprocess the camera image of the tested cut tobacco and convert it into a binary image; 面积计算模块,用于计算被测烟丝的二值图像中各连通区域的面积,并将面积小于设定的面积阈值的连通区域剔除,保留面积大于等于所述面积阈值的连通区域;The area calculation module is used to calculate the area of each connected area in the binary image of the cut tobacco to be tested, and remove the connected area whose area is less than the set area threshold, and retain the connected area whose area is greater than or equal to the area threshold; 外接矩形求取模块,用于求取保留的连通区域的最小外接矩形;The circumscribed rectangle obtaining module is used to obtain the minimum circumscribed rectangle of the reserved connected area; 长度计算模块,用于根据最小外接矩形求取被测烟丝的图像长度,并根据标准样本的图像长度与实际长度的比例数据,将被测烟丝的图像长度换算为实际长度。The length calculation module is used to obtain the image length of the cut tobacco under test according to the minimum circumscribed rectangle, and convert the image length of the cut tobacco under test to the actual length according to the ratio data of the image length of the standard sample and the actual length. 8.一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其特征在于,所述处理器执行权利要求1-6任一项所述方法的步骤。8. An electronic device comprising a memory, a processor and a computer program stored on the memory and running on the processor, wherein the processor performs the steps of the method of any one of claims 1-6 . 9.一种计算机可读存储介质,其上存储有计算机程序,其特征在于,该程序被处理器执行时实现权利要求1-6任一项所述方法的步骤。9. A computer-readable storage medium on which a computer program is stored, characterized in that, when the program is executed by a processor, the steps of the method according to any one of claims 1-6 are implemented.
CN201811109206.2A 2018-09-21 2018-09-21 Method and system for determining the length of cut tobacco based on machine vision Active CN109215048B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811109206.2A CN109215048B (en) 2018-09-21 2018-09-21 Method and system for determining the length of cut tobacco based on machine vision

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811109206.2A CN109215048B (en) 2018-09-21 2018-09-21 Method and system for determining the length of cut tobacco based on machine vision

Publications (2)

Publication Number Publication Date
CN109215048A true CN109215048A (en) 2019-01-15
CN109215048B CN109215048B (en) 2021-05-07

Family

ID=64985103

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811109206.2A Active CN109215048B (en) 2018-09-21 2018-09-21 Method and system for determining the length of cut tobacco based on machine vision

Country Status (1)

Country Link
CN (1) CN109215048B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110889842A (en) * 2019-11-28 2020-03-17 常德金鹏印务有限公司 Method for detecting looseness of small cigarette pack cigarette label
CN111060014A (en) * 2019-10-16 2020-04-24 杭州安脉盛智能技术有限公司 Online self-adaptive tobacco shred width measuring method based on machine vision
CN112037195A (en) * 2020-08-31 2020-12-04 中冶赛迪重庆信息技术有限公司 Method, system, equipment and medium for detecting abnormal length of bar
CN113139951A (en) * 2021-05-08 2021-07-20 上海烟草集团有限责任公司 Method, system and equipment for characterizing attributes of tobacco lamina and computer readable storage medium
CN113838123A (en) * 2021-08-16 2021-12-24 湖南磐钴传动科技有限公司 Method for measuring tobacco shred morphology characteristics based on image processing
CN114529504A (en) * 2021-12-27 2022-05-24 杭州安脉盛智能技术有限公司 Online tobacco shred width measuring method integrating image segmentation and template matching

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6904917B2 (en) * 2000-09-08 2005-06-14 Japan Tobacco, Inc. Method of manufacturing cigarette suppressing spread of burn and apparatus for manufacturing cigarette suppressing spread of burn
CN102679883A (en) * 2012-05-09 2012-09-19 中国科学院光电技术研究所 Tobacco shred width measuring method based on image processing
CN106052571A (en) * 2016-07-21 2016-10-26 云南中烟工业有限责任公司 Device and method for intelligent rapid detection of length and distribution of leaf silk for cigarette
CN106651872A (en) * 2016-11-23 2017-05-10 北京理工大学 Prewitt operator-based pavement crack recognition method and system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6904917B2 (en) * 2000-09-08 2005-06-14 Japan Tobacco, Inc. Method of manufacturing cigarette suppressing spread of burn and apparatus for manufacturing cigarette suppressing spread of burn
CN102679883A (en) * 2012-05-09 2012-09-19 中国科学院光电技术研究所 Tobacco shred width measuring method based on image processing
CN106052571A (en) * 2016-07-21 2016-10-26 云南中烟工业有限责任公司 Device and method for intelligent rapid detection of length and distribution of leaf silk for cigarette
CN106651872A (en) * 2016-11-23 2017-05-10 北京理工大学 Prewitt operator-based pavement crack recognition method and system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
庄珍珍: "基于机器视觉的烟叶自动分级方法研究", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111060014A (en) * 2019-10-16 2020-04-24 杭州安脉盛智能技术有限公司 Online self-adaptive tobacco shred width measuring method based on machine vision
CN111060014B (en) * 2019-10-16 2022-03-22 杭州安脉盛智能技术有限公司 Online self-adaptive tobacco shred width measuring method based on machine vision
CN110889842A (en) * 2019-11-28 2020-03-17 常德金鹏印务有限公司 Method for detecting looseness of small cigarette pack cigarette label
CN110889842B (en) * 2019-11-28 2023-08-22 常德金鹏印务有限公司 Method for detecting loose degree of small box cigarette labels
CN112037195A (en) * 2020-08-31 2020-12-04 中冶赛迪重庆信息技术有限公司 Method, system, equipment and medium for detecting abnormal length of bar
CN112037195B (en) * 2020-08-31 2023-04-07 中冶赛迪信息技术(重庆)有限公司 Method, system, equipment and medium for detecting abnormal length of bar
CN113139951A (en) * 2021-05-08 2021-07-20 上海烟草集团有限责任公司 Method, system and equipment for characterizing attributes of tobacco lamina and computer readable storage medium
CN113838123A (en) * 2021-08-16 2021-12-24 湖南磐钴传动科技有限公司 Method for measuring tobacco shred morphology characteristics based on image processing
CN113838123B (en) * 2021-08-16 2024-03-19 湖南磐钴传动科技有限公司 Method for measuring appearance characteristics of cut tobacco based on image processing
CN114529504A (en) * 2021-12-27 2022-05-24 杭州安脉盛智能技术有限公司 Online tobacco shred width measuring method integrating image segmentation and template matching

Also Published As

Publication number Publication date
CN109215048B (en) 2021-05-07

Similar Documents

Publication Publication Date Title
CN109215048A (en) Pipe tobacco length determining method and system based on machine vision
CN109191459B (en) Automatic identification and rating method for continuous casting billet macrostructure center segregation defect
CN110287932B (en) Road blocking information extraction method based on deep learning image semantic segmentation
CN108629775B (en) A kind of hot high-speed wire surface image processing method
CN110349153B (en) Image method tobacco peduncle content detection method based on multi-feature fusion
US8577611B2 (en) System and method for analyzing trees in LiDAR data using views
CN108921864B (en) Method and device for extracting center of light strip
CN109711288A (en) Remote Sensing Ship Detection Method Based on Feature Pyramid and Distance Constrained FCN
CN105427275B (en) Crop field environment wheat head method of counting and device
CN110909640A (en) Method and device for determining water level line, storage medium and electronic device
CN116391204A (en) Line width measuring method, line width measuring device, calculating processing apparatus, computer program, and computer readable medium
CN115170570A (en) Fabric fuzzing and pilling detection method based on gray level run-length matrix
CN117635615B (en) Defect detection method and system for realizing punching die based on deep learning
CN110033482A (en) A kind of curb recognition methods and device based on laser point cloud
CN108564002A (en) A kind of remote sensing image time series variation detection method and system
CN110045354B (en) Method and device for evaluating radar performance
CN116740579B (en) Intelligent collection method for territorial space planning data
CN117274262B (en) Wire welding method for acoustic horn circuit board
CN116255912A (en) Method and system for measuring static volume of package
US8538695B2 (en) System and method for analyzing trees in LiDAR data using views
CN113469171A (en) Method, device and medium for identifying interest area in SFR test card image
CN118552824A (en) Line structure light center line extraction method based on multichannel feature fusion
CN113470058A (en) Gravel particle size distribution measuring method and device
WO2013184518A2 (en) Automatic processing scale estimation for use in an image process
CN110211078B (en) Significance detection method based on anisotropic diffusion

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant