技术领域Technical field
本申请涉及烟草工业领域,尤其涉及一种重建烟叶轮廓的方法、系统及计算机可读存储介质。The present application relates to the field of tobacco industry, and in particular to a method, system and computer-readable storage medium for reconstructing the outline of tobacco leaves.
背景技术Background technique
烟叶的分类分级是烟叶制品加工中的重要环节,其中判断烟叶等级时烟叶形状具有重要的参考意义,但由于烟叶采摘方式、病虫害、加工和运输等诸多因素导致叶面残缺或破损,补全残损烟叶的轮廓主要依赖于人工经验,且标准模糊性和难以量化等特点。因此如何在不依赖于人工经验的情况下,稳定可靠地重建烟叶轮廓成为降低烟叶分拣分级难度的重要问题。The classification and grading of tobacco leaves is an important link in the processing of tobacco leaf products. The shape of the tobacco leaves is of great reference significance when judging the grade of tobacco leaves. However, due to many factors such as tobacco leaf picking methods, pests and diseases, processing and transportation, the leaf surface is incomplete or damaged. It is necessary to make up for the damage. The outline of tobacco leaves mainly relies on manual experience, and the standards are fuzzy and difficult to quantify. Therefore, how to reconstruct tobacco leaf contours stably and reliably without relying on manual experience has become an important issue to reduce the difficulty of tobacco leaf sorting and grading.
发明内容Contents of the invention
本申请实施例提供了一种重建烟叶轮廓的方法、系统及计算机可读存储介质,能在保证烟叶原料品质的前提下,减少烟叶分拣分级工作对人为的知识经验、注意力、反应速度的依赖程度,降低工作人员的劳动强度。Embodiments of the present application provide a method, system and computer-readable storage medium for reconstructing tobacco leaf contours, which can reduce the impact of tobacco leaf sorting and grading work on human knowledge, experience, attention, and reaction speed while ensuring the quality of tobacco leaf raw materials. dependence and reduce the labor intensity of staff.
为达到上述目的,本申请提供了一种重建烟叶轮廓的方法,该方法包括:In order to achieve the above purpose, this application provides a method for reconstructing the outline of tobacco leaves, which method includes:
采集烟叶图像,所述烟叶图像为将烟叶放置于拍摄仓的下方进行拍摄所得的灰度图像;Collecting a tobacco leaf image, the tobacco leaf image is a grayscale image obtained by placing the tobacco leaf below the shooting chamber and shooting;
对所述烟叶图像进行烟叶轮廓检测,生成烟叶轮廓初步点集;Perform tobacco leaf contour detection on the tobacco leaf image to generate a preliminary point set of tobacco leaf contours;
对所述烟叶图像进行残缺检测,生成多个残缺部分的残缺轮廓点集;Perform defective detection on the tobacco leaf image to generate defective contour point sets of multiple defective parts;
对所述烟叶轮廓初步点集和多个所述残缺轮廓点集进行残缺替换处理,得到烟叶轮廓中间轮廓点集,所述烟叶中间轮廓点集中包括重建烟叶的至少一个轮廓点。Perform incomplete replacement processing on the preliminary tobacco leaf outline point set and a plurality of the incomplete contour point sets to obtain a tobacco leaf intermediate contour point set, and the tobacco leaf intermediate contour point set includes at least one contour point of the reconstructed tobacco leaf.
可选的,所述对所述烟叶轮廓初步点集和多个所述残缺轮廓点集进行残缺替换处理,得到烟叶轮廓中间轮廓点集包括:Optionally, performing incomplete replacement processing on the preliminary tobacco leaf contour point set and multiple incomplete contour point sets to obtain an intermediate tobacco leaf contour point set includes:
根据所述烟叶轮廓初步点集和多个所述残缺轮廓点集,找出待删除烟叶轮廓点、待删除残缺轮廓点和待插入残缺轮廓点;According to the preliminary point set of tobacco leaf contours and a plurality of the incomplete contour point sets, find the tobacco leaf outline points to be deleted, the incomplete outline points to be deleted, and the incomplete outline points to be inserted;
将所述待插入残缺轮廓点替换所述烟叶轮廓初步点集中的所述待删除烟叶轮廓点,并删除所述待删除残缺轮廓点,从而获得烟叶中间轮廓点集。The incomplete contour points to be inserted are replaced with the tobacco leaf contour points to be deleted in the preliminary tobacco leaf contour point set, and the incomplete contour points to be deleted are deleted, thereby obtaining a tobacco leaf intermediate contour point set.
可选的,所述待删除烟叶轮廓点为所述烟叶轮廓初步点集中位于多个所述残缺轮廓点集内的轮廓点,所述待删除残缺轮廓点为多个所述残缺轮廓点集中位于所述烟叶轮廓初步点集内的轮廓点,所述待插入残缺轮廓点为多个所述残缺轮廓点集中不位于所述烟叶轮廓初步点集中的轮廓点。Optionally, the tobacco leaf contour point to be deleted is a contour point where the preliminary tobacco leaf contour points are concentrated in a plurality of the defective contour point sets, and the defective contour point to be deleted is a contour point where a plurality of the defective contour points are concentrated. Contour points in the preliminary point set of tobacco leaf contours, and the incomplete contour points to be inserted are contour points that are not located in the preliminary point set of tobacco leaf contours in a plurality of the incomplete contour point sets.
可选的,所述根据所述烟叶轮廓初步点集和多个所述残缺轮廓点集,找出待删除烟叶轮廓点、待删除残缺轮廓点和待插入残缺轮廓点包括:Optionally, finding the tobacco leaf outline points to be deleted, the incomplete outline points to be deleted, and the incomplete outline points to be inserted based on the preliminary tobacco leaf outline point set and multiple incomplete outline point sets includes:
检测每个残缺轮廓点集,删除残缺部分面积小于预设阈值的点集,得到剩余残缺轮廓点集;Detect each incomplete contour point set, delete the point set whose area of the incomplete part is smaller than the preset threshold, and obtain the remaining incomplete contour point set;
将所述烟叶轮廓初步点集中位于所述剩余残缺轮廓点集中的点,确定为待删除烟叶轮廓点;Concentrate the preliminary points of the tobacco leaf contours at the points in the concentration of the remaining incomplete contour points and determine them as the tobacco leaf contour points to be deleted;
将所述剩余残缺轮廓点集中位于所述烟叶轮廓初步点集中的点,确定为待删除残缺轮廓点;Concentrate the remaining incomplete contour points at the point in the preliminary point concentration of the tobacco leaf outline and determine it as the incomplete contour point to be deleted;
将所述剩余残缺轮廓点集中位于所述烟叶轮廓初步点集之外的点,确定为待插入残缺轮廓点。The remaining incomplete contour points are concentrated outside the preliminary point set of the tobacco leaf outline and are determined as the incomplete contour points to be inserted.
可选的,所述方法还包括:Optionally, the method also includes:
将所述烟叶中间轮廓点集所围合的内部区域设置为1、外部区域设置0,以生成对应的二值图像;Set the inner area enclosed by the middle contour point set of the tobacco leaf to 1 and the outer area to 0 to generate a corresponding binary image;
对所述二值图像进行膨胀或腐蚀调节,得到调节后的二值图像;Perform expansion or corrosion adjustment on the binary image to obtain an adjusted binary image;
对所述调节后的二值图像进行边缘检测,得到烟叶最终轮廓点集。Perform edge detection on the adjusted binary image to obtain the final tobacco leaf contour point set.
为达到上述目的,本申请还提供了一种重建烟叶轮廓的系统,包括:In order to achieve the above purpose, this application also provides a system for reconstructing the outline of tobacco leaves, including:
摄像头,用于采集烟叶图像,所述烟叶图像为将烟叶放置于拍摄仓的下方进行拍摄所得的灰度图像;A camera, used to collect tobacco leaf images. The tobacco leaf images are grayscale images obtained by placing the tobacco leaves below the shooting chamber and shooting;
图像处理装置,用于对所述烟叶图像进行烟叶轮廓检测,生成烟叶轮廓初步点集;An image processing device, configured to perform tobacco leaf contour detection on the tobacco leaf image and generate a preliminary point set of tobacco leaf contours;
所述图像处理装置,还用于对所述烟叶图像进行残缺检测,生成多个残缺部分的残缺轮廓点集;The image processing device is also used to perform incomplete detection on the tobacco leaf image and generate a set of incomplete contour points of multiple incomplete parts;
所述图像处理装置,还用于对所述烟叶轮廓初步点集和多个所述残缺轮廓点集进行残缺替换处理,得到烟叶轮廓中间轮廓点集,所述烟叶中间轮廓点集中包括重建烟叶的至少一个轮廓点。The image processing device is also used to perform incomplete replacement processing on the preliminary tobacco leaf outline point set and a plurality of the incomplete outline point sets to obtain a tobacco leaf outline intermediate outline point set, and the tobacco leaf intermediate outline point set includes the reconstructed tobacco leaf. At least one contour point.
可选的,所述图像处理装置具体用于:Optionally, the image processing device is specifically used for:
根据所述烟叶轮廓初步点集和多个所述残缺轮廓点集,找出待删除烟叶轮廓点、待删除残缺轮廓点和待插入残缺轮廓点;According to the preliminary point set of tobacco leaf contours and a plurality of the incomplete contour point sets, find the tobacco leaf outline points to be deleted, the incomplete outline points to be deleted, and the incomplete outline points to be inserted;
将所述待插入残缺轮廓点替换所述烟叶轮廓初步点集中的所述待删除烟叶轮廓点,并删除所述待删除残缺轮廓点,从而获得烟叶中间轮廓点集。The incomplete contour points to be inserted are replaced with the tobacco leaf contour points to be deleted in the preliminary tobacco leaf contour point set, and the incomplete contour points to be deleted are deleted, thereby obtaining a tobacco leaf intermediate contour point set.
可选的,所述待删除烟叶轮廓点为所述烟叶轮廓初步点集中位于多个所述残缺轮廓点集内的轮廓点,所述待删除残缺轮廓点为多个所述残缺轮廓点集中位于所述烟叶轮廓点集内的轮廓点,所述待插入残缺轮廓点为多个所述残缺轮廓点集中不位于所述烟叶轮廓初步点集中的轮廓点。Optionally, the tobacco leaf contour point to be deleted is a contour point where the preliminary tobacco leaf contour points are concentrated in a plurality of the defective contour point sets, and the defective contour point to be deleted is a contour point where a plurality of the defective contour points are concentrated. Contour points in the tobacco leaf contour point set, and the incomplete contour points to be inserted are contour points that are not located in the preliminary tobacco leaf contour point set in a plurality of the incomplete contour point sets.
可选的,所述图像处理装置具体用于:Optionally, the image processing device is specifically used for:
检测每个残缺轮廓点集,删除残缺部分面积小于预设阈值的点集,得到剩余残缺轮廓点集;Detect each incomplete contour point set, delete the point set whose area of the incomplete part is smaller than the preset threshold, and obtain the remaining incomplete contour point set;
将所述烟叶初步轮廓点集中位于所述剩余残缺轮廓点集中的点,确定为待删除烟叶轮廓点;Concentrating the preliminary contour points of the tobacco leaf at the point where the remaining incomplete contour points are concentrated is determined as the tobacco leaf contour point to be deleted;
将所述剩余残缺轮廓点集中位于所述烟叶轮廓初步点集中的点,确定为待删除残缺轮廓点;Concentrate the remaining incomplete contour points at the point in the preliminary point concentration of the tobacco leaf outline and determine it as the incomplete contour point to be deleted;
将所述剩余残缺轮廓点集中位于所述烟叶轮廓初步点集之外的点,确定为待插入残缺轮廓点。The remaining incomplete contour points are concentrated outside the preliminary point set of the tobacco leaf outline and are determined as the incomplete contour points to be inserted.
可选的,所述图像处理装置还用于:Optionally, the image processing device is also used for:
将所述烟叶中间轮廓点集所围合的内部区域设置为1、外部区域设置0,以生成对应的二值图像;Set the inner area enclosed by the middle contour point set of the tobacco leaf to 1 and the outer area to 0 to generate a corresponding binary image;
对所述二值图像进行膨胀或腐蚀调节,得到调节后的二值图像;Perform expansion or corrosion adjustment on the binary image to obtain an adjusted binary image;
对所述调节后的二值图像进行边缘检测,得到烟叶最终轮廓点集。Perform edge detection on the adjusted binary image to obtain the final tobacco leaf contour point set.
本申请还提供了一种重建烟叶轮廓的系统,该系统包括:处理器以及和处理器相连的存储器;其中,该存储器包括计算机可读指令;该处理器用于执行该存储器中的计算机可读指令,从而使得该终端设备执行上述第一方面或第一方面的任意一种可选的实施方式中的方案。This application also provides a system for reconstructing the outline of tobacco leaves. The system includes: a processor and a memory connected to the processor; wherein the memory includes computer-readable instructions; and the processor is used to execute the computer-readable instructions in the memory. , thereby causing the terminal device to execute the solution in the above first aspect or any optional implementation of the first aspect.
本申请还提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机执行上述第一方面或第一方面的任意一种可选的实施方式中的方法。This application also provides a computer-readable storage medium, which stores instructions, which when run on a computer, cause the computer to execute the above-mentioned first aspect or any one of the first optional aspects. method in the implementation.
通过实施本申请,能达到以下有益效果:能在保证烟叶原料品质的前提下,减少烟叶分拣分级工作对人员的知识经验、注意力、反应速度的依赖程度,减低工作人员的劳动强度。By implementing this application, the following beneficial effects can be achieved: on the premise of ensuring the quality of tobacco leaf raw materials, the dependence of tobacco leaf sorting and grading work on personnel's knowledge, experience, attention, and reaction speed can be reduced, and the labor intensity of workers can be reduced.
附图说明Description of drawings
图1是本申请实施例提供的一种重建烟叶轮廓的场景示意图。Figure 1 is a schematic diagram of a scene for reconstructing the outline of tobacco leaves provided by an embodiment of the present application.
图2是本申请实施例提供的一种重建烟叶轮廓方法的流程示意图。Figure 2 is a schematic flowchart of a method for reconstructing tobacco leaf contours provided by an embodiment of the present application.
图3是本申请实施例提供的一种烟叶叶面上内部残缺和外部残缺的示意图。Figure 3 is a schematic diagram of internal defects and external defects on a tobacco leaf surface provided by an embodiment of the present application.
图4是本申请实施例提供的一种检测烟叶残缺轮廓的示意图。Figure 4 is a schematic diagram of detecting the incomplete outline of tobacco leaves provided by the embodiment of the present application.
图5是本申请实施例提供的一种筛选残缺轮廓点和烟叶轮廓点的示意图。Figure 5 is a schematic diagram of screening incomplete contour points and tobacco leaf contour points provided by an embodiment of the present application.
图6是本申请实施例提供的一种调节烟叶轮廓尺寸获得烟叶最终轮廓点集的示意图。Figure 6 is a schematic diagram of adjusting the outline size of tobacco leaves to obtain the final outline point set of tobacco leaves provided by the embodiment of the present application.
图7是本申请实施例提供的一种重建烟叶轮廓系统的结构示意图。Figure 7 is a schematic structural diagram of a tobacco leaf contour reconstruction system provided by an embodiment of the present application.
具体实施方式Detailed ways
下面结合附图对本申请具体实施例作进一步的详细描述。Specific embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
请参见图1,是本申请实施例提供的一种重建烟叶轮廓的场景示意图。如图1所示的场景中包括拍摄仓101、安装于拍摄仓中的摄像头102(图示为相机)以及图像处理装置103(也可称为图像处理单元)。Please refer to Figure 1, which is a schematic diagram of a scene for reconstructing the outline of tobacco leaves provided by an embodiment of the present application. The scene shown in FIG. 1 includes a shooting cabin 101, a camera 102 (shown as a camera) installed in the shooting cabin, and an image processing device 103 (also called an image processing unit).
在拍摄过程中,本申请将烟叶以叶基在图像左侧、叶尖在图像右侧的方式放置于拍摄仓101的摄像头102下方,启用摄像头102拍摄烟叶图像,再将拍摄所得的烟叶图像传输给图像处理装置103处理。如图所示场景中,烟叶的叶基部放置在图像的左侧,即横轴最小侧;烟叶的叶尖部放置在图像的右侧,即横轴最大侧。During the shooting process, this application places the tobacco leaves under the camera 102 of the shooting chamber 101 with the leaf base on the left side of the image and the leaf tip on the right side of the image, activates the camera 102 to capture the tobacco leaf image, and then transmits the captured tobacco leaf image. to the image processing device 103 for processing. In the scene shown in the figure, the base of the tobacco leaf is placed on the left side of the image, which is the smallest side on the horizontal axis; the tip of the tobacco leaf is placed on the right side of the image, which is the largest side on the horizontal axis.
图像处理装置103接收/采集到烟叶图像后,可对烟叶图像进行烟叶轮廓检测以生成烟叶轮廓初步点集,并对烟叶图像进行残缺检测生成多个残缺部分的残缺轮廓点集,进而对烟叶轮廓初步点集和多个残缺轮廓点集进行残缺替换处理得到烟叶中间轮廓点集,该烟叶中间轮廓点集即为对存在残缺的烟叶进行残缺重建后的重建烟叶的轮廓点的集合。关于图像处理装置103如何进行烟叶轮廓重建的具体实施方式将在下文进行详述,这里不做阐述。After receiving/collecting the tobacco leaf image, the image processing device 103 can perform tobacco leaf contour detection on the tobacco leaf image to generate a preliminary tobacco leaf contour point set, and perform defective detection on the tobacco leaf image to generate a defective contour point set of multiple defective parts, and then detect the tobacco leaf contour. The preliminary point set and multiple incomplete contour point sets are subjected to incomplete replacement processing to obtain a tobacco leaf middle contour point set. The tobacco leaf middle contour point set is a set of reconstructed tobacco leaf contour points after incomplete reconstruction of the defective tobacco leaves. The specific implementation of how the image processing device 103 performs tobacco leaf contour reconstruction will be described in detail below and will not be elaborated here.
请参见图2,是本申请实施例提供的一种重建烟叶轮廓的方法的流程示意图。如图2所示的方法包括:Please refer to Figure 2, which is a schematic flow chart of a method for reconstructing the outline of tobacco leaves provided by an embodiment of the present application. The methods shown in Figure 2 include:
S201、将烟叶放置于拍摄仓的摄像头下方。S201. Place tobacco leaves under the camera in the shooting chamber.
本申请烟叶的方式并不做限定,例如图1所示将烟叶以叶基在图像左侧、叶尖在图像右侧的方式放置进行拍摄,图示中烟叶的边缘轮廓称为烟叶轮廓,烟叶的主脉曲线称为烟叶主脉。本申请涉及的烟叶图像可具体包含烟叶的叶基、叶尖、叶面以及叶面的主脉等部位信息。There is no limit to how the tobacco leaves can be used in this application. For example, as shown in Figure 1, the tobacco leaves are photographed with the leaf base on the left side of the image and the leaf tip on the right side of the image. The edge outline of the tobacco leaves in the illustration is called the tobacco leaf outline. The main vein curve is called the main vein of tobacco leaves. The tobacco leaf image involved in this application may specifically include information on the leaf base, leaf tip, leaf surface, main veins of the leaf surface, and other parts of the tobacco leaf.
S202、摄像头拍摄烟叶图像传给图像处理装置。S202. The camera captures the tobacco leaf image and transmits it to the image processing device.
本申请中,摄像头拍摄采集的烟叶图像可为灰度图像,也可为非灰度图像(例如彩色图像)。当摄像头拍摄的烟叶图像为非灰度图像时,图像处理装置或摄像头可对非灰度图像进行进一步的灰度处理,以将其处理为灰度图像,进而后续步骤对该灰度图像的烟叶图像进行主脉走势的检测。In this application, the tobacco leaf images captured by the camera may be grayscale images or non-grayscale images (for example, color images). When the tobacco leaf image captured by the camera is a non-grayscale image, the image processing device or camera can perform further grayscale processing on the non-grayscale image to process it into a grayscale image, and then the tobacco leaves of the grayscale image can be processed in subsequent steps. The image is used to detect the trend of the main vein.
S203、检测烟叶轮廓,生成烟叶轮廓初步点集(也可称为烟叶的轮廓点集或轮廓坐标点集合)。S203. Detect the tobacco leaf outline and generate a preliminary tobacco leaf outline point set (which may also be called a tobacco leaf outline point set or an outline coordinate point set).
本申请可对烟叶图像进行烟叶轮廓检测,以生成烟叶的轮廓点集。该轮廓点集中包括至少三个烟叶轮廓点的坐标。This application can perform tobacco leaf contour detection on tobacco leaf images to generate a tobacco leaf contour point set. The outline point set includes coordinates of at least three tobacco leaf outline points.
S204、检测烟叶上点的残缺,生成多个残缺轮廓点集。S204. Detect defects on points on tobacco leaves and generate multiple defect contour point sets.
本申请可对烟叶图像进行残缺边缘检测(例如使用卷积神经网络等),从而得出烟叶上的多个残缺部分的残缺轮廓点集,该残缺部分包括但不限于烟叶的内部残缺以及烟叶的外部残缺等。举例来说,请参见图3示出一种检测烟叶残缺轮廓的示意图。如图3所示,本申请可对烟叶图像的烟叶叶面进行残缺检测,以检测出烟叶叶面上的内部残缺和外部残缺。然后再对每个内部残缺和外部残缺进行边缘轮廓检测,从而得出每个内部残缺和外部残缺的残缺轮廓点集,具体可如图4所示。This application can perform incomplete edge detection on tobacco leaf images (for example, using a convolutional neural network, etc.) to obtain a set of incomplete contour points for multiple incomplete parts on the tobacco leaf. The incomplete parts include but are not limited to internal defects of the tobacco leaf and the internal defects of the tobacco leaf. External defects, etc. For example, please refer to Figure 3 which shows a schematic diagram of detecting the incomplete outline of tobacco leaves. As shown in Figure 3, this application can perform defect detection on the tobacco leaf surface of the tobacco leaf image to detect internal defects and external defects on the tobacco leaf surface. Then, edge contour detection is performed on each internal defect and external defect, thereby obtaining the defect contour point set of each internal defect and external defect, as shown in Figure 4.
S205、检测每个残缺轮廓点集,删除面积较少的点集,获得剩余残缺轮廓点集。S205. Detect each incomplete contour point set, delete the point set with a smaller area, and obtain the remaining incomplete contour point set.
本申请可检测每个残缺轮廓点集,删除残缺部分面积较小(例如小于预设阈值)的残缺轮廓点集,从而得到剩余残缺轮廓点集。This application can detect each defective contour point set, delete the defective contour point set with a smaller defective area (for example, smaller than a preset threshold), and thereby obtain the remaining defective contour point set.
S206、检测剩余残缺轮廓点集中每个点的坐标是否在烟叶轮廓初步点集内。S206. Detect whether the coordinates of each point in the remaining incomplete contour point set are within the preliminary tobacco leaf contour point set.
S207、如果剩余残缺轮廓点集中部分点的坐标在烟叶轮廓初步点集内。S207. If the coordinates of some points in the remaining incomplete outline point set are within the preliminary tobacco leaf outline point set.
S208、检测剩余残缺轮廓点集在烟叶轮廓初步点集外的点作为待插入残缺轮廓点,多个待插入残缺轮廓点形成待插入残缺轮廓点集。S208. Detect the points of the remaining incomplete contour point set outside the preliminary tobacco leaf outline point set as the incomplete contour points to be inserted, and multiple incomplete contour points to be inserted form a set of incomplete contour points to be inserted.
S209、检测剩余残缺轮廓点集在烟叶轮廓初步点集内的点作为待删除残缺轮廓点,多个待删除残缺轮廓点形成待删除残缺轮廓点集。S209. Detect the points in the remaining incomplete contour point set within the preliminary tobacco leaf outline point set as the incomplete contour points to be deleted, and multiple incomplete contour points to be deleted form a set of incomplete contour points to be deleted.
S210、检测烟叶轮廓初步点集中在剩余残缺轮廓点集内的点作为待删除烟叶轮廓点,多个待删除烟叶轮廓点形成待删除烟叶轮廓点集。S210. The preliminary points for detecting tobacco leaf contours are concentrated in the remaining incomplete contour point set as tobacco leaf contour points to be deleted, and multiple tobacco leaf contour points to be deleted form a tobacco leaf contour point set to be deleted.
具体实施时,本申请将检测的剩余残缺轮廓点集中位于烟叶轮廓初步点集内的点,作为待删除残缺轮廓点,当待删除残缺轮廓点有多个时可一起形成待删除残缺轮廓点集。本申请将检测的剩余残缺轮廓点集中不位于烟叶轮廓初步点集(即位于烟叶轮廓初步点集之外)的点作为待插入残缺轮廓点,当待插入残缺轮廓点有多个时可一起形成待插入残缺轮廓点集。将烟叶轮廓初步点集中位于剩余残缺轮廓点集中的点作为待删除烟叶轮廓点,当待删除烟叶轮廓点有多个时可一起形成待删除烟叶轮廓点集。During specific implementation, this application concentrates the detected remaining incomplete contour points on the points within the preliminary tobacco leaf contour point set as the incomplete contour points to be deleted. When there are multiple incomplete contour points to be deleted, a set of incomplete contour points to be deleted can be formed together. . In this application, the points in the detected remaining defective contour points that are not located in the preliminary point set of the tobacco leaf contour (that is, located outside the preliminary point set of the tobacco leaf contour) are used as the defective contour points to be inserted. When there are multiple defective contour points to be inserted, they can be formed together. The set of incomplete contour points to be inserted. The initial points of the tobacco leaf contour that are located in the remaining incomplete contour points are used as the tobacco leaf contour points to be deleted. When there are multiple tobacco leaf contour points to be deleted, a set of tobacco leaf contour points to be deleted can be formed together.
S211、将待插入残缺轮廓点集替换烟叶轮廓初步点集中的待删除烟叶轮廓点集。S211. Replace the set of incomplete outline points to be inserted with the set of tobacco leaf outline points to be deleted in the preliminary point set of tobacco leaf outlines.
S212、删除待删除残缺轮廓点集。S212. Delete the set of incomplete contour points to be deleted.
S213、获得烟叶中间轮廓点集。S213. Obtain the middle contour point set of tobacco leaves.
本申请使用待插入残缺轮廓点来替换烟叶轮廓初步点集中的待删除烟叶轮廓点,并同步删除所有的待删除残缺轮廓点,从而可获得烟叶中间轮廓点集。举例来说,请参见图5示出的一种筛选残缺轮廓点和烟叶轮廓点的示意图。如图5所示例子,本申请可删除所有都在烟叶轮廓初步点集内的剩余残缺轮廓的点(即删除所有的待删除烟叶轮廓点)、删除处于剩余残缺轮廓点集内部的烟叶轮廓初步点集中的(轮廓)点(即删除所有的待删除残缺轮廓点),保留处于烟叶轮廓初步点集外部的剩余残缺轮廓点集中的轮廓点(即保留所有的待插入残缺轮廓点)。This application uses the incomplete contour points to be inserted to replace the tobacco leaf contour points to be deleted in the preliminary tobacco leaf contour point set, and simultaneously deletes all the incomplete contour points to be deleted, so that the tobacco leaf intermediate contour point set can be obtained. For example, please refer to Figure 5 which shows a schematic diagram of screening incomplete contour points and tobacco leaf contour points. As shown in the example in Figure 5, this application can delete all remaining incomplete contour points that are within the preliminary point set of tobacco leaf contours (that is, delete all tobacco leaf contour points to be deleted), and delete the preliminary tobacco leaf contour points that are within the remaining incomplete contour point set. The (contour) points in the point set (i.e., delete all incomplete contour points to be deleted), and retain the contour points in the remaining incomplete contour point set outside the preliminary point set of the tobacco leaf contour (i.e., retain all the incomplete contour points to be inserted).
S214、生成以烟叶中间轮廓点集内部为1,其余为0的二值图像。S214. Generate a binary image in which the interior of the tobacco leaf middle contour point set is 1 and the rest is 0.
具体实施时,本申请可将烟叶中间轮廓点集所围合的内部区域的像素值设置为1,将围合的外部区域的像素值设置为0,从而生成其对应的二值图像。During specific implementation, this application can set the pixel value of the inner area enclosed by the middle contour point set of the tobacco leaf to 1, and set the pixel value of the enclosed outer area to 0, thereby generating its corresponding binary image.
S215、对二值图像进行膨胀或腐蚀调节,获得调节后的二值图像。S215. Perform expansion or corrosion adjustment on the binary image to obtain an adjusted binary image.
S216、对调节后的二值图像进行边缘检测,获得烟叶最终轮廓点集。S216. Perform edge detection on the adjusted binary image to obtain the final contour point set of tobacco leaves.
具体实施时,本申请可根据实际需求对二值图像进行轮廓尺寸调节,例如进行膨胀或腐蚀调节处理等,从而获得调节后的二值图像,进而对该调节后的二值图像进行边缘检测获得调节后的烟叶最终轮廓点集。请参见图6示出一种调节轮廓尺寸获得烟叶最终轮廓点集的示意图。如图6所示,图示给出烟叶中间轮廓点集和调节后烟叶最终轮廓点集的具体示意,本申请这里不再赘述。During specific implementation, this application can adjust the contour size of the binary image according to actual needs, such as performing expansion or corrosion adjustment processing, etc., thereby obtaining an adjusted binary image, and then performing edge detection on the adjusted binary image to obtain The final contour point set of the adjusted tobacco leaf. Please refer to Figure 6 , which shows a schematic diagram of adjusting the contour size to obtain the final contour point set of tobacco leaves. As shown in Figure 6, the illustration provides a specific illustration of the middle contour point set of the tobacco leaf and the final contour point set of the adjusted tobacco leaf, which will not be described in detail here.
通过实施本申请,可采集烟叶图像,所述烟叶图像为将烟叶放置于拍摄仓的下方进行拍摄所得的灰度图像;对所述烟叶图像进行烟叶轮廓检测,生成烟叶轮廓初步点集;对所述烟叶图像进行残缺检测,生成多个残缺部分的残缺轮廓点集;对所述烟叶轮廓初步点集和多个所述残缺轮廓点集进行残缺替换处理,得到烟叶轮廓中间轮廓点集,所述烟叶中间轮廓点集中包括重建烟叶的至少一个轮廓点。这样能够在不依赖于人工经验的情况下稳定可靠地检测出烟叶主脉走势,从而在保证烟叶原料品质的前提下,减少烟叶分拣分级工作对人的知识经验、注意力、反应速度的依赖程度,降低工作人员的劳动强度。By implementing this application, tobacco leaf images can be collected, and the tobacco leaf images are grayscale images obtained by placing the tobacco leaves below the shooting chamber; performing tobacco leaf contour detection on the tobacco leaf images to generate a preliminary point set of tobacco leaf contours; The tobacco leaf image is subjected to incomplete detection to generate incomplete contour point sets of multiple incomplete parts; the incomplete tobacco leaf outline point set and the multiple incomplete outline point sets are subjected to incomplete replacement processing to obtain a tobacco leaf outline intermediate contour point set. The tobacco leaf middle contour point set includes at least one contour point of the reconstructed tobacco leaf. In this way, the main vein trend of tobacco leaves can be stably and reliably detected without relying on manual experience, thereby reducing the dependence of tobacco leaf sorting and grading on human knowledge, experience, attention, and reaction speed while ensuring the quality of tobacco leaf raw materials. degree and reduce the labor intensity of staff.
请参见图7,图7是本申请实施例提供的一种重建烟叶轮廓系统的结构示意图。如图7所示的系统包括:至少一个输入设备701;至少一个输出设备702;至少一个处理器703,例如CPU;和存储器704,上述输入设备701、输出设备702、处理器703和存储器704通过总线705连接。Please refer to FIG. 7 , which is a schematic structural diagram of a tobacco leaf contour reconstruction system provided by an embodiment of the present application. The system as shown in Figure 7 includes: at least one input device 701; at least one output device 702; at least one processor 703, such as a CPU; and a memory 704. The above input device 701, output device 702, processor 703 and memory 704 pass Bus 705 connection.
其中,上述输入设备701具体可为移动终端的触控面板,包括触摸屏和触控屏,用于检测终端触控面板上的操作指令。The input device 701 may specifically be a touch panel of a mobile terminal, including a touch screen and a touch screen, and is used to detect operating instructions on the touch panel of the terminal.
上述输出设备702具体可为移动终端的显示屏,用于输出、显示信息。The above-mentioned output device 702 may specifically be a display screen of a mobile terminal, used for outputting and displaying information.
上述存储器704可以是高速RAM存储器,也可为非不稳定的存储器(non-volatilememory),例如磁盘存储器。上述存储器704用于存储一组程序代码,上述输入设备801、输出设备702和处理器703用于调用存储器704中存储的程序代码执行相应操作,其中处理器703具体用于执行如下操作:The above-mentioned memory 704 may be a high-speed RAM memory or a non-volatile memory (non-volatile memory), such as a magnetic disk memory. The above-mentioned memory 704 is used to store a set of program codes. The above-mentioned input device 801, output device 702 and processor 703 are used to call the program code stored in the memory 704 to perform corresponding operations. The processor 703 is specifically used to perform the following operations:
采集烟叶图像,所述烟叶图像为将烟叶放置于拍摄仓的下方进行拍摄所得的灰度图像;Collecting a tobacco leaf image, the tobacco leaf image is a grayscale image obtained by placing the tobacco leaf below the shooting chamber and shooting;
对所述烟叶图像进行烟叶轮廓检测,生成烟叶轮廓初步点集;Perform tobacco leaf contour detection on the tobacco leaf image to generate a preliminary point set of tobacco leaf contours;
对所述烟叶图像进行残缺检测,生成多个残缺部分的残缺轮廓点集;Perform defective detection on the tobacco leaf image to generate defective contour point sets of multiple defective parts;
对所述烟叶轮廓初步点集和多个所述残缺轮廓点集进行残缺替换处理,得到烟叶轮廓中间轮廓点集,所述烟叶中间轮廓点集中包括重建烟叶的至少一个轮廓点。Perform incomplete replacement processing on the preliminary tobacco leaf outline point set and a plurality of the incomplete contour point sets to obtain a tobacco leaf intermediate contour point set, and the tobacco leaf intermediate contour point set includes at least one contour point of the reconstructed tobacco leaf.
可选的,所述对所述烟叶轮廓初步点集和多个所述残缺轮廓点集进行残缺替换处理,得到烟叶轮廓中间轮廓点集包括:Optionally, performing incomplete replacement processing on the preliminary tobacco leaf contour point set and multiple incomplete contour point sets to obtain an intermediate tobacco leaf contour point set includes:
根据所述烟叶轮廓初步点集和多个所述残缺轮廓点集,找出待删除烟叶轮廓点、待删除残缺轮廓点和待插入残缺轮廓点;According to the preliminary point set of tobacco leaf contours and a plurality of the incomplete contour point sets, find the tobacco leaf outline points to be deleted, the incomplete outline points to be deleted, and the incomplete outline points to be inserted;
将所述待插入残缺轮廓点替换所述烟叶轮廓初步点集中的所述待删除烟叶轮廓点,并删除所述待删除残缺轮廓点,从而获得烟叶中间轮廓点集。The incomplete contour points to be inserted are replaced with the tobacco leaf contour points to be deleted in the preliminary tobacco leaf contour point set, and the incomplete contour points to be deleted are deleted, thereby obtaining a tobacco leaf intermediate contour point set.
可选的,所述待删除烟叶轮廓点为所述烟叶轮廓初步点集中位于多个所述残缺轮廓点集内的轮廓点,所述待删除残缺轮廓点为多个所述残缺轮廓点集中位于所述烟叶轮廓初步点集内的轮廓点,所述待插入残缺轮廓点为多个所述残缺轮廓点集中不位于所述烟叶轮廓初步点集中的轮廓点。Optionally, the tobacco leaf contour point to be deleted is a contour point where the preliminary tobacco leaf contour points are concentrated in a plurality of the defective contour point sets, and the defective contour point to be deleted is a contour point where a plurality of the defective contour points are concentrated. Contour points in the preliminary point set of tobacco leaf contours, and the incomplete contour points to be inserted are contour points that are not located in the preliminary point set of tobacco leaf contours in a plurality of the incomplete contour point sets.
可选的,所述根据所述烟叶轮廓初步点集和多个所述残缺轮廓点集,找出待删除烟叶轮廓点、待删除残缺轮廓点和待插入残缺轮廓点包括:Optionally, finding the tobacco leaf outline points to be deleted, the incomplete outline points to be deleted, and the incomplete outline points to be inserted based on the preliminary tobacco leaf outline point set and multiple incomplete outline point sets includes:
检测每个残缺轮廓点集,删除残缺部分面积小于预设阈值的点集,得到剩余残缺轮廓点集;Detect each incomplete contour point set, delete the point set whose area of the incomplete part is smaller than the preset threshold, and obtain the remaining incomplete contour point set;
将所述烟叶轮廓初步点集中位于所述剩余残缺轮廓点集中的点,确定为待删除烟叶轮廓点;Concentrate the preliminary points of the tobacco leaf contours at the points in the concentration of the remaining incomplete contour points and determine them as the tobacco leaf contour points to be deleted;
将所述剩余残缺轮廓点集中位于所述烟叶轮廓初步点集中的点,确定为待删除残缺轮廓点;Concentrate the remaining incomplete contour points at the point in the preliminary point concentration of the tobacco leaf outline and determine it as the incomplete contour point to be deleted;
将所述剩余残缺轮廓点集中位于所述烟叶轮廓初步点集之外的点,确定为待插入残缺轮廓点。The remaining incomplete contour points are concentrated outside the preliminary point set of the tobacco leaf outline and are determined as the incomplete contour points to be inserted.
可选的,所述处理器703还用于:Optionally, the processor 703 is also used to:
将所述烟叶中间轮廓点集所围合的内部区域设置为1、外部区域设置0,以生成对应的二值图像;Set the inner area enclosed by the middle contour point set of the tobacco leaf to 1 and the outer area to 0 to generate a corresponding binary image;
对所述二值图像进行膨胀或腐蚀调节,得到调节后的二值图像;Perform expansion or corrosion adjustment on the binary image to obtain an adjusted binary image;
对所述调节后的二值图像进行边缘检测,得到烟叶最终轮廓点集。Perform edge detection on the adjusted binary image to obtain the final tobacco leaf contour point set.
基于同一发明构思,本申请实施例中提供的终端设备解决问题的原理与本申请方法实施例中控制器解决问题的原理相似,因此各设备的实施可以参见方法的实施,为简洁描述,在这里不再赘述。Based on the same inventive concept, the problem-solving principle of the terminal device provided in the embodiment of the present application is similar to the problem-solving principle of the controller in the method embodiment of the present application. Therefore, the implementation of each device can be referred to the implementation of the method. For the sake of concise description, here No longer.
需要说明的是,在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详细描述的部分,可以参见其他实施例的相关描述。It should be noted that in the above embodiments, each embodiment has its own emphasis in description. For parts that are not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
本发明实施例方法中的步骤可以根据实际需要进行顺序调整、合并和删减。The steps in the methods of the embodiments of the present invention can be sequence adjusted, combined, and deleted according to actual needs.
本发明实施例终端设备中的模块可以根据实际需要进行合并、划分和删减。Modules in the terminal device according to the embodiment of the present invention can be merged, divided and deleted according to actual needs.
最后应说明的是:以上各实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述各实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present application, but not to limit it; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: The technical solutions described in the foregoing embodiments can still be modified, or some or all of the technical features can be equivalently replaced; and these modifications or substitutions do not deviate from the essence of the corresponding technical solutions from the technical solutions of the embodiments of the present application. scope.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202110291877.0ACN113066095B (en) | 2021-03-18 | 2021-03-18 | Method, system and computer readable storage medium for reconstructing tobacco leaf profile |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202110291877.0ACN113066095B (en) | 2021-03-18 | 2021-03-18 | Method, system and computer readable storage medium for reconstructing tobacco leaf profile |
| Publication Number | Publication Date |
|---|---|
| CN113066095A CN113066095A (en) | 2021-07-02 |
| CN113066095Btrue CN113066095B (en) | 2024-02-23 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202110291877.0AActiveCN113066095B (en) | 2021-03-18 | 2021-03-18 | Method, system and computer readable storage medium for reconstructing tobacco leaf profile |
| Country | Link |
|---|---|
| CN (1) | CN113066095B (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114299299B (en)* | 2021-11-29 | 2024-01-23 | 苏州浪潮智能科技有限公司 | Tree leaf feature extraction method and device, computer equipment and storage medium |
| CN116630397A (en)* | 2023-06-19 | 2023-08-22 | 天昌国际烟草有限公司 | Tobacco leaf grading method, device, equipment and storage medium |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US4327375A (en)* | 1979-04-11 | 1982-04-27 | Service D'exploitation Industrielle Des Tabacs Et Des Allumettes | Process and apparatus for providing data indicative of the shape of leaf-like article |
| CN103077529A (en)* | 2013-02-27 | 2013-05-01 | 电子科技大学 | System for analyzing plant leaf features based on image scanning |
| CN105447910A (en)* | 2015-12-31 | 2016-03-30 | 河北工业大学 | Method for three-dimensional reconstruction of defected part of tip of aeroengine compressor blade |
| CN109242791A (en)* | 2018-08-22 | 2019-01-18 | 东北农业大学 | A kind of batch restorative procedure for damaged plant leaf blade |
| CN110378866A (en)* | 2019-05-22 | 2019-10-25 | 中国水利水电科学研究院 | A kind of canal lining breakage image recognition methods based on unmanned plane inspection |
| CN111852753A (en)* | 2020-07-21 | 2020-10-30 | 上海扩博智能技术有限公司 | Method, system, equipment and storage medium for fitting surface contour line of fan blade |
| AU2020103131A4 (en)* | 2020-10-30 | 2021-01-07 | Nanjing Forestry University | Leaf surface reconstruction and physically based deformation simulation based on the point cloud data |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| DE102009023896B4 (en)* | 2009-06-04 | 2015-06-18 | Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. | Apparatus and method for detecting a plant |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US4327375A (en)* | 1979-04-11 | 1982-04-27 | Service D'exploitation Industrielle Des Tabacs Et Des Allumettes | Process and apparatus for providing data indicative of the shape of leaf-like article |
| CN103077529A (en)* | 2013-02-27 | 2013-05-01 | 电子科技大学 | System for analyzing plant leaf features based on image scanning |
| CN105447910A (en)* | 2015-12-31 | 2016-03-30 | 河北工业大学 | Method for three-dimensional reconstruction of defected part of tip of aeroengine compressor blade |
| CN109242791A (en)* | 2018-08-22 | 2019-01-18 | 东北农业大学 | A kind of batch restorative procedure for damaged plant leaf blade |
| CN110378866A (en)* | 2019-05-22 | 2019-10-25 | 中国水利水电科学研究院 | A kind of canal lining breakage image recognition methods based on unmanned plane inspection |
| CN111852753A (en)* | 2020-07-21 | 2020-10-30 | 上海扩博智能技术有限公司 | Method, system, equipment and storage medium for fitting surface contour line of fan blade |
| AU2020103131A4 (en)* | 2020-10-30 | 2021-01-07 | Nanjing Forestry University | Leaf surface reconstruction and physically based deformation simulation based on the point cloud data |
| Title |
|---|
| 基于典型叶片模板自动匹配的虫损叶面积测量;钟取发;周平;付斌斌;刘科文;;农业工程学报;20100331;26(03);第216-221页* |
| 计算机视觉和智能识别技术在烤烟烟叶分级中的应用;王戈;丁冉;徐玮杰;杨凯;;计算机与应用化学;20191028(05);第548-553页* |
| Publication number | Publication date |
|---|---|
| CN113066095A (en) | 2021-07-02 |
| Publication | Publication Date | Title |
|---|---|---|
| CN109613002B (en) | Glass defect detection method and device and storage medium | |
| CN111797890A (en) | A method and system for detecting defects in transmission line equipment | |
| CN108492291B (en) | CNN segmentation-based solar photovoltaic silicon wafer defect detection system and method | |
| CN117392042A (en) | Defect detection method, defect detection apparatus, and storage medium | |
| CN113066095B (en) | Method, system and computer readable storage medium for reconstructing tobacco leaf profile | |
| CN109142366A (en) | Spherical shell defect detection method and device and computer readable storage medium | |
| CN109087286A (en) | A kind of detection method and application based on Computer Image Processing and pattern-recognition | |
| CN116245876B (en) | Defect detection method, device, electronic apparatus, storage medium, and program product | |
| CN107490582A (en) | A kind of streamline Work Piece Verification System Based | |
| CN108230315A (en) | A kind of respirator belt missing detection method based on machine vision | |
| CN105931246A (en) | Fabric flaw detection method based on wavelet transformation and genetic algorithm | |
| CN118587208B (en) | A method and system for visually detecting defects on optical fiber drawing surface | |
| CN114486916A (en) | Defect detection method of mobile phone glass cover based on machine vision | |
| CN106127193A (en) | A kind of facial image recognition method | |
| CN115601735B (en) | Empty disk identification device and method | |
| CN118279307B (en) | Semiconductor device material defect detection method and system | |
| CN115294039A (en) | Steel coil end surface defect detection method | |
| CN115100110A (en) | Defect detection method, device and equipment for polarized lens and readable storage medium | |
| CN115719326A (en) | PCB defect detection method and device | |
| CN113052811B (en) | Method, system and computer readable storage medium for detecting leaf tip serration degree of tobacco leaf | |
| CN117853434A (en) | Fiber prepreg crack defect detection method and system based on OpenCV | |
| CN107833222B (en) | Nonmetal part surplus detection device and method | |
| CN102693536B (en) | A kind of defect area extracting method | |
| CN113052808B (en) | Method, system and computer readable storage medium for detecting main pulse trend of tobacco leaves | |
| CN117197788A (en) | A method and device for second-hand mobile phone quality inspection based on image recognition |
| 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 | ||
| CB03 | Change of inventor or designer information | Inventor after:Ding Ran Inventor after:Xu Weijie Inventor after:Zhang Xin Inventor after:Wang Ge Inventor after:Dai Zeyuan Inventor after:Jiang Wenjun Inventor after:Mao Yuzhong Inventor after:Zhang Wei Inventor after:Xu Kaicheng Inventor before:Jiang Wenjun Inventor before:Mao Yuzhong Inventor before:Zhang Wei Inventor before:Xu Kaicheng | |
| CB03 | Change of inventor or designer information | ||
| TA01 | Transfer of patent application right | Effective date of registration:20211228 Address after:200082 No. 717, Changyang Road, Shanghai, Yangpu District Applicant after:SHANGHAI TOBACCO GROUP Co.,Ltd. Applicant after:SHANGHAI WISDOM INFORMATION TECHNOLOGY CO.,LTD. Address before:Room 1602, Zhongshan Wanbo Plaza, 666 Huaihai West Road, Changning District, Shanghai, 200052 Applicant before:SHANGHAI WISDOM INFORMATION TECHNOLOGY CO.,LTD. | |
| TA01 | Transfer of patent application right | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |