[go: up one dir, main page]

CN116797544B - Surface defect extraction method for fruit and vegetable post-harvest treatment equipment - Google Patents

Surface defect extraction method for fruit and vegetable post-harvest treatment equipment Download PDF

Info

Publication number
CN116797544B
CN116797544B CN202310549845.5A CN202310549845A CN116797544B CN 116797544 B CN116797544 B CN 116797544B CN 202310549845 A CN202310549845 A CN 202310549845A CN 116797544 B CN116797544 B CN 116797544B
Authority
CN
China
Prior art keywords
card number
color card
color
threshold
probability
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.)
Active
Application number
CN202310549845.5A
Other languages
Chinese (zh)
Other versions
CN116797544A (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.)
Lvmeng Technology Co ltd
Original Assignee
Lvmeng Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Lvmeng Technology Co ltd filed Critical Lvmeng Technology Co ltd
Priority to CN202310549845.5A priority Critical patent/CN116797544B/en
Publication of CN116797544A publication Critical patent/CN116797544A/en
Application granted granted Critical
Publication of CN116797544B publication Critical patent/CN116797544B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Image Analysis (AREA)

Abstract

The invention discloses a surface defect extraction method for fruit and vegetable post-harvest processing equipment, which comprises the steps of obtaining three optimized thresholds for dividing four color card number sets by maximizing color card number three-threshold maximum inter-class variance weighted by comprehensive adjacent color card number average element difference mutual information quantity and maximum probability color card number average element difference mutual information quantity of four color card number sets of background, mature, immature and surface defects, and then comparing color card numbers corresponding to element combinations of all pixel points in an image with the three optimized thresholds to finish the division of the four color card number sets so as to realize the surface defect extraction for the fruit and vegetable post-harvest processing equipment.

Description

一种面向果蔬采后处理装备的表面缺陷提取方法A surface defect extraction method for fruit and vegetable post-harvest processing equipment

技术领域Technical Field

本发明属于果蔬采后处理技术领域,具体涉及通过对于背景、成熟、未成熟和表面缺陷四个色卡编号集合的综合相邻色卡编号平均要素差异互信息量和最大概率色卡编号平均要素差异互信息量加权的色卡编号三阈值最大类间方差最大化从而得到划分四个色卡编号集合的三个优化阈值,从而分割出果蔬采后处理装备给出的果蔬彩色图像中背景、成熟、未成熟和表面缺陷相关区域以完成表面缺陷提取工作。The invention belongs to the technical field of post-harvest processing of fruits and vegetables, and specifically relates to maximizing the maximum inter-class variance of three threshold values of color card numbers weighted by comprehensive mutual information of average element differences of adjacent color card numbers and mutual information of average element differences of maximum probability color card numbers for four color card number sets of background, maturity, immaturity and surface defects, thereby obtaining three optimized threshold values for dividing the four color card number sets, thereby segmenting the background, maturity, immaturity and surface defect related areas in the fruit and vegetable color image given by post-harvest processing equipment of fruits and vegetables to complete the surface defect extraction work.

背景技术Background Art

在果蔬采后分选过程中对果蔬图像进行处理时,通常只对其中的某些部分感兴趣,可把这些兴趣点聚焦的区域定义为目标区域(也叫前景区域)。在多数情况下,目标区域具有某些共同特性,而其余的部分则为背景区域。只有将目标从背景中分离并提取出特性,才能对其加以识别和分析,进而对目标进行更深层次的应用。在模式识别和机器视觉系统中,图像分割的重要性毋容置疑,是进一步理解图像的基础。图像处理中许多至关重要的后续任务,如特征提取、图像分析、模式识别、图像理解等都是基于图像分割技术的操作。国内外众多学者先后提出了形形色色的分割算法,其中基于阈值的分割法由于具有阈值计算难度小、鲁棒性强等优点,故备受研究人员的关注和喜爱。来自日本的研究者大津展之基于类间方差最大的原理提出了一种新的阈值分割法(简称Otsu法),被认定为是图像阈值分割技术中的经典算法。Otsu法具有计算量较小且不因图像亮度或对比度的变化而剧烈变化的特性。When processing fruit and vegetable images during the post-harvest sorting process, people are usually only interested in certain parts of them. The areas where these points of interest are focused can be defined as target areas (also called foreground areas). In most cases, the target area has certain common characteristics, while the rest is the background area. Only by separating the target from the background and extracting its characteristics can it be identified and analyzed, and then the target can be applied at a deeper level. In pattern recognition and machine vision systems, the importance of image segmentation is unquestionable and is the basis for further understanding of images. Many important subsequent tasks in image processing, such as feature extraction, image analysis, pattern recognition, and image understanding, are based on image segmentation technology. Many scholars at home and abroad have proposed various segmentation algorithms. Among them, the threshold-based segmentation method has attracted much attention and love from researchers because of its advantages such as low threshold calculation difficulty and strong robustness. A Japanese researcher named Otsu Hideyuki proposed a new threshold segmentation method (referred to as Otsu method) based on the principle of maximum inter-class variance, which is recognized as a classic algorithm in image threshold segmentation technology. The Otsu method has the characteristics of small computational complexity and does not change dramatically due to changes in image brightness or contrast.

LAB颜色模型由三个要素组成,一个要素是亮度(L),A和B是两个颜色通道,其中A包括的颜色是从深绿色(低亮度值)到灰色(中亮度值)再到亮粉红色(高亮度值),B是从亮蓝色(底亮度值)到灰色(中亮度值)再到黄色(高亮度值)。The LAB color model consists of three elements, one of which is brightness (L). A and B are two color channels, where A includes colors ranging from dark green (low brightness value) to gray (medium brightness value) to bright pink (high brightness value), and B includes colors ranging from bright blue (low brightness value) to gray (medium brightness value) to yellow (high brightness value).

潘通(PANTONE)色卡为国际通用的标准色卡,涵盖印刷、纺织、塑胶、绘图、数码科技等领域的色彩沟通系统,已经成为当今交流色彩信息的国际统一标准语言。PANTONE的每个颜色都是有其唯一的编号的,比如PANTONE印刷色卡中颜色的编号就是以3位数字或4位数字加字母C或U构成的,例pantone 100c或100u,或pantone 1205C或1205U.字母C的意思是表示这个颜色在铜版纸上的表现,字母U表示是这个颜色在胶版纸上的表现。The Pantone color card is an internationally used standard color card, covering the color communication system in the fields of printing, textiles, plastics, drawing, digital technology, etc., and has become the international unified standard language for exchanging color information today. Each PANTONE color has its own unique number. For example, the color number in the PANTONE printing color card is composed of 3 or 4 digits plus the letter C or U, such as pantone 100c or 100u, or pantone 1205C or 1205U. The letter C means the performance of this color on coated paper, and the letter U means the performance of this color on offset paper.

考虑到果蔬采后处理装备中图像处理的复杂性和实时性,对于实际应用中的图像信息包含了成熟色泽、未熟色泽和表面缺陷等海量数据,因此从阈值集合中选定一组科学且合理的阈值,其时间消耗相当大。可见,可面向果蔬采后处理装备的具体应用层面进行设计,将有利于丰富拓展表面缺陷提取方法的内涵。Considering the complexity and real-time nature of image processing in fruit and vegetable post-harvest processing equipment, the image information in practical applications contains a large amount of data such as ripe color, unripe color, and surface defects. Therefore, it takes a lot of time to select a set of scientific and reasonable thresholds from the threshold set. It can be seen that the design can be carried out at the specific application level of fruit and vegetable post-harvest processing equipment, which will be conducive to enriching and expanding the connotation of surface defect extraction methods.

发明内容Summary of the invention

本发明的目的在于将果蔬采后处理装备给出需进行表面缺陷提取的果蔬彩色图像中的像素点对应的要素组合对应划分归类为背景、成熟、未成熟、表面缺陷4个色卡编号集合后,确定对于四个色卡编号集合的综合相邻色卡编号平均要素差异互信息量和最大概率色卡编号平均要素差异互信息量加权的色卡编号三阈值最大类间方差,而后将该像素点的要素组合对应的色卡编号与步骤2中划分四个色卡编号集合的三个优化阈值进行比较从而确定对应的色卡编号集合编号,完成4个色卡编号集合的划分从而实现面向果蔬采后处理装备的表面缺陷提取;The purpose of the present invention is to classify the element combination corresponding to the pixel points in the fruit and vegetable color image that needs to be extracted for surface defects given by the fruit and vegetable post-harvest processing equipment into four color card number sets of background, mature, immature, and surface defects, determine the maximum inter-class variance of the color card number three thresholds weighted by the average element difference mutual information of the comprehensive adjacent color card numbers and the average element difference mutual information of the maximum probability color card number for the four color card number sets, and then compare the color card number corresponding to the element combination of the pixel point with the three optimized thresholds for dividing the four color card number sets in step 2 to determine the corresponding color card number set number, complete the division of the four color card number sets, and thus realize the surface defect extraction for the fruit and vegetable post-harvest processing equipment;

为实现上述目的,本发明提出的技术方案如下:To achieve the above purpose, the technical solution proposed by the present invention is as follows:

一种面向果蔬采后处理装备的表面缺陷提取方法,方法包含如下步骤:A surface defect extraction method for fruit and vegetable post-harvest processing equipment, the method comprising the following steps:

步骤1:对于果蔬采后处理装备给出需进行表面缺陷提取的果蔬彩色图像,将该果蔬彩色图像中的各个像素点按照某个颜色模型进行亮度归一化后输出该颜色模型三个要素对应的某种色卡编号,设定得到的色卡编号可划分归类为背景、成熟、未成熟、表面缺陷四个色卡编号集合,给出四个色卡编号集合产生的概率和对应的要素平均值,给出不同色卡编号集合共同产生的概率和对应的要素平均值,通过某个色卡编号集合与下一个色卡编号集合在色卡编号差别在限定条件内时给出相邻色卡编号平均要素差异互信息量,通过某个色卡编号集合与另外一个色卡编号集合各自在图像中像素点的概率最大时的色卡编号给出最大概率色卡编号平均要素差异互信息量,确定对于四个色卡编号集合的综合相邻色卡编号平均要素差异互信息量和最大概率色卡编号平均要素差异互信息量加权的色卡编号三阈值最大类间方差;Step 1: For the fruit and vegetable post-harvest processing equipment, a color image of fruits and vegetables that needs to be extracted for surface defects is given. After the brightness of each pixel in the color image of fruits and vegetables is normalized according to a certain color model, a certain color card number corresponding to the three elements of the color model is output. The obtained color card number is set to be classified into four color card number sets: background, mature, immature, and surface defects. The probability of the four color card number sets and the corresponding element average values are given. The probability of different color card number sets being jointly generated and the corresponding element average values are given. The mutual information of the average element difference of adjacent color card numbers is given when the color card number difference between a certain color card number set and the next color card number set is within the specified conditions. The color card number when the probability of each pixel point in the image of a certain color card number set and another color card number set is the largest is given. The maximum inter-class variance of the three thresholds of the color card number weighted by the comprehensive mutual information of the average element difference of adjacent color card numbers and the mutual information of the average element difference of the maximum probability color card number for the four color card number sets is determined;

步骤2:通过在三个色卡编号以往历史阈值作为初始值的基础上,将阈值组合不断增减色卡编号阈值变化量与循环过程计数的乘积来归入阈值排列组合集合并将计算结果归入色卡编号三阈值最大类间方差数值集合,若色卡编号三阈值最大类间方差数值集合不再新增更大的数值,则色卡编号三阈值最大类间方差数值集合中最大的数值对应的阈值组合则为划分四个色卡编号集合的三个优化阈值;Step 2: Based on the historical threshold values of the three color card numbers as the initial values, the threshold combinations are continuously increased or decreased by the product of the color card number threshold changes and the cycle process count to be classified into the threshold permutation combination set and the calculation results are classified into the color card number three-threshold maximum inter-class variance value set. If the color card number three-threshold maximum inter-class variance value set does not add a larger value, then the threshold combination corresponding to the largest value in the color card number three-threshold maximum inter-class variance value set is the three optimized thresholds for dividing the four color card number sets;

步骤3:对于图像中的像素点,可将该像素点的要素组合对应的色卡编号与步骤2中划分四个色卡编号集合的三个优化阈值进行比较从而确定对应的色卡编号集合编号,而后输出图像中所有像素点对应的色卡编号集合编号以完成四个色卡编号集合的划分从而提取出表面缺陷;Step 3: For the pixel points in the image, the color card number corresponding to the element combination of the pixel point can be compared with the three optimized thresholds for dividing the four color card number sets in step 2 to determine the corresponding color card number set number, and then the color card number set numbers corresponding to all the pixel points in the image are output to complete the division of the four color card number sets to extract the surface defects;

进一步地,步骤1中,所述将该果蔬彩色图像中的各个像素点按照某个颜色模型进行亮度归一化后输出该颜色模型三个要素对应的某种色卡编号,设定得到的色卡编号可划分归类为背景、成熟、未成熟、表面缺陷4个色卡编号集合具体为:设果蔬彩色图像中按照某一颜色模型进行亮度归一化后的要素组合(l,a,b)对应的色卡编号可从其中,l,a,b分别为果蔬彩色图像中的像素点按该颜色模型给出的三个要素的取值,分别为果蔬彩色图像中色卡编号最小的颜色对应的三个要素的取值,分别为果蔬彩色图像中色卡编号最大的颜色对应的三个要素的取值,并划分为Ω1、Ω2、Ω3和Ω4共计4个色卡编号集合,所述4个色卡编号集合可表征为背景、成熟、未成熟、表面缺陷,具体形式如下:Furthermore, in step 1, the brightness of each pixel in the fruit and vegetable color image is normalized according to a certain color model, and then a certain color card number corresponding to the three elements of the color model is output. The color card number obtained can be divided into four color card number sets of background, ripe, immature, and surface defects. Specifically, the color card number corresponding to the element combination (l, a, b) after brightness normalization according to a certain color model in the fruit and vegetable color image can be obtained from arrive Among them, l, a, and b are the values of the three elements given by the color model for the pixel points in the fruit and vegetable color image. are the values of the three elements corresponding to the color with the smallest color card number in the fruit and vegetable color image, They are the values of the three elements corresponding to the color with the largest color card number in the fruit and vegetable color image, and are divided into 4 color card number sets, Ω 1 , Ω 2 , Ω 3 and Ω 4. The 4 color card number sets can be characterized as background, ripe, immature and surface defects. The specific forms are as follows:

Ω2={Γ(x1,y1,z1)+1,...,Γ(x2,y2,z2)}Ω 2 ={Γ(x 1 ,y 1 ,z 1 )+1,...,Γ(x 2 ,y 2 ,z 2 )}

Ω3={Γ(x2,y2,z2)+1,...,Γ(x3,y3,z3)}Ω 3 ={Γ(x 2 ,y 2 ,z 2 )+1,...,Γ(x 3 ,y 3 ,z 3 )}

其中,Γ为输入要素组合而输出色卡编号的函数,(x1,y1,z1)、(x2,y2,z2)和(x3,y3,z3)为划分Ω1、Ω2、Ω3和Ω44个色卡编号集合的色卡编号对应的要素组合;Wherein, Γ is a function that inputs a combination of elements and outputs a color card number, (x 1 , y 1 , z 1 ), (x 2 , y 2 , z 2 ) and (x 3 , y 3 , z 3 ) are element combinations corresponding to the color card numbers that divide the four color card number sets of Ω 1 , Ω 2 , Ω 3 and Ω 4 ;

进一步地,步骤1中,所述给出四个色卡编号集合产生的概率和对应的要素平均值具体为:所述Ω1、Ω2、Ω3和Ω44个色卡编号集合产生的概率分别为κ1、κ2、κ3和κ4,具体形式如下:Furthermore, in step 1, the probabilities of generating the four color card number sets and the corresponding element average values are specifically: the probabilities of generating the four color card number sets Ω 1 , Ω 2 , Ω 3 and Ω 4 are κ 1 , κ 2 , κ 3 and κ 4 respectively, and the specific form is as follows:

其中,i∈[1,2,3,4],ε(l,a,b)为要素组合(l,a,b)在图像中像素点的概率;Among them, i∈[1,2,3,4], ε (l,a,b) is the probability of the element combination (l,a,b) at the pixel point in the image;

对应Ω1、Ω2、Ω3和Ω44个色卡编号集合的要素平均值分别为Υ1、Υ2、Υ3和Υ4,具体形式如下:The element average values corresponding to the four color card number sets Ω 1 , Ω 2 , Ω 3 and Ω 4 are Υ 1 , Υ 2 , Υ 3 and Υ 4 , respectively. The specific forms are as follows:

其中,α、β和γ分别为要素L、A和B在要素平均值的权重系数;Among them, α, β and γ are the weight coefficients of factors L, A and B in the average value of factors respectively;

进一步地,步骤1中,所述给出不同色卡编号集合共同产生的概率和对应的要素平均值具体为:Ω1和Ω2共同产生的概率为κ1,2,Ω1和Ω3共同产生的概率为κ1,3,Ω1和Ω2共同产生的概率为κ1,4,Ω1和Ω2共同产生的概率为κ1,3,Ω1和Ω4共同产生的概率为κ1,4,Ω2和Ω3共同产生的概率为κ2,3,Ω2和Ω4共同产生的概率为κ2,4,Ω3和Ω4共同产生的概率为κ3,4,具体形式如下:Further, in step 1, the probabilities of different sets of color card numbers being jointly generated and the corresponding element average values are specifically: the probability of Ω 1 and Ω 2 being jointly generated is κ 1,2 , the probability of Ω 1 and Ω 3 being jointly generated is κ 1,3 , the probability of Ω 1 and Ω 2 being jointly generated is κ 1,4 , the probability of Ω 1 and Ω 2 being jointly generated is κ 1,3 , the probability of Ω 1 and Ω 4 being jointly generated is κ 1,4 , the probability of Ω 2 and Ω 3 being jointly generated is κ 2,3 , the probability of Ω 2 and Ω 4 being jointly generated is κ 2,4 , and the probability of Ω 3 and Ω 4 being jointly generated is κ 3,4 , and the specific form is as follows:

其中,i,j∈[1,2,3,4],i≠j且i<j;Among them, i,j∈[1,2,3,4], i≠j and i<j;

Ωi和Ωj共同对应的要素平均值分别为Ψi,j,其中,i,j∈[1,2,3,4],i≠j且i<j,具体形式如下:The average values of the elements corresponding to Ω i and Ω j are Ψ i,j , where i,j∈[1,2,3,4], i≠j and i<j. The specific form is as follows:

进一步地,步骤1中,所述通过某个色卡编号集合与下一个色卡编号集合在色卡编号差别在限定条件内时给出相邻色卡编号平均要素差异互信息量具体为:对于满足i,j∈[1,2,3,4]且i+1=j的Ωi和Ωj,设定相邻色卡编号差别的限定值为k,则通过Ωi中任意色卡编号Γ(x,y,z)与相邻的Ωj中任意色卡编号Γ(x′,y′,z′)可计算出限定条件Γ(x,y,z)-Γ(x′,y′,z′)≤k内对于Ωi和Ωj的相邻色卡编号平均要素差异互信息量ξi,j,k,具体形式如下:Further, in step 1, the mutual information of average element difference between adjacent color card numbers is given by a certain color card number set and the next color card number set when the color card number difference is within the limited condition: for Ω i and Ω j satisfying i, j∈[1,2,3,4] and i+1= j , the limited value of the difference between adjacent color card numbers is set to k, then any color card number Γ(x,y,z) in Ω i and any color card number Γ(x′,y′,z′) in the adjacent Ω j can be calculated within the limited condition Γ(x,y,z)-Γ(x′,y′,z′)≤k for the mutual information of average element difference between adjacent color card numbers ξ i,j,k for Ω i and Ω j , and the specific form is as follows:

其中,为任意的符号;in, is any symbol;

进一步地,步骤1中,所述通过某个色卡编号集合与另外一个色卡编号集合各自在图像中像素点的概率最大时的色卡编号给出最大概率色卡编号平均要素差异互信息量具体为:对于满足i,j∈[1,2,3,4]且j>i+1的Ωi和Ωj,可通过Ωi中像素点的概率最大时的色卡编号Γ(xi,yi,zi)与Ωj中像素点的概率最大时的色卡编号Γ(xj,yj,zj)可计算出对于Ωi和Ωj的最大概率色卡编号平均要素差异互信息量具体形式如下:Further, in step 1, the maximum probability color card number average element difference mutual information is given by the color card number when the probability of the pixel point in the image of a certain color card number set and another color card number set is the maximum: for Ω i and Ω j satisfying i, j∈[1,2,3,4] and j>i+1, the maximum probability color card number average element difference mutual information for Ω i and Ω j can be calculated by the color card number Γ(x i ,y i ,z i ) when the probability of the pixel point in Ω i is the maximum and the color card number Γ ( x j ,y j ,z j ) when the probability of the pixel point in Ω j is the maximum The specific form is as follows:

其中, in,

进一步地,步骤1中,所述确定对于四个色卡编号集合的综合相邻色卡编号平均要素差异互信息量和最大概率色卡编号平均要素差异互信息量加权的色卡编号三阈值最大类间方差具体为:确定对于Ω1、Ω2、Ω3和Ω4的相邻色卡编号平均要素差异互信息量ξi,j,k和最大概率色卡编号平均要素差异互信息量加权的色卡编号三阈值最大类间方差为σ2[Γ(x1,y1,z1),Γ(x2,y2,z2),Γ(x3,y3,z3)],具体形式如下:Further, in step 1, the method of determining the weighted three-threshold maximum inter-class variance of the color card number of the comprehensive adjacent color card number average element difference mutual information and the maximum probability color card number average element difference mutual information for the four color card number sets is specifically as follows: determining the adjacent color card number average element difference mutual information ξ i,j,k and the maximum probability color card number average element difference mutual information for Ω 1 , Ω 2 , Ω 3 and Ω 4 The maximum inter-class variance of the weighted three-threshold color card number is σ 2 [Γ(x 1 ,y 1 ,z 1 ),Γ(x 2 ,y 2 ,z 2 ),Γ(x 3 ,y 3 ,z 3 )], and the specific form is as follows:

其中,Θ1={(1,2),(2,3),(3,4)},Θ2={(1,3),(1,4),(2,4)};Among them, Θ 1 ={(1,2),(2,3),(3,4)}, Θ 2 ={(1,3),(1,4),(2,4)};

进一步地,步骤2中具体包括:Furthermore, step 2 specifically includes:

步骤2.1:将三个色卡编号以往历史阈值作为当前果蔬彩色图像处理中色卡编号阈值Γ(x1,y1,z1)、Γ(x2,y2,z2)和Γ(x3,y3,z3)的初始值,设定色卡编号阈值变化量为Δ,循环过程计数t为0,将(Γ(x1,y1,z1),Γ(x2,y2,z2),Γ(x3,y3,z3))阈值组合归入阈值排列组合集合ν(t=0)中,根据步骤1中所述的色卡编号三阈值最大类间方差的具体形式来计算ν(t=0)中的阈值组合,并将计算结果归入色卡编号三阈值最大类间方差数值集合υ(t=0)中;Step 2.1: Number the three color cards to the historical thresholds and As the initial values of the color card number thresholds Γ(x 1 ,y 1 ,z 1 ), Γ(x 2 ,y 2 ,z 2 ) and Γ(x 3 ,y 3 ,z 3 ) in the current fruit and vegetable color image processing, the color card number threshold change is set to Δ, the loop process count t is 0, the threshold combination (Γ(x 1 ,y 1 ,z 1 ),Γ(x 2 ,y 2 ,z 2 ),Γ(x 3 ,y 3 ,z 3 )) is included in the threshold permutation combination set ν(t=0), the threshold combination in ν(t=0) is calculated according to the specific form of the maximum inter-class variance of the three thresholds of the color card number described in step 1, and the calculation result is included in the maximum inter-class variance value set υ(t=0) of the three thresholds of the color card number;

步骤2.2:将t加1后代替原先的t,设中间变量θ取值为Δ·t或0,将(Γ(x1,y1,z1)±θ,Γ(x2,y2,z2)±θ,Γ(x3,y3,z3)±θ)阈值组合归入阈值排列组合集合ν(t)中;Step 2.2: Add 1 to t instead of the original t, set the intermediate variable θ to Δ·t or 0, and classify the threshold combinations (Γ(x 1 ,y 1 ,z 1 )±θ,Γ(x 2 ,y 2 ,z 2 )±θ,Γ(x 3 ,y 3 ,z 3 )±θ) into the threshold permutation combination set ν(t);

步骤2.3:根据步骤1中所述的色卡编号三阈值最大类间方差的具体形式来计算所述ν(t)中的阈值组合,并将计算结果归入色卡编号三阈值最大类间方差数值集合υ(t)中;Step 2.3: Calculate the threshold combination in ν(t) according to the specific form of the maximum inter-class variance of the three thresholds of the color card number described in step 1, and include the calculation result in the maximum inter-class variance value set υ(t) of the three thresholds of the color card number;

步骤2.4:将υ(t)与υ(t-1)进行比较,看是否有更大的数值出现,如果υ(t)相比υ(t-1)还有更大的数值出现则进入步骤2.2,否则进入步骤2.5;Step 2.4: Compare υ(t) with υ(t-1) to see if there is a larger value. If υ(t) is larger than υ(t-1), go to step 2.2, otherwise go to step 2.5;

步骤2.5:将υ(t)中最大的数值对应的阈值组合设定为划分Ω1、Ω2、Ω3和Ω44个色卡编号集合的三个优化阈值;Step 2.5: The largest value in υ(t) corresponds to and The threshold combination is set to three optimized thresholds for dividing the four color card number sets of Ω 1 , Ω 2 , Ω 3 and Ω 4 ;

进一步地,步骤3中具体包括:对于图像中的像素点(m,n),通过该像素点(m,n)对应的要素组合(l,a,b)可确定对应的色卡编号集合编号f(m,n),具体形式如下:Furthermore, step 3 specifically includes: for a pixel point (m, n) in the image, the corresponding color card number set number f(m, n) can be determined by the element combination (l, a, b) corresponding to the pixel point (m, n), and the specific form is as follows:

输出图像中所有像素点对应的色卡编号集合编号,完成Ω1、Ω2、Ω3和Ω44个色卡编号集合的划分从而提取出表面缺陷对应的色卡编号集合。The color card number set numbers corresponding to all pixels in the output image are divided into four color card number sets Ω 1 , Ω 2 , Ω 3 and Ω 4 to extract the color card number set corresponding to the surface defects.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

图1为面向果蔬采后处理装备的表面缺陷提取步骤图;FIG1 is a diagram showing the steps of surface defect extraction for fruit and vegetable post-harvest processing equipment;

图2为脐橙彩色图像样本集的例图;FIG2 is an example of a sample set of navel orange color images;

图3为脐橙彩色图像经色卡编号集合划分后给出的表面缺陷区域。FIG3 shows the surface defect area of the navel orange color image after being divided by the color card number set.

具体实施方式DETAILED DESCRIPTION

以下结合附图通过面向果蔬采后处理装备的表面缺陷提取方法运用于脐橙彩色图像的具体实施方式对本发明作进一步地描述。The present invention will be further described below in conjunction with the accompanying drawings by using a specific implementation of the surface defect extraction method for fruit and vegetable post-harvest processing equipment applied to navel orange color images.

如图1所示,本发明实施方式中一种面向果蔬采后处理装备的表面缺陷提取方法包括以下步骤:As shown in FIG1 , a surface defect extraction method for fruit and vegetable post-harvest processing equipment according to an embodiment of the present invention comprises the following steps:

步骤1:对于果蔬采后处理装备给出需进行表面缺陷提取的脐橙彩色图像可采用LAB颜色模型和PANTONE色卡模式,其中PANTONE色卡编号取PANTONE NC XXXC或XXXXC的前3位数字,X表示数字,设脐橙彩色图像中按照LAB颜色模型进行亮度归一化后的要素组合(l,a,b)对应的PANTONE色卡编号可从其中,l,a,b分别为脐橙彩色图像中的像素点按该颜色模型给出的三个要素的取值,分别为脐橙彩色图像中色卡编号最小的颜色对应的三个要素的取值,分别为脐橙彩色图像中色卡编号最大的颜色对应的三个要素的取值,并划分为Ω1、Ω2、Ω3和Ω4共计4个色卡编号集合,所述4个色卡编号集合可表征为背景、成熟、未成熟、表面缺陷,具体形式如下:Step 1: For the navel orange color image that needs to be extracted for surface defects given by the fruit and vegetable post-harvest processing equipment, the LAB color model and PANTONE color card mode can be used, where the PANTONE color card number is the first 3 digits of PANTONE NC XXXC or XXXXC, where X represents a number. The PANTONE color card number corresponding to the element combination (l, a, b) in the navel orange color image after brightness normalization according to the LAB color model can be obtained from arrive Among them, l, a, and b are the values of the three elements given by the color model for the pixels in the navel orange color image. are the values of the three elements corresponding to the color with the smallest color card number in the navel orange color image, They are the values of the three elements corresponding to the color with the largest color card number in the navel orange color image, and are divided into 4 color card number sets, Ω 1 , Ω 2 , Ω 3 and Ω 4. The 4 color card number sets can be characterized as background, mature, immature, and surface defects. The specific form is as follows:

Ω2={Γ(x1,y1,z1)+1,...,Γ(x2,y2,z2)}Ω 2 ={Γ(x 1 ,y 1 ,z 1 )+1,...,Γ(x 2 ,y 2 ,z 2 )}

Ω3={Γ(x2,y2,z2)+1,...,Γ(x3,y3,z3)}Ω 3 ={Γ(x 2 ,y 2 ,z 2 )+1,...,Γ(x 3 ,y 3 ,z 3 )}

其中,Γ为输入要素组合而输出色卡编号的函数,(x1,y1,z1)、(x2,y2,z2)和(x3,y3,z3)为划分Ω1、Ω2、Ω3和Ω44个色卡编号集合的色卡编号对应的要素组合;Wherein, Γ is a function that inputs a combination of elements and outputs a color card number, (x 1 , y 1 , z 1 ), (x 2 , y 2 , z 2 ) and (x 3 , y 3 , z 3 ) are element combinations corresponding to the color card numbers that divide the four color card number sets of Ω 1 , Ω 2 , Ω 3 and Ω 4 ;

对于Ωi和Ωj共同产生的概率为κi,j,具体形式如下:The probability of Ω i and Ω j being generated together is κ i,j , which is in the following form:

其中,i,j∈[1,2,3,4],ε(l,a,b)为要素组合在图像中像素点的概率,κi为要素组合集合Ωi产生的概率;Among them, i,j∈[1,2,3,4], ε (l,a,b) is the probability of the element combination in the pixel point of the image, and κi is the probability of the element combination set Ωi ;

对应Ωi的要素平均值为Υi,具体形式如下:The average value of the elements corresponding to Ω i is Υ i , which is in the following form:

Ωi和Ωj共同的要素平均值分别为Ψi,j,其中,i,j∈[1,2,3,4],i≠j且i<j,具体形式如下:The common element averages of Ω i and Ω j are Ψ i,j , where i,j∈[1,2,3,4], i≠j and i<j. The specific form is as follows:

对于满足i,j∈[1,2,3,4]且i+1=j的Ωi和Ωj,设定相邻色卡编号差别的限定值为k,则通过Ωi中任意色卡编号Γ(x,y,z)与相邻的Ωj中任意色卡编号Γ(x′,y′,z′)可计算出限定条件Γ(x,y,z)-Γ(x′,y′,z′)≤k内对于Ωi和Ωj的相邻色卡编号平均要素差异互信息量ξi,j,k,具体形式如下:For Ω i and Ω j that satisfy i, j ∈ [1, 2, 3, 4] and i + 1 = j , set the limit value of the difference between adjacent color card numbers to k, then the average element difference mutual information ξ i, j, k for adjacent color card numbers of Ω i and Ω j within the limit condition Γ (x, y, z) - Γ (x', y', z') ≤ k can be calculated through any color card number Γ (x, y, z) in Ω i and any color card number Γ (x', y' , z') in the adjacent Ω j . The specific form is as follows:

其中,为任意的符号;in, is any symbol;

对于满足i,j∈[1,2,3,4]且j>i+1的Ωi和Ωj,可通过Ωi中像素点的概率最大时的色卡编号Γ(xi,yi,zi)与Ωj中像素点的概率最大时的色卡编号Γ(xj,yj,zj)可计算出对于Ωi和Ωj的最大概率色卡编号平均要素差异互信息量具体形式如下:For Ω i and Ω j that satisfy i, j∈[1,2,3,4] and j>i+1, the average element difference mutual information of the maximum probability color card numbers for Ω i and Ω j can be calculated by the color card number Γ(x i ,y i , zi ) when the probability of the pixel point in Ω i is the largest and the color card number Γ ( x j ,y j ,z j ) when the probability of the pixel point in Ω j is the largest The specific form is as follows:

其中, in,

对于Ω1、Ω2、Ω3和Ω4的相邻色卡编号平均要素差异互信息量ξi,j,k和最大概率色卡编号平均要素差异互信息量加权的色卡编号三阈值最大类间方差为σ2[Γ(x1,y1,z1),Γ(x2,y2,z2),Γ(x3,y3,z3)],具体形式如下:For the adjacent color card numbers of Ω 1 , Ω 2 , Ω 3 and Ω 4, the average element difference mutual information ξ i,j,k and the maximum probability color card number average element difference mutual information The maximum inter-class variance of the weighted three-threshold color card number is σ 2 [Γ(x 1 ,y 1 ,z 1 ),Γ(x 2 ,y 2 ,z 2 ),Γ(x 3 ,y 3 ,z 3 )], and the specific form is as follows:

其中,Θ1={(1,2),(2,3),(3,4)},Θ2={(1,3),(1,4),(2,4)};Among them, Θ 1 ={(1,2),(2,3),(3,4)}, Θ 2 ={(1,3),(1,4),(2,4)};

步骤2包括如下5个步骤:Step 2 includes the following 5 steps:

步骤2.1:通过50张如图2所示的脐橙图片建立脐橙彩色图像样本集,由图2中可以看出部分脐橙图片未含有未成熟区域,同时部分脐橙图片也存在多种表面缺陷类型,而后检测出各个脐橙图片中背景、成熟、未成熟、表面缺陷的色卡编号相关区域并进行合并,可设成熟相关的色卡编号范围为122至124以及135至138,未成熟相关的色卡编号范围为372至377以及379至382,表面缺陷相关的色卡编号范围为443至457以及539至544,背景相关的色卡编号范围为577至580;由此可设三个色卡编号以往历史阈值分别为138、382和544,同时可设脐橙彩色图像中最小的色卡编号和最大的色卡编号分别为122和580;将三个色卡编号以往历史阈值作为当前图3(a)中所示脐橙彩色图像处理中色卡编号阈值Γ(x1,y1,z1)、Γ(x2,y2,z2)和Γ(x3,y3,z3)的初始值,设定色卡编号阈值变化量为Δ=1,循环过程计数t为0,将(Γ(x1,y1,z1),Γ(x2,y2,z2),Γ(x3,y3,z3))阈值组合归入阈值排列组合集合ν(t=0)中,根据步骤1中所述的色卡编号三阈值最大类间方差的具体形式来计算ν(t=0)中的阈值组合,并将计算结果归入色卡编号三阈值最大类间方差数值集合υ(t=0)中;Step 2.1: A navel orange color image sample set is established through 50 navel orange images as shown in FIG2. It can be seen from FIG2 that some navel orange images do not contain immature areas, and some navel orange images also have various types of surface defects. Then, the color card number-related areas of the background, maturity, immaturity, and surface defects in each navel orange image are detected and merged. The color card number range related to maturity can be set to 122 to 124 and 135 to 138, the color card number range related to immaturity can be set to 372 to 377 and 379 to 382, the color card number range related to surface defects can be set to 443 to 457 and 539 to 544, and the color card number range related to background can be set to 577 to 580; thus, the historical thresholds of the three color card numbers can be set and They are 138, 382 and 544 respectively, and the smallest color card number in the navel orange color image can be set. and the largest color card number 122 and 580 respectively; the three color cards are numbered as historical thresholds and As the initial values of the color card number thresholds Γ(x 1 ,y 1 ,z 1 ), Γ(x 2 ,y 2 ,z 2 ) and Γ(x 3 ,y 3 ,z 3 ) in the processing of the navel orange color image shown in the current FIG. 3( a ), the color card number threshold change is set to Δ=1, the loop process count t is 0, the threshold combination (Γ(x 1 ,y 1 ,z 1 ),Γ(x 2 ,y 2 ,z 2 ),Γ(x 3 ,y 3 ,z 3 )) is included in the threshold permutation combination set ν(t=0), the threshold combination in ν(t=0) is calculated according to the specific form of the maximum inter-class variance of the three thresholds of the color card number described in step 1, and the calculation result is included in the maximum inter-class variance value set υ(t=0) of the three thresholds of the color card number;

步骤2.2:将t加1后代替原先的t,设中间变量θ取值为Δ·t或0,将(Γ(x1,y1,z1)±θ,Γ(x2,y2,z2)±θ,Γ(x3,y3,z3)±θ)阈值组合归入阈值排列组合集合ν(t)中;Step 2.2: Add 1 to t instead of the original t, set the intermediate variable θ to Δ·t or 0, and classify the threshold combinations (Γ(x 1 ,y 1 ,z 1 )±θ,Γ(x 2 ,y 2 ,z 2 )±θ,Γ(x 3 ,y 3 ,z 3 )±θ) into the threshold permutation combination set ν(t);

步骤2.3:根据步骤1中所述的色卡编号三阈值最大类间方差的具体形式来计算对于图3(a)中所示脐橙彩色图像的ν(t)中的阈值组合,并将对于图3(a)中所示脐橙彩色图像的计算结果归入色卡编号三阈值最大类间方差数值集合υ(t)中;Step 2.3: Calculate the threshold combination in ν(t) for the navel orange color image shown in FIG. 3(a) according to the specific form of the maximum inter-class variance of the three thresholds of the color card number described in step 1, and include the calculation result for the navel orange color image shown in FIG. 3(a) into the maximum inter-class variance value set υ(t) of the three thresholds of the color card number;

步骤2.4:将υ(t)与υ(t-1)进行比较,看是否有更大的数值出现,如果υ(t)相比υ(t-1)还有更大的数值出现则进入步骤2.2,否则进入步骤2.5;Step 2.4: Compare υ(t) with υ(t-1) to see if there is a larger value. If υ(t) is larger than υ(t-1), go to step 2.2, otherwise go to step 2.5;

步骤2.5:将υ(t)中最大的数值对应的阈值组合设定为划分Ω1、Ω2、Ω3和Ω44个色卡编号集合的三个优化阈值,由于图3(a)中不包括未成熟区域,而存在两个特征具有较大区别的表面缺陷区域,则在步骤2中可缩减为3个色卡编号集合,也可通过表面缺陷相关的色卡编号范围的分裂为表面缺陷划分两个色卡编号集合从而提高表面缺陷提取的辨识度,在本发明实施方式中以为表面缺陷划分两个色卡编号集合为例,因此三个优化阈值相比三个色卡编号以往历史阈值可调整为137、457和541;Step 2.5: The largest value in υ(t) corresponds to and The threshold combination is set to three optimized thresholds for dividing four color card number sets of Ω 1 , Ω 2 , Ω 3 and Ω 4. Since FIG. 3(a) does not include an immature area, but there are two surface defect areas with greatly different features, it can be reduced to three color card number sets in step 2. It is also possible to divide the surface defects into two color card number sets by splitting the color card number range related to the surface defects, thereby improving the recognition of the surface defect extraction. In the embodiment of the present invention, the surface defects are divided into two color card number sets as an example, so the three optimized thresholds are and Compared with the historical thresholds of the three color card numbers and Adjustable to 137, 457 and 541;

步骤3:对于图3(a)中脐橙彩色图像中的像素点(m,n),通过该像素点(m,n)对应的要素组合(l,a,b)可确定对应的色卡编号集合编号f(m,n),具体形式如下:Step 3: For the pixel point (m, n) in the navel orange color image in FIG3(a), the corresponding color card number set number f(m, n) can be determined by the element combination (l, a, b) corresponding to the pixel point (m, n), and the specific form is as follows:

输出图像中所有像素点对应的色卡编号集合编号,完成Ω1、Ω2、Ω3和Ω44个色卡编号集合的划分,可见Ω1和Ω4分别为成熟和背景对应的色卡编号集合,从而提取出Ω2和Ω3两个表面缺陷对应的色卡编号集合。The color card number set corresponding to all pixels in the output image is numbered, and the division of the four color card number sets Ω 1 , Ω 2 , Ω 3 and Ω 4 is completed. It can be seen that Ω 1 and Ω 4 are the color card number sets corresponding to the mature and background respectively, thereby extracting the color card number sets corresponding to the two surface defects Ω 2 and Ω 3 .

对于图3(a)中所示的脐橙图像,可通过色卡编号集合编号的具体形式输出图像中所有像素点对应的色卡编号集合编号,由图3(b)中可看出将该脐橙图像划分为4个色卡编号集合,由于该脐橙图像中不包括未成熟区域,而这两个表面缺陷区域的各自特征存在较大区别,因此可分裂为2个色卡编号集合以便进行明显区分以进一步提高识别能力,从而使得绿色和土黄标注区域皆为表面缺陷区域,以实现面向果蔬采后处理装备的表面缺陷提取。For the navel orange image shown in FIG3(a), the color card number set numbers corresponding to all pixels in the image can be output in the specific form of the color card number set numbers. FIG3(b) shows that the navel orange image is divided into four color card number sets. Since the navel orange image does not include an immature area, and the characteristics of the two surface defect areas are quite different, they can be split into two color card number sets for obvious distinction to further improve the recognition capability, so that the green and khaki marked areas are both surface defect areas, so as to realize surface defect extraction for fruit and vegetable post-harvest processing equipment.

本实施例中未明确的部分均可用现有技术加以实现。Any part not specified in this embodiment can be implemented using existing technologies.

对于本领域的普通技术人员而言,根据本发明的教导,在不脱离本发明的原理与精神的情况下,对实施方式所进行的改变、修改、替换和变型仍落入本发明的保护范围之内。For those skilled in the art, according to the teachings of the present invention, without departing from the principles and spirit of the present invention, changes, modifications, substitutions and variations made to the implementation methods are still within the protection scope of the present invention.

Claims (3)

1. The surface defect extraction method for the fruit and vegetable postharvest treatment equipment is characterized by comprising the following steps of:
Step 1: providing a fruit and vegetable color image to be subjected to surface defect extraction for fruit and vegetable post-picking processing equipment, carrying out brightness normalization on each pixel point in the fruit and vegetable color image according to a certain color model, then outputting a certain color card number corresponding to three elements of the color model, setting the obtained color card number into four color card number sets which are classified into background, mature, immature and surface defect, providing probability and corresponding element average value generated by the four color card number sets, providing probability and corresponding element average value jointly generated by different color card number sets, providing adjacent color card number average element difference mutual information quantity when color card number difference is within a limiting condition through the color card number set and the next color card number set, providing maximum probability color card number average element difference mutual information quantity when the probability of each pixel point in the image is maximum through the color card number of the color card number set and the other color card number set, and determining three maximum color card number cross-class threshold values weighted by the comprehensive adjacent color card number average element mutual information quantity and the maximum probability color card number average element difference mutual information quantity of the four color card number sets;
Step 2: on the basis of taking the historical threshold values of three color card numbers as initial values, continuously increasing and decreasing the product of the color card number threshold value variation quantity and the cycle process count by the threshold value combination to be classified into a threshold value arrangement combination set, classifying the calculation result into a color card number three-threshold value maximum inter-class variance value set, and if the color card number three-threshold value maximum inter-class variance value set is not added with a larger value, dividing the threshold value combination corresponding to the largest value in the color card number three-threshold value maximum inter-class variance value set into three optimized threshold values of four color card number sets;
Step 3: for pixel points in the image, comparing the color card number corresponding to the element combination of the pixel point with three optimized thresholds for dividing four color card number sets in the step 2 to determine the corresponding color card number set number, and then outputting the color card number set numbers corresponding to all the pixel points in the image to complete the division of the four color card number sets so as to extract the surface defects;
in the step 1, each pixel point in the fruit and vegetable color image is normalized according to a certain color model, and then a certain color card number corresponding to three elements of the color model is output, and the color card number obtained by setting can be classified into a set of 4 color card numbers of background, mature, immature and surface defects, and the specific method is as follows:
the color card number corresponding to the element combination (l, a, b) after brightness normalization according to a certain color model in the fruit and vegetable color image can be obtained from To the point ofWherein l, a and b are respectively the values of three elements given by pixel points in the fruit and vegetable color image according to the color model,Respectively takes the values of three elements corresponding to the color with the minimum color card number in the fruit and vegetable color image,The color card number is respectively the value of three elements corresponding to the color with the largest color card number in the fruit and vegetable color image, and is divided into 4 color card number sets which are respectively characterized as background, mature, immature and surface defect, wherein the specific forms are as follows:
Ω2={Γ(x1,y1,z1)+1,...,Γ(x2,y2,z2)}
Ω3={Γ(x2,y2,z2)+1,...,Γ(x3,y3,z3)}
wherein Γ is an input element combination and a function ,(x1,y1,z1)、(x2,y2,z2)、(x3,y3,z3) for outputting a color chart number is an element combination corresponding to a color chart number of a color chart number set of which Ω 1、Ω2、Ω3 and Ω 4 are divided;
the specific method for giving the probability generated by the four color card number sets and the average value of the corresponding elements in the step 1 is as follows:
The probabilities generated by the omega 1、Ω2、Ω3 and omega 4 color card number sets are kappa 1、κ2、κ3 and kappa 4 respectively, and the specific forms are as follows:
Wherein, i epsilon [1,2,3,4], epsilon (l,a,b) is the probability of the element combination (l, a, b) in the pixel point of the image;
The element average values of the corresponding omega 1、Ω2、Ω3 and omega 4 color card number sets are respectively AndThe element average value corresponding to omega i isThe specific form is as follows:
Wherein, alpha, beta and gamma are the weight coefficients of elements L, A and B in the element average value respectively;
The specific method for providing the probability and the average value of the corresponding elements generated by the different color card number sets in the step1 is as follows:
The probability of co-occurrence of Ω 1 and Ω 2 is κ 1,21 and Ω 3, the probability of co-occurrence of κ 1,31 and Ω 4 is κ 1,42 and Ω 3, the probability of co-occurrence of κ 2,32 and Ω 4 is κ 2,43 and Ω 4 is κ 3,4, and the probability of co-occurrence of Ω i and Ω j is κ i,j, in the following specific form:
Wherein i, j e [1,2,3,4], i not equal to j and i < j;
The average value of the elements corresponding to omega i and omega j is ψ i,j, wherein i, j epsilon [1,2,3,4], i not equal to j and i < j, and the specific forms are as follows:
in the step 1, the specific method for giving the mutual information quantity of the average element difference of the adjacent color card numbers when the color card number difference is within the limiting condition through a certain color card number set and the next color card number set is as follows:
For Ω i and Ω j that satisfy i, j e [1,2,3,4] and i+1=j, setting the limiting value of the adjacent color card number difference as k, calculating the limiting condition Γ (x, y, z) - Γ (x ', y', z ') for the average element difference mutual information amount ζ i,j,k of adjacent color card numbers of Ω i and Ω j in the limiting condition Γ (x, y, z) and any color card number Γ (x', y ', z') in the adjacent Ω j by any color card number Γ (x, y, z) in Ω i, specifically the following form:
Wherein, Is an arbitrary symbol;
In the step 1, the specific method for giving the maximum probability color card number average element difference mutual information quantity through the color card number when the probability of each pixel point in the image is maximum in a certain color card number set and another color card number set is as follows:
For omega i and omega j satisfying i, j ε [1,2,3,4] and j > i+1, the maximum probability color chip number average element difference mutual information amount for omega i and omega j can be calculated from color chip number Γ (x i,yi,zi) when the probability of pixel point in omega i is maximum and color chip number Γ (x j,yj,zj) when the probability of pixel point in omega j is maximum The specific form is as follows:
Wherein,
In the step 1, the specific method for determining the color card number three-threshold maximum inter-class variance weighted by the comprehensive adjacent color card number average element difference mutual information quantity and the maximum probability color card number average element difference mutual information quantity of the four color card number sets is as follows:
Determining the average element difference mutual information quantity xi i,j,k and the maximum probability color card number average element difference mutual information quantity for adjacent color card numbers of omega 1、Ω2、Ω3 and omega 4 The weighted color chart number three-threshold maximum inter-class variance is σ2[Γ(x1,y1,z1),Γ(x2,y2,z2),Γ(x3,y3,z3)], in the specific form as follows:
Where Θ 1={(1,2),(2,3),(3,4)},Θ2 = { (1, 3), (1, 4), (2, 4) }.
2. The method for extracting surface defects of fruit and vegetable post-harvest processing equipment according to claim 1, wherein the specific steps of step 2 are as follows:
step 2.1: numbering three color cards to a past history threshold AndAs initial values of color card number thresholds Γ (x 1,y1,z1)、Γ(x2,y2,z2) and Γ (x 3,y3,z3) in the current fruit and vegetable color image processing, setting the variation of the color card number threshold as delta, setting the cyclic process count t as 0, classifying (Γ(x1,y1,z1),Γ(x2,y2,z2),Γ(x3,y3,z3)) threshold combinations into a threshold arrangement combination set ν (t=0), calculating threshold combinations in ν (t=0) according to the specific form of the color card number three-threshold maximum inter-class variance in step 1, and classifying calculation results into the color card number three-threshold maximum inter-class variance value set ν (t=0);
Step 2.2: after adding 1 to t, replacing the original t, setting the value of an intermediate variable theta as delta t or 0, and classifying (Γ(x1,y1,z1)±θ,Γ(x2,y2,z2)±θ,Γ(x3,y3,z3)±θ) threshold combinations into a threshold arrangement combination set v (t);
Step 2.3: calculating a threshold combination in v (t) according to the specific form of the color card number three-threshold maximum inter-class variance in the step 1, and classifying the calculation result into a color card number three-threshold maximum inter-class variance value set v (t);
step 2.4: comparing the upsilon (t) with the upsilon (t-1) to see whether larger numerical values appear, if so, entering the step 2.2, otherwise, entering the step 2.5;
step 2.5: corresponding the largest value in the v (t) AndThe threshold combination is set to three optimized thresholds that divide the sets of Ω 1、Ω2、Ω3 and Ω 4 color chart numbers.
3. The method for extracting surface defects of fruit and vegetable post-harvest processing equipment according to claim 1, wherein the step 3 specifically comprises:
For a pixel (m, n) in an image, a corresponding color card number set number f (m, n) can be determined by a corresponding element combination (l, a, b) of the pixel (m, n), and the specific form is as follows:
And outputting color card number sets corresponding to all pixel points in the image, and finishing the division of the omega 1、Ω2、Ω3 and omega 4 color card number sets so as to extract the color card number set corresponding to the surface defect.
CN202310549845.5A 2023-05-16 2023-05-16 Surface defect extraction method for fruit and vegetable post-harvest treatment equipment Active CN116797544B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310549845.5A CN116797544B (en) 2023-05-16 2023-05-16 Surface defect extraction method for fruit and vegetable post-harvest treatment equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310549845.5A CN116797544B (en) 2023-05-16 2023-05-16 Surface defect extraction method for fruit and vegetable post-harvest treatment equipment

Publications (2)

Publication Number Publication Date
CN116797544A CN116797544A (en) 2023-09-22
CN116797544B true CN116797544B (en) 2024-08-09

Family

ID=88042849

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310549845.5A Active CN116797544B (en) 2023-05-16 2023-05-16 Surface defect extraction method for fruit and vegetable post-harvest treatment equipment

Country Status (1)

Country Link
CN (1) CN116797544B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106918602A (en) * 2017-04-13 2017-07-04 北京海风智能科技有限责任公司 A kind of detection method of surface flaw based on machine vision of robust
CN110473194A (en) * 2019-08-12 2019-11-19 西南大学 Fruit surface defect detection method based on more image block Threshold Segmentation Algorithms

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101929669B1 (en) * 2017-06-29 2018-12-17 한경대학교 산학협력단 The method and apparatus for analyzing an image using an entropy
US10402623B2 (en) * 2017-11-30 2019-09-03 Metal Industries Research & Development Centre Large scale cell image analysis method and system
CN108470339A (en) * 2018-03-21 2018-08-31 华南理工大学 A kind of visual identity of overlapping apple and localization method based on information fusion
CN112001901A (en) * 2020-08-18 2020-11-27 济南大学 Apple defect detection method and system based on convolutional neural network
CN115861325B (en) * 2023-03-01 2023-06-20 山东中科冶金矿山机械有限公司 Suspension spring defect detection method and system based on image data

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106918602A (en) * 2017-04-13 2017-07-04 北京海风智能科技有限责任公司 A kind of detection method of surface flaw based on machine vision of robust
CN110473194A (en) * 2019-08-12 2019-11-19 西南大学 Fruit surface defect detection method based on more image block Threshold Segmentation Algorithms

Also Published As

Publication number Publication date
CN116797544A (en) 2023-09-22

Similar Documents

Publication Publication Date Title
Hossain et al. A color and texture based approach for the detection and classification of plant leaf disease using KNN classifier
Chen et al. Adversarial-learned loss for domain adaptation
Waghmare et al. Detection and classification of diseases of grape plant using opposite colour local binary pattern feature and machine learning for automated decision support system
CN107341463B (en) Face feature recognition method combining image quality analysis and metric learning
CN110263666B (en) Action detection method based on asymmetric multi-stream
CN111860533A (en) Image recognition method and device, storage medium and electronic device
Bhowmik et al. GiB: a ${G} $ ame theory ${I} $ nspired ${B} $ inarization technique for degraded document images
WO2018052587A1 (en) Method and system for cell image segmentation using multi-stage convolutional neural networks
CN107292350A (en) The method for detecting abnormality of large-scale data
CN103914705B (en) Hyperspectral image classification and wave band selection method based on multi-target immune cloning
CN105469080B (en) A kind of facial expression recognizing method
Opeña et al. Automated tomato maturity grading using ABC-trained artificial neural networks
CN115082449B (en) Electronic component defect detection method
CN116797544B (en) Surface defect extraction method for fruit and vegetable post-harvest treatment equipment
CN109460872B (en) Mobile communication user loss imbalance data prediction method
CN110874835A (en) Crop leaf disease resistance identification method, system, electronic device and storage medium
CN116596891B (en) Wood floor color classification and defect detection method based on semi-supervised multitasking detection
Imamura et al. MLF-SC: Incorporating multi-layer features to sparse coding for anomaly detection
CN110942087B (en) Matrix type image data classification method based on separation solution
CN109740692A (en) A kind of target classifying method of the logistic regression based on principal component analysis
CN115511867A (en) Weaving method and system for high-wear-resistance textile fabric
CN108062563A (en) A kind of representative sample based on classification equilibrium finds method
CN114937042A (en) Plastic product quality evaluation method based on machine vision
Krishna et al. Color Image Segmentation Using Soft Rough Fuzzy-C-Means and Local Binary Pattern.
CN113989567A (en) Garbage picture classification method and device

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