+

CN118038446A - Bone disc replacement method and system based on image recognition - Google Patents

Bone disc replacement method and system based on image recognition Download PDF

Info

Publication number
CN118038446A
CN118038446A CN202410060918.9A CN202410060918A CN118038446A CN 118038446 A CN118038446 A CN 118038446A CN 202410060918 A CN202410060918 A CN 202410060918A CN 118038446 A CN118038446 A CN 118038446A
Authority
CN
China
Prior art keywords
image
bone
bone plate
pixel
rgb
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202410060918.9A
Other languages
Chinese (zh)
Other versions
CN118038446B (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.)
Wuxi Institute of Commerce
Original Assignee
Wuxi Institute of Commerce
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 Wuxi Institute of Commerce filed Critical Wuxi Institute of Commerce
Priority to CN202410060918.9A priority Critical patent/CN118038446B/en
Publication of CN118038446A publication Critical patent/CN118038446A/en
Application granted granted Critical
Publication of CN118038446B publication Critical patent/CN118038446B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/60Type of objects
    • G06V20/68Food, e.g. fruit or vegetables
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q50/00Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
    • G06Q50/10Services
    • G06Q50/12Hotels or restaurants
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/26Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion
    • G06V10/267Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion by performing operations on regions, e.g. growing, shrinking or watersheds
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/28Quantising the image, e.g. histogram thresholding for discrimination between background and foreground patterns
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/34Smoothing or thinning of the pattern; Morphological operations; Skeletonisation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/82Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Business, Economics & Management (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Tourism & Hospitality (AREA)
  • Software Systems (AREA)
  • Computing Systems (AREA)
  • Artificial Intelligence (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Primary Health Care (AREA)
  • Molecular Biology (AREA)
  • General Business, Economics & Management (AREA)
  • General Engineering & Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Human Resources & Organizations (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Databases & Information Systems (AREA)
  • Medical Informatics (AREA)
  • Economics (AREA)
  • Image Analysis (AREA)

Abstract

The invention discloses a bone disk replacement method and a system based on image recognition, which belong to the technical field of image processing, wherein the method comprises the following steps: acquiring a desktop image; performing filtering processing on the desktop image based on the self-adaptive smoothing filtering; based on the neural network, dividing a bone disk image from the desktop image after the filtering treatment; introducing a Canny operator, detecting the outline of the bone plate in the bone plate image, and extracting a bone plate area; calculating the profile integrity of the bone disc profile; performing binarization treatment on the bone disc area; calculating the total number of white pixels and the edge white pixel ratio in the bone plate area; calculating the filling degree of the bone plate according to the outline integrity of the outline of the bone plate, the total number of white pixels in the bone plate area and the edge white pixel ratio; when the filling degree of the bone plate is larger than the preset filling degree, the corresponding bone plate is replaced. Can provide real-time, continuous monitoring, realize in time changing the bone dish, promote service efficiency, keep dining table's clean and tidy nature.

Description

一种基于图像识别的骨碟更换方法及系统A bone disc replacement method and system based on image recognition

技术领域Technical Field

本发明属于图像处理技术领域,具体涉及一种基于图像识别的骨碟更换方法及系统。The present invention belongs to the technical field of image processing, and in particular relates to a bone disc replacement method and system based on image recognition.

背景技术Background technique

随着人们生活水平的日益提高,走进餐厅进行就餐的频率也随之提高。当前人们主要讲就餐过程中的残余部分放置于骨碟中,随着就餐的进行,骨碟中存放的残余食物将越积越多,影响就餐体验。As people's living standards improve, the frequency of dining in restaurants increases. Currently, people mainly place the leftovers from dining in bone dishes. As dining progresses, the leftovers in the bone dishes will accumulate more and more, affecting the dining experience.

目前,为了解决骨碟中存放的残余食物将越积越多影响就餐体验的问题,主要采用服务员人工监测的方式,在就餐中途为食客统一更换骨碟,费时费力,而且,无法提供实时、连续的人工监测,在繁忙时段增加了服务员工作压力,难以及时响应所有餐桌需求,很难找到准确地时机对各个餐桌的骨碟进行及时的更换。At present, in order to solve the problem that the residual food stored in the bone dishes will accumulate and affect the dining experience, the main method adopted is manual monitoring by waiters. The bone dishes are replaced uniformly for diners in the middle of the meal. This is time-consuming and labor-intensive, and it is unable to provide real-time and continuous manual monitoring. It increases the workload of waiters during busy periods, making it difficult to respond to all table needs in time and it is difficult to find the right time to replace the bone dishes on each table in time.

发明内容Summary of the invention

为了解决当前采用服务员人工监测的方式,在就餐中途为食客统一更换骨碟,费时费力,而且,无法提供实时、连续的人工监测,在繁忙时段增加了服务员工作压力,难以及时响应所有餐桌需求,很难找到准确地时机对各个餐桌的骨碟进行及时的更换的技术问题,本发明提供一种基于图像识别的骨碟更换方法及系统。In order to solve the technical problems that the current method of manual monitoring by waiters requires uniformly replacing bone plates for diners in the middle of a meal, which is time-consuming and labor-intensive, and cannot provide real-time and continuous manual monitoring, increases the workload of waiters during busy hours, makes it difficult to respond to the needs of all tables in a timely manner, and is difficult to find the right time to replace the bone plates on each table in a timely manner, the present invention provides a bone plate replacement method and system based on image recognition.

第一方面first

本发明提供了一种基于图像识别的骨碟更换方法,包括:The present invention provides a bone disc replacement method based on image recognition, comprising:

S1:获取桌面图像;S1: Get desktop image;

S2:基于自适应平滑滤波,对所述桌面图像进行滤波处理;S2: performing filtering processing on the desktop image based on adaptive smoothing filtering;

S3:基于神经网络,从滤波处理后的桌面图像中分割出骨碟图像;S3: Based on the neural network, the bone disc image is segmented from the filtered desktop image;

S4:引入Canny算子,检测所述骨碟图像中的骨碟轮廓,提取出骨碟区域;S4: introducing the Canny operator to detect the bone disc outline in the bone disc image and extract the bone disc area;

S5:计算所述骨碟轮廓的轮廓完整度;S5: calculating the contour completeness of the bone disc contour;

S6:对所述骨碟区域进行二值化处理;S6: performing binarization processing on the bone disc region;

S7:计算所述骨碟区域中的白色像素总数以及边缘白色像素占比;S7: Calculate the total number of white pixels in the bone disc area and the proportion of white pixels at the edge;

S8:根据所述骨碟轮廓的轮廓完整度以及所述骨碟区域中的白色像素总数以及边缘白色像素占比,计算骨碟填充度;S8: Calculating the bone disc filling degree according to the outline completeness of the bone disc outline, the total number of white pixels in the bone disc area, and the proportion of white pixels at the edge;

S9:当所述骨碟填充度大于预设填充度时,对相应的骨碟进行更换。S9: When the filling degree of the bone dish is greater than a preset filling degree, the corresponding bone dish is replaced.

第二方面Second aspect

本发明提供了一种基于图像识别的骨碟更换系统,包括处理器和用于存储处理器可执行指令的存储器;所述处理器被配置为调用所述存储器存储的指令,以执行第一方面中的基于图像识别的骨碟更换方法。The present invention provides a bone disc replacement system based on image recognition, comprising a processor and a memory for storing processor executable instructions; the processor is configured to call the instructions stored in the memory to execute the bone disc replacement method based on image recognition in the first aspect.

与现有技术相比,本发明至少具有以下有益技术效果:Compared with the prior art, the present invention has at least the following beneficial technical effects:

在本发明中,通过图像识别的方式,自动化识别骨碟中的残余食物是否已经填的够满,在残余食物的填充度达到预设条件时,对骨碟进行更换,无需服务员在就餐中途时刻监测骨碟状态,省时省力,能够提供实时、连续的监测,及时响应所有餐桌需求,实现对于骨碟的及时更换,提升服务效率,保持餐桌的整洁性,提升食客的就餐体验。In the present invention, image recognition is used to automatically identify whether the residual food in the bone dish is full enough. When the filling degree of the residual food reaches a preset condition, the bone dish is replaced. There is no need for the waiter to monitor the status of the bone dish all the time during the meal, which saves time and effort, can provide real-time and continuous monitoring, and respond to all table needs in time, so as to realize timely replacement of bone dishes, improve service efficiency, keep the table clean, and enhance the dining experience of diners.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

下面将以明确易懂的方式,结合附图说明优选实施方式,对本发明的上述特性、技术特征、优点及其实现方式予以进一步说明。The preferred implementation modes will be described below in a clear and understandable manner with reference to the accompanying drawings to further illustrate the above-mentioned characteristics, technical features, advantages and implementation methods of the present invention.

图1是本发明提供的一种基于图像识别的骨碟更换方法的流程示意图。FIG1 is a schematic flow chart of a bone disc replacement method based on image recognition provided by the present invention.

图2是本发明提供的一种骨碟图像的示意图。FIG. 2 is a schematic diagram of a bone disc image provided by the present invention.

图3是本发明提供的一种基于图像识别的骨碟更换系统的结构示意图。FIG3 is a schematic structural diagram of a bone disc replacement system based on image recognition provided by the present invention.

具体实施方式Detailed ways

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对照附图说明本发明的具体实施方式。显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图,并获得其他的实施方式。In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the specific implementation methods of the present invention will be described below with reference to the accompanying drawings. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings and other implementation methods can be obtained based on these drawings without creative work.

为使图面简洁,各图中只示意性地表示出了与发明相关的部分,它们并不代表其作为产品的实际结构。另外,以使图面简洁便于理解,在有些图中具有相同结构或功能的部件,仅示意性地绘示了其中的一个,或仅标出了其中的一个。在本文中,“一个”不仅表示“仅此一个”,也可以表示“多于一个”的情形。In order to simplify the drawings, only the parts related to the invention are schematically shown in each figure, and they do not represent the actual structure of the product. In addition, in order to simplify the drawings and facilitate understanding, in some figures, only one of the parts with the same structure or function is schematically drawn or marked. In this article, "one" not only means "only one", but also means "more than one".

还应当进一步理解,在本发明说明书和所附权利要求书中使用的术语“和/或”是指相关联列出的项中的一个或多个的任何组合以及所有可能组合,并且包括这些组合。It should be further understood that the term "and/or" used in the present description and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.

在本文中,需要说明的是,除非另有明确的规定和限定,术语“安装”、“相连”、“连接”应做广义理解,例如,可以是固定连接,也可以是可拆卸连接,或一体地连接。可以是机械连接,也可以是电连接。可以是直接相连,也可以通过中间媒介间接相连,可以是两个元件内部的连通。对于本领域的普通技术人员而言,可以具体情况理解上述术语在本发明中的具体含义。In this document, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection. It can be a mechanical connection or an electrical connection. It can be directly connected or indirectly connected through an intermediate medium, and it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

另外,在本发明的描述中,术语“第一”、“第二”等仅用于区分描述,而不能理解为指示或暗示相对重要性。In addition, in the description of the present invention, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.

实施例1Example 1

在一个实施例中,参考说明书附图1,示出了本发明提供的一种基于图像识别的骨碟更换方法的流程示意图。In one embodiment, referring to FIG1 of the specification, a schematic flow chart of a bone disc replacement method based on image recognition provided by the present invention is shown.

本发明提供的一种基于图像识别的骨碟更换方法,包括:The present invention provides a bone disc replacement method based on image recognition, comprising:

S1:获取桌面图像。S1: Get the desktop image.

具体而言,可以在餐厅顶部安装摄像头,拍摄桌面图像。Specifically, a camera can be installed on the top of the restaurant to capture images of the tabletop.

S2:基于自适应平滑滤波,对桌面图像进行滤波处理。S2: Based on the adaptive smoothing filter, the desktop image is filtered.

其中,自适应平滑滤波是本发明提供的一种新型滤波方法,可以根据图像的局部特性动态调整滤波程度,以实现在平滑图像的同时保留图像的边缘信息。Among them, adaptive smoothing filtering is a new filtering method provided by the present invention, which can dynamically adjust the filtering degree according to the local characteristics of the image to achieve smoothing the image while retaining the edge information of the image.

在一种可能的实施方式中,S2具体包括子步骤S201至S203:In a possible implementation, S2 specifically includes sub-steps S201 to S203:

S201:计算桌面图像的梯度分量:S201: Calculate the gradient component of the desktop image:

其中,Gx表示水平梯度分量,Gy表示竖直梯度分量,(x,y)表示像素点坐标,f表示桌面图像。Wherein, Gx represents the horizontal gradient component, Gy represents the vertical gradient component, (x, y) represents the pixel coordinates, and f represents the desktop image.

需要说明的是,梯度分量是指图像在某一点处灰度的变化率,即灰度的空间变化。梯度分量常用于表示图像中各个位置的边缘或纹理的强度和方向。It should be noted that the gradient component refers to the rate of change of the grayscale of an image at a certain point, that is, the spatial variation of the grayscale. The gradient component is often used to represent the strength and direction of the edge or texture at each position in the image.

S202:计算各个像素点的滤波权重值:S202: Calculate the filter weight value of each pixel:

其中,w表示滤波权重值,exp表示以e为底的指数函数,h表示边缘保留幅度系数。Among them, w represents the filter weight value, exp represents the exponential function with e as the base, and h represents the edge retention amplitude coefficient.

其中,本领域技术人员可以根据实际情况设置边缘保留幅度系数h的大小,本发明不做限定。Among them, those skilled in the art can set the size of the edge retention amplitude coefficient h according to actual conditions, and the present invention does not limit it.

其中,引入边缘保留幅度系数h可以调整平滑和边缘保留之间的权衡。这使得滤波过程更具有灵活性,能够适应不同场景和需求。The introduction of the edge preservation amplitude coefficient h can adjust the trade-off between smoothing and edge preservation, which makes the filtering process more flexible and can adapt to different scenarios and requirements.

在本发明中,通过梯度信息计算滤波权重值,使得滤波程度在不同区域自适应调整。在梯度较大的区域,权重较小,实现边缘附近的保留;在梯度较小的区域,权重较大,实现平滑处理,增强了滤波器的自适应性。In the present invention, the filter weight value is calculated by gradient information, so that the degree of filtering can be adaptively adjusted in different areas. In areas with larger gradients, the weight is smaller to achieve retention near the edge; in areas with smaller gradients, the weight is larger to achieve smoothing processing, thereby enhancing the adaptability of the filter.

S203:根据各个像素点的滤波权重值,对桌面图像进行滤波处理:S203: Filter the desktop image according to the filter weight value of each pixel point:

其中,t表示迭代次数,ft+1表示经过t+1次滤波处理后的桌面图像,ft表示经过t次滤波处理后的桌面图像。Wherein, t represents the number of iterations, f t+1 represents the desktop image after t+1 filtering processes, and f t represents the desktop image after t filtering processes.

在本发明中,通过多次迭代滤波处理,有助于去除图像中的噪声,从而提高图像质量。In the present invention, multiple iterations of filtering processes are performed to help remove noise in the image, thereby improving the image quality.

S3:基于神经网络,从滤波处理后的桌面图像中分割出骨碟图像。在一种可能的实施方式中,S3具体包括子步骤S301至S304:S3: Based on a neural network, a bone disc image is segmented from the filtered desktop image. In a possible implementation, S3 specifically includes sub-steps S301 to S304:

S301:将滤波处理后的原始桌面图像分别转换为RGB图像、HSV图像以及Lab图像。S301: Convert the filtered original desktop image into an RGB image, an HSV image and a Lab image respectively.

需要说明的是,RGB、HSV(Hue,Saturation,Value)和Lab(CIELAB)是三种常用的颜色空间,它们在图像处理和计算机视觉中有着不同的应用和优势。在RGB颜色空间中,图像的颜色由红色(R)、绿色(G)和蓝色(B)三个颜色通道组成。每个像素的颜色可以用一个三元组(R,G,B)来表示,其中每个分量的取值范围通常是0到255。HSV颜色空间将颜色表示为色调(Hue)、饱和度(Saturation)和明度(Value)三个分量。Lab颜色空间是一种基于人类视觉感知的颜色表示方式,包括亮度(L,从黑到白)、a轴(从绿到红)和b轴(从蓝到黄)三个分量。在Lab颜色空间中,颜色的感知距离更为均匀,因此更适用于一些需要考虑颜色感知差异的应用。It should be noted that RGB, HSV (Hue, Saturation, Value) and Lab (CIELAB) are three commonly used color spaces, which have different applications and advantages in image processing and computer vision. In the RGB color space, the color of an image consists of three color channels: red (R), green (G) and blue (B). The color of each pixel can be represented by a triplet (R, G, B), where the value range of each component is usually 0 to 255. The HSV color space represents color as three components: hue (Hue), saturation (Saturation) and lightness (Value). The Lab color space is a color representation method based on human visual perception, including three components: brightness (L, from black to white), a-axis (from green to red) and b-axis (from blue to yellow). In the Lab color space, the perceived distance of colors is more uniform, so it is more suitable for some applications that need to consider differences in color perception.

S302:通过DeepLabV3+网络,获取RGB图像、HSV图像以及Lab图像的语义分割结果。S302: Obtain semantic segmentation results of RGB images, HSV images, and Lab images through the DeepLabV3+ network.

其中,DeepLabV3+(DeepLab version 3plus)是一种用于图像语义分割的深度学习模型,是DeepLab系列的最新版本,DeepLabV3+使用了空洞卷积,也称为扩张卷积,以增加卷积神经网络的感受野(receptive field)。这有助于模型更好地捕捉图像中的全局信息,尤其是对于语义分割任务,全局信息对于正确分类每个像素点非常重要。通过采用不同大小的空洞卷积核,DeepLabV3+构建了一个金字塔结构,可以同时捕获多尺度的特征。这有助于模型对不同大小的对象和结构进行更准确的分割。通过分离卷积操作,可以减少参数数量和计算量,同时保持良好的性能。DeepLabV3+引入了一个解码器模块,用于更好地处理分割结果的细节和边缘。这有助于提高分割的精度,特别是对于物体边缘的识别。同时,DeepLabV3+使用空间金字塔池化来捕捉图像的多尺度特征,使得模型能够更好地适应不同大小和形状的物体。Among them, DeepLabV3+ (DeepLab version 3plus) is a deep learning model for image semantic segmentation. It is the latest version of the DeepLab series. DeepLabV3+ uses dilated convolution, also known as expanded convolution, to increase the receptive field of the convolutional neural network. This helps the model better capture the global information in the image, especially for semantic segmentation tasks, where global information is very important for correctly classifying each pixel. By adopting dilated convolution kernels of different sizes, DeepLabV3+ builds a pyramid structure that can capture multi-scale features at the same time. This helps the model to more accurately segment objects and structures of different sizes. By separating the convolution operation, the number of parameters and the amount of calculation can be reduced while maintaining good performance. DeepLabV3+ introduces a decoder module for better processing of the details and edges of the segmentation results. This helps to improve the accuracy of segmentation, especially for the recognition of object edges. At the same time, DeepLabV3+ uses spatial pyramid pooling to capture the multi-scale features of the image, allowing the model to better adapt to objects of different sizes and shapes.

其中,语义分割是计算机视觉领域的一项任务,其目标是为图像中的每个像素分配一个标签,以表示该像素属于图像中的哪个语义类别。语义分割结果是一个与输入图像具有相同尺寸的标签图,其中每个像素都对应于一个语义类别。通过语义分割结果,在大规模标记的数据集上进行训练,以学习像素级别的语义信息。Semantic segmentation is a task in the field of computer vision, which aims to assign a label to each pixel in an image to indicate which semantic category the pixel belongs to in the image. The result of semantic segmentation is a label map with the same size as the input image, where each pixel corresponds to a semantic category. Through the semantic segmentation results, training is performed on a large-scale labeled dataset to learn pixel-level semantic information.

S303:通过小波变换,将RGB图像、HSV图像以及Lab图像的语义分割结果进行融合,得到融合分割图像。S303: The semantic segmentation results of the RGB image, the HSV image and the Lab image are fused through wavelet transform to obtain a fused segmentation image.

其中,小波变换(Wavelet Transform)是一种数学工具,用于将信号或图像分解成不同频率的成分。它具有在时域和频域上提供局部信息的能力,因此在图像处理中得到广泛应用。小波变换具有多尺度分析的特点,能够同时捕捉图像中的细节和整体特征。Among them, wavelet transform is a mathematical tool used to decompose signals or images into components of different frequencies. It has the ability to provide local information in both time and frequency domains, so it is widely used in image processing. Wavelet transform has the characteristics of multi-scale analysis and can capture both details and overall features in an image.

在一种可能的实施方式中,子步骤S303具体包括S3031至S3034:In a possible implementation, sub-step S303 specifically includes S3031 to S3034:

S3031:通过小波变换,从RGB图像、HSV图像以及Lab图像的语义分割结果中分解出低频分量与高频分量。S3031: Decompose low-frequency components and high-frequency components from the semantic segmentation results of the RGB image, the HSV image, and the Lab image through wavelet transform.

在本发明中,小波变换通过多尺度的分解,使得图像在不同频率上的信息得以提取,有助于捕捉图像中的细节和整体特征。In the present invention, wavelet transform extracts information of an image at different frequencies through multi-scale decomposition, which helps to capture details and overall features in the image.

S3032:对于RGB图像、HSV图像以及Lab图像的语义分割结果的低频分量,采用加权平均融合规则,进行融合:S3032: For the low-frequency components of the semantic segmentation results of the RGB image, HSV image, and Lab image, a weighted average fusion rule is used for fusion:

Fmix(x,y)=β1FRGB,l(x,y)+β2FHSV,l(x,y)+β3FLab,l(x,y) Fmix (x,y)= β1FRGB ,l (x,y)+β2FHSV , l (x,y)+ β3FLab ,l (x,y)

其中,Fmix表示融合分割图像,FRGB,l表示RGB图像的语义分割结果中的低频分量,β1表示RGB图像的权重系数,FHSV,l表示HSV图像的语义分割结果中的低频分量,β2表示HSV图像的权重系数,FLab,l表示Lab图像的语义分割结果中的低频分量,β3表示Lab图像的权重系数。Among them, Fmix represents the fused segmentation image, FRGB,l represents the low-frequency component in the semantic segmentation result of the RGB image, β1 represents the weight coefficient of the RGB image, FHSV,l represents the low-frequency component in the semantic segmentation result of the HSV image, β2 represents the weight coefficient of the HSV image, FLab ,l represents the low-frequency component in the semantic segmentation result of the Lab image, and β3 represents the weight coefficient of the Lab image.

其中,本领域技术人员可以根据实际情况设置RGB图像的权重系数β1、HSV图像的权重系数β2以及Lab图像的权重系数β3的大小,本发明不做限定。Among them, those skilled in the art may set the weight coefficient β 1 of the RGB image, the weight coefficient β 2 of the HSV image, and the weight coefficient β 3 of the Lab image according to actual conditions, and the present invention does not limit them.

在本发明中,低频分量采用了加权平均融合规则,考虑到了RGB、HSV、Lab图像的权重。这种加权平均考虑到了各个颜色通道的贡献,使得低频分量更具代表性。同时,低频分量通常包含图像的全局信息和整体结构,通过加权平均融合,全局信息得到了更全面的考虑。这对于语义分割任务而言,有助于更好地理解图像的整体语义结构。In the present invention, the low-frequency component adopts the weighted average fusion rule, taking into account the weights of RGB, HSV, and Lab images. This weighted average takes into account the contribution of each color channel, making the low-frequency component more representative. At the same time, the low-frequency component usually contains the global information and overall structure of the image. Through weighted average fusion, the global information is more comprehensively considered. This is helpful for a better understanding of the overall semantic structure of the image for semantic segmentation tasks.

S3033:对于RGB图像、HSV图像以及Lab图像的语义分割结果的高频分量,采用最大值融合规则,进行融合:S3033: For the high-frequency components of the semantic segmentation results of the RGB image, HSV image, and Lab image, the maximum fusion rule is used for fusion:

Fmix(x,y)=max[FRGB,h(x,y),FRGB,h(x,y),FRGB,h(x,y)] Fmix (x,y)=max[ FRGB,h (x,y), FRGB,h (x,y), FRGB,h (x,y)]

其中,max[]表示取最大值,FRGB,h表示RGB图像的语义分割结果中的高频分量,FHSV,h表示HSV图像的语义分割结果中的高频分量,FLab,h表示Lab图像的语义分割结果中的高频分量。Among them, max[] means taking the maximum value, F RGB,h means the high-frequency component in the semantic segmentation result of the RGB image, F HSV,h means the high-frequency component in the semantic segmentation result of the HSV image, and F Lab,h means the high-frequency component in the semantic segmentation result of the Lab image.

在本发明中,高频分量通常包含图像中的细节和显著特征。通过采用最大值融合规则,选择各通道中高频分量的最大值,强调了各通道中具有最显著信息的特征,有助于突出图像中重要的细节和边缘信息。通过选取高频分量的最大值,可以有效地提高图像的对比度。这是因为选择每个像素位置上的最大值可以使得显著的细节更为突出,增强图像的视觉效果。In the present invention, high-frequency components usually contain details and significant features in the image. By adopting the maximum value fusion rule, the maximum value of the high-frequency components in each channel is selected, which emphasizes the features with the most significant information in each channel, and helps to highlight the important details and edge information in the image. By selecting the maximum value of the high-frequency component, the contrast of the image can be effectively improved. This is because selecting the maximum value at each pixel position can make the significant details more prominent and enhance the visual effect of the image.

S3034:将经过融合的频率分量,通过逆小波变换,得到融合分割图像。S3034: Perform inverse wavelet transform on the fused frequency components to obtain a fused segmented image.

其中,逆小波变换(Inverse WaveletTransform,IWT)是小波变换的逆过程。在小波分析中,信号或图像可以通过小波变换分解为多个频带,而逆小波变换则是将这些频带重新组合,恢复原始信号或图像。Among them, the inverse wavelet transform (IWT) is the inverse process of wavelet transform. In wavelet analysis, a signal or image can be decomposed into multiple frequency bands through wavelet transform, and the inverse wavelet transform is to recombine these frequency bands to restore the original signal or image.

S304:将融合分割图像与滤波处理后的原始桌面图像输入至U-Net神经网络中,分割出骨碟图像。S304: Input the fused segmented image and the filtered original desktop image into a U-Net neural network to segment the bone disc image.

S4:引入Canny算子,检测骨碟图像中的骨碟轮廓,提取出骨碟区域。S4: Introduce the Canny operator to detect the bone disc outline in the bone disc image and extract the bone disc area.

其中,Canny边缘检测算子是一种常用于图像处理中的边缘检测方法,具体内容可以参见相关现有技术,本发明不再赘述。Among them, the Canny edge detection operator is an edge detection method commonly used in image processing. The specific content can be found in the relevant prior art, and the present invention will not be repeated.

在一种可能的实施方式中,本发明提出了一种全新的Canny边缘检测技术。S4具体包括子步骤S401至S407:In a possible implementation, the present invention proposes a new Canny edge detection technology. S4 specifically includes sub-steps S401 to S407:

S401:生成骨碟图像的灰度直方图。S401: Generate a grayscale histogram of the bone disc image.

在本发明中,通过生成骨碟图像的灰度直方图,可以对图像的灰度分布进行可视化和分析,有助于了解骨碟图像的整体亮度和对比度特征,为后续的处理步骤提供参考。In the present invention, by generating a grayscale histogram of the bone disc image, the grayscale distribution of the image can be visualized and analyzed, which helps to understand the overall brightness and contrast characteristics of the bone disc image and provide a reference for subsequent processing steps.

S402:计算骨碟图像的梯度分量:S402: Calculate the gradient component of the bone disc image:

其中,Gx表示水平梯度分量,Gy表示竖直梯度分量,(x,y)表示像素点坐标,h表示桌面图像。Wherein, Gx represents the horizontal gradient component, Gy represents the vertical gradient component, (x, y) represents the pixel coordinates, and h represents the desktop image.

在本发明中,计算骨碟图像的梯度分量有助于捕捉图像中的边缘信息。梯度表示图像像素值的变化情况,因此通过计算梯度分量,可以找到图像中的边缘位置,对于后续的边缘检测和区域分割是重要的先决条件。In the present invention, calculating the gradient component of the bone disc image helps to capture the edge information in the image. The gradient represents the change in the pixel value of the image, so by calculating the gradient component, the edge position in the image can be found, which is an important prerequisite for subsequent edge detection and region segmentation.

S403:计算像素点的梯度强度和梯度方向:S403: Calculate the gradient intensity and gradient direction of the pixel:

其中,G表示梯度强度,θ表示梯度方向。Among them, G represents the gradient strength and θ represents the gradient direction.

其中,梯度强度是梯度的模或大小,用来度量图像中像素值的变化幅度。The gradient strength is the modulus or size of the gradient, which is used to measure the magnitude of the change in pixel values in an image.

其中,梯度方向表示梯度向量的方向,即图像中像素值变化最快的方向。The gradient direction refers to the direction of the gradient vector, that is, the direction in which the pixel value in the image changes fastest.

S404:当骨碟图像存在多个梯度信息时,保留极大值像素点,抑制非极大值像素点。S404: When the bone disc image has multiple gradient information, retain the maximum pixel points and suppress the non-maximum pixel points.

在本发明中,在梯度方向上保留局部最大值,抑制非极大值,有助于细化边缘,提高检测的准确性。In the present invention, the local maximum value is retained in the gradient direction and the non-maximum value is suppressed, which helps to refine the edge and improve the accuracy of detection.

S405:设置高阈值以及低阈值,当像素点的梯度强度大于高阈值时,确定像素点为强边缘像素点。当像素点的梯度强度在低阈值与高阈值之间时,确定像素点为弱边缘像素点。当像素点的边缘像素梯度值小于低阈值时,对像素点进行抑制。S405: Set a high threshold and a low threshold. When the gradient strength of a pixel is greater than the high threshold, the pixel is determined to be a strong edge pixel. When the gradient strength of a pixel is between the low threshold and the high threshold, the pixel is determined to be a weak edge pixel. When the edge pixel gradient value of a pixel is less than the low threshold, the pixel is suppressed.

在一种可能的实施方式中,本发明提出了一种全新的高阈值以及低阈值的确定方式,具体为:In a possible implementation manner, the present invention proposes a new method for determining the high threshold and the low threshold, specifically:

确定当分割阈值k,0≤k≤255。Determine the segmentation threshold k, 0≤k≤255.

统计在当前分割阈值k的分割下,灰度值处于[0,k]范围内的前景像素点占骨碟图像的比例rf、前景像素点的平均灰度uf以及灰度值处于(k,255]范围内的背景像素点占骨碟图像的比例ra、背景像素点的平均灰度uaUnder the current segmentation threshold k, the proportion of foreground pixels with grayscale values in the range of [0, k] in the bone disc image is r f , the average grayscale of foreground pixels is u f , and the proportion of background pixels with grayscale values in the range of (k, 255] in the bone disc image is ra , and the average grayscale of background pixels is u a .

计算在当前分割阈值k的分割下的类间方差:Calculate the inter-class variance under the segmentation of the current segmentation threshold k:

σ2=rfra(uf-ua)2 σ 2 = r f r a ( u f - u a ) 2

其中,σ2表示类间方差。Among them, σ 2 represents the between-class variance.

将类间方差最大值对应的分割阈值作为最优分割阈值kmThe segmentation threshold corresponding to the maximum inter-class variance is taken as the optimal segmentation threshold km .

在本发明中,选择类间方差最大的阈值,有助于提高分割的准确性。In the present invention, selecting a threshold with the largest inter-class variance helps to improve the accuracy of segmentation.

根据最优分割阈值km确定高阈值以及低阈值:Determine the high threshold and the low threshold according to the optimal segmentation threshold km :

H=km H=k m

其中,H表示高阈值,L表示低阈值。Among them, H represents the high threshold and L represents the low threshold.

需要说明的是,通过将高阈值设置为最优分割阈值,确保了对于前景和背景之间的差异足够敏感。这种设置使得高阈值能够更好地区分目标对象(骨碟区域)和背景。而将低阈值设置为最优分割阈值的1/3,有助于处理图像中的噪声或细微变化。较低的低阈值可以提高对于灰度变化较小区域的敏感性,从而增强了整体分割的鲁棒性。It should be noted that by setting the high threshold as the optimal segmentation threshold, it is ensured to be sensitive enough to the difference between the foreground and the background. This setting enables the high threshold to better distinguish the target object (bone disc area) from the background. Setting the low threshold to 1/3 of the optimal segmentation threshold helps to deal with noise or subtle changes in the image. A lower low threshold can increase the sensitivity to areas with small grayscale changes, thereby enhancing the robustness of the overall segmentation.

在本发明中,采用动态调整的方式确定分割阈值。这允许在不同图像或场景中适应性地选择最优的分割阈值,而不是采用固定的阈值。这对于不同照明条件或拍摄环境下的图像分割尤为重要。In the present invention, the segmentation threshold is determined by a dynamic adjustment method. This allows the optimal segmentation threshold to be adaptively selected in different images or scenes, rather than using a fixed threshold. This is particularly important for image segmentation under different lighting conditions or shooting environments.

S406:连接强边缘像素点,得到骨碟轮廓。S406: Connect the strong edge pixels to obtain the bone disc outline.

在本发明中,通过设置高阈值和低阈值,可以将梯度图像分为强边缘和弱边缘。连接强边缘像素点形成边缘轮廓,这有助于提取出骨碟图像中的边缘信息。In the present invention, by setting a high threshold and a low threshold, the gradient image can be divided into strong edges and weak edges. The strong edge pixels are connected to form an edge contour, which helps to extract the edge information in the bone dish image.

S407:根据骨碟轮廓,提取出骨碟区域。S407: Extract the bone disc area according to the bone disc contour.

在本发明中,引入Canny算子有助于提高对骨碟图像中骨碟轮廓的准确性、鲁棒性和可靠性,为后续的骨碟区域提取和分析提供了高质量的输入。In the present invention, the introduction of the Canny operator helps to improve the accuracy, robustness and reliability of the bone disc contour in the bone disc image, and provides high-quality input for subsequent bone disc region extraction and analysis.

S5:计算骨碟轮廓的轮廓完整度。S5: Calculate the contour completeness of the bone disc contour.

在一种可能的实施方式中,S5具体为:根据以下公式,计算骨碟轮廓的轮廓完整度:In a possible implementation, S5 specifically includes: calculating the contour completeness of the bone disc contour according to the following formula:

其中,O表示轮廓完整度,Sa表示骨碟实际面积,Sm表示骨碟区域的最小外接圆面积。Among them, O represents the contour completeness, Sa represents the actual area of the bone disc, and Sm represents the minimum circumscribed circle area of the bone disc area.

其中,轮廓完整度是一个用于量化骨碟形状整体性的指标。通过计算骨碟轮廓实际面积与其最小外接圆面积之比,可以得到一个在0到1之间的数值,用于衡量骨碟轮廓的紧凑程度和完整性。Among them, the contour completeness is an indicator used to quantify the integrity of the bone disc shape. By calculating the ratio of the actual area of the bone disc contour to the area of its minimum circumscribed circle, a value between 0 and 1 can be obtained to measure the compactness and completeness of the bone disc contour.

参考说明书附图2,示出了本发明提供的一种骨碟图像的示意图。Referring to Figure 2 of the specification, there is shown a schematic diagram of a bone disc image provided by the present invention.

可以理解的是,如图2所示,当残余食物漫出骨碟时,骨碟的轮廓完整度将遭到破坏,可以依此来评估是否需要更换骨碟。It is understandable that, as shown in FIG. 2 , when residual food overflows the bone dish, the integrity of the bone dish's contour will be destroyed, which can be used to assess whether the bone dish needs to be replaced.

S6:对骨碟区域进行二值化处理。S6: Binarization processing is performed on the bone disc area.

其中,二值化处理是将一幅灰度图像转换为只包含两个灰度值(通常是0和255)的图像的过程。该过程的主要目的是简化图像,并突出显示图像中的目标区域。在二值图像中,通常将目标区域表示为白色(255),而背景则表示为黑色(0)。Among them, binarization is the process of converting a grayscale image into an image containing only two grayscale values (usually 0 and 255). The main purpose of this process is to simplify the image and highlight the target area in the image. In a binary image, the target area is usually represented as white (255) and the background is represented as black (0).

在本发明中,二值化处理可以强化骨碟区域的轮廓,使其更加清晰。这有助于后续的图像分析和处理,尤其是对轮廓信息敏感的算法。同时,将图像转换为二值形式可以大大简化对骨碟区域的分析。在二值图像中,每个像素只有两个取值,这降低了数据的复杂性,使得算法更容易实现和理解。In the present invention, the binarization process can strengthen the outline of the bone disc area and make it clearer. This helps the subsequent image analysis and processing, especially the algorithm that is sensitive to the outline information. At the same time, converting the image into a binary form can greatly simplify the analysis of the bone disc area. In a binary image, each pixel has only two values, which reduces the complexity of the data and makes the algorithm easier to implement and understand.

S7:计算骨碟区域中的白色像素总数以及边缘白色像素占比。S7: Calculate the total number of white pixels in the bone disc area and the percentage of white pixels at the edge.

需要说明的是,本发明应用过程中,骨碟的颜色是白色的,一般餐厅也都会采用白色的骨碟。因此,白色像素总数以及边缘白色像素占比都可以评估骨碟中已有的残余食物的量。It should be noted that, in the application process of the present invention, the color of the bone dish is white, and most restaurants also use white bone dishes. Therefore, the total number of white pixels and the proportion of edge white pixels can evaluate the amount of residual food in the bone dish.

在一种可能的实施方式中,S7具体包括子步骤S701至S703:In a possible implementation, S7 specifically includes sub-steps S701 to S703:

S701:提取骨碟区域中的白色像素点,统计处白色像素总数SwS701: Extract white pixel points in the bone disc area and count the total number of white pixels S w .

S702:判断白色像素点是否通过其他白色像素点与骨碟轮廓连通。若是,确定为边缘白色像素,并予以保留。否则,予以去除。S702: Determine whether the white pixel is connected to the bone disc contour through other white pixels. If so, determine it as an edge white pixel and keep it. Otherwise, remove it.

需要说明的是,如图2所示,之所以需要对未能通过其他白色像素点与骨碟轮廓连通的非边缘白色像素点进行去除,是因为很可能有些残余食物本身也是白色的,将其纳入计算范围将会降低后续骨碟填充度计算的准确性。It should be noted that, as shown in Figure 2, the reason why non-edge white pixels that are not connected to the bone dish outline through other white pixels need to be removed is because it is very likely that some residual food itself is also white. Including it in the calculation range will reduce the accuracy of subsequent bone dish filling calculations.

S703:计算出骨碟区域中的边缘白色像素占比:S703: Calculate the ratio of edge white pixels in the bone disc area:

其中,R表示边缘白色像素占比,Swe表示边缘白色像素总数,S表示骨碟区域像素总数。Among them, R represents the ratio of white pixels at the edge, S we represents the total number of white pixels at the edge, and S represents the total number of pixels in the bone disc area.

S8:根据骨碟轮廓的轮廓完整度以及骨碟区域中的白色像素总数以及边缘白色像素占比,计算骨碟填充度。S8: Calculate the bone disc filling degree according to the outline completeness of the bone disc outline, the total number of white pixels in the bone disc area, and the proportion of white pixels at the edge.

在一种可能的实施方式中,S8具体为:根据以下公式,计算骨碟填充度:In a possible implementation, S8 specifically includes: calculating the bone dish filling degree according to the following formula:

σ=λ1O+λ2Sw3Rσ=λ 1 O+λ 2 S w3 R

其中,σ表示骨碟填充度,O表示轮廓完整度,λ1表示轮廓完整度的权重系数,Sw表示白色像素总数,λ2表示白色像素总数的权重系数,R表示边缘白色像素占比,λ3表示边缘白色像素占比的权重系数。Among them, σ represents the bone disc filling degree, O represents the contour completeness, λ1 represents the weight coefficient of the contour completeness, S w represents the total number of white pixels, λ2 represents the weight coefficient of the total number of white pixels, R represents the proportion of edge white pixels, and λ3 represents the weight coefficient of the proportion of edge white pixels.

其中,本领域技术人员可以根据实际情况设置轮廓完整度的权重系数λ1、白色像素总数的权重系数λ2以及边缘白色像素占比的权重系数λ3的大小,本发明不做限定。Among them, those skilled in the art may set the weight coefficient λ 1 of contour completeness, the weight coefficient λ 2 of the total number of white pixels, and the weight coefficient λ 3 of the edge white pixel ratio according to actual conditions, and the present invention does not limit this.

在本发明中,通过考虑轮廓完整度、白色像素总数和边缘白色像素占比等多个因素,系统可以更全面地了解骨碟的状态,有助于提高系统对骨碟状态的判断准确度。In the present invention, by considering multiple factors such as contour completeness, total number of white pixels and proportion of edge white pixels, the system can have a more comprehensive understanding of the state of the bone disc, which helps to improve the accuracy of the system's judgment on the state of the bone disc.

S9:当骨碟填充度大于预设填充度时,对相应的骨碟进行更换。S9: When the filling degree of the bone dish is greater than the preset filling degree, the corresponding bone dish is replaced.

其中,本领域技术人员可以根据实际情况设置预设填充度的大小,本发明不做限定。Among them, those skilled in the art can set the size of the preset filling degree according to actual conditions, and the present invention does not limit this.

具体而言,可以采用自动化装置自动更换骨碟,也可以在骨碟填充度大于预设填充度时向服务员发出提醒播报,提醒服务员进行更换。Specifically, an automated device may be used to automatically replace the bone dish, or a reminder may be broadcast to the waiter when the filling degree of the bone dish is greater than a preset filling degree, reminding the waiter to replace it.

在本发明中,在残余食物的填充度达到预设条件时,对骨碟进行更换,无需服务员在就餐中途时刻监测骨碟状态,省时省力,能够提供实时、连续的监测,及时响应所有餐桌需求,实现对于骨碟的及时更换,提升服务效率,保持餐桌的整洁性,提升食客的就餐体验。In the present invention, when the filling degree of residual food reaches a preset condition, the bone dish is replaced. There is no need for the waiter to monitor the status of the bone dish all the time during the meal, which saves time and effort, can provide real-time and continuous monitoring, and respond to all table needs in time, so as to achieve timely replacement of bone dishes, improve service efficiency, keep the table clean, and enhance the dining experience of diners.

与现有技术相比,本发明至少具有以下有益技术效果:Compared with the prior art, the present invention has at least the following beneficial technical effects:

在本发明中,通过图像识别的方式,自动化识别骨碟中的残余食物是否已经填的够满,在残余食物的填充度达到预设条件时,对骨碟进行更换,无需服务员在就餐中途时刻监测骨碟状态,省时省力,能够提供实时、连续的监测,及时响应所有餐桌需求,实现对于骨碟的及时更换,提升服务效率,保持餐桌的整洁性,提升食客的就餐体验。In the present invention, image recognition is used to automatically identify whether the residual food in the bone dish is full enough. When the filling degree of the residual food reaches a preset condition, the bone dish is replaced. There is no need for the waiter to monitor the status of the bone dish all the time during the meal, which saves time and effort, can provide real-time and continuous monitoring, and respond to all table needs in time, so as to realize timely replacement of bone dishes, improve service efficiency, keep the table clean, and enhance the dining experience of diners.

实施例2Example 2

在一个实施例中,参考说明书附图3,示出了本发明提供的一种基于图像识别的骨碟更换系统的结构示意图。In one embodiment, referring to FIG3 of the specification, a schematic diagram of the structure of a bone disc replacement system based on image recognition provided by the present invention is shown.

本发明提供的一种基于图像识别的骨碟更换系统20,包括处理器201和用于存储处理器201可执行指令的存储器202。处理器201被配置为调用存储器202存储的指令,以执行实施例1中的基于图像识别的骨碟更换方法。The present invention provides a bone disc replacement system 20 based on image recognition, comprising a processor 201 and a memory 202 for storing executable instructions of the processor 201. The processor 201 is configured to call the instructions stored in the memory 202 to execute the bone disc replacement method based on image recognition in Example 1.

本发明提供的一种基于图像识别的骨碟更换系统可以实现上述实施例1中的基于图像识别的骨碟更换方法的步骤和效果,为避免重复,本发明不再赘述。The bone disc replacement system based on image recognition provided by the present invention can realize the steps and effects of the bone disc replacement method based on image recognition in the above-mentioned embodiment 1. To avoid repetition, the present invention will not go into details.

与现有技术相比,本发明至少具有以下有益技术效果:Compared with the prior art, the present invention has at least the following beneficial technical effects:

在本发明中,通过图像识别的方式,自动化识别骨碟中的残余食物是否已经填的够满,在残余食物的填充度达到预设条件时,对骨碟进行更换,无需服务员在就餐中途时刻监测骨碟状态,省时省力,能够提供实时、连续的监测,及时响应所有餐桌需求,实现对于骨碟的及时更换,提升服务效率,保持餐桌的整洁性,提升食客的就餐体验。In the present invention, image recognition is used to automatically identify whether the residual food in the bone dish is full enough. When the filling degree of the residual food reaches a preset condition, the bone dish is replaced. There is no need for the waiter to monitor the status of the bone dish all the time during the meal, which saves time and effort, can provide real-time and continuous monitoring, and respond to all table needs in time, so as to realize timely replacement of bone dishes, improve service efficiency, keep the table clean, and enhance the dining experience of diners.

以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

以上实施例仅表达了本发明的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本发明构思的前提下,还可以做出若干变形和改进,这些都属于本发明的保护范围。因此,本发明专利的保护范围应以所附权利要求为准。The above embodiments only express several implementation methods of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for those of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.

Claims (10)

1. A bone disk replacement method based on image recognition, comprising:
S1: acquiring a desktop image;
s2: performing filtering processing on the desktop image based on adaptive smoothing filtering;
s3: based on the neural network, dividing a bone disk image from the desktop image after the filtering treatment;
S4: introducing a Canny operator, detecting the outline of the bone plate in the bone plate image, and extracting a bone plate area;
s5: calculating the profile integrity of the bone plate profile;
S6: performing binarization processing on the bone plate area;
s7: calculating the total number of white pixels and the edge white pixel ratio in the bone plate area;
S8: calculating the filling degree of the bone plate according to the outline integrity of the outline of the bone plate, the total number of white pixels in the bone plate area and the edge white pixel ratio;
s9: and when the filling degree of the bone plate is larger than the preset filling degree, replacing the corresponding bone plate.
2. The method for replacing a bone disc based on image recognition according to claim 1, wherein S2 specifically comprises:
s201: computing gradient components of the desktop image:
Wherein G x represents a horizontal gradient component, G y represents a vertical gradient component, (x, y) represents pixel coordinates, and f represents a desktop image;
S202: calculating the filtering weight value of each pixel point:
wherein w represents a filtering weight value, exp represents an exponential function based on e, and h represents an edge preserving amplitude coefficient;
S203: according to the filtering weight value of each pixel point, carrying out filtering processing on the desktop image:
Where t represents the iteration number, f t+1 represents the desktop image after t+1 times of filtering processing, and f t represents the desktop image after t times of filtering processing.
3. The method for replacing a bone disc based on image recognition according to claim 1, wherein the step S3 specifically comprises:
s301: converting the original desktop image after the filtering treatment into an RGB image, an HSV image and a Lab image respectively;
S302: acquiring semantic segmentation results of the RGB image, the HSV image and the Lab image through DeepLabV & lt3+ & gt network;
s303: fusing semantic segmentation results of the RGB image, the HSV image and the Lab image through wavelet transformation to obtain a fused segmentation image;
s304: and inputting the fused segmented image and the filtered original desktop image into a U-Net neural network to segment out a bone disk image.
4. The method for replacing a bone disc based on image recognition according to claim 3, wherein the step S303 specifically comprises:
s3031: decomposing a low-frequency component and a high-frequency component from semantic segmentation results of the RGB image, the HSV image and the Lab image through wavelet transformation;
S3032: and fusing low-frequency components of semantic segmentation results of the RGB image, the HSV image and the Lab image by adopting a weighted average fusion rule:
Fmix(x,y)=β1FRGB,l(x,y)+β2FHSV,l(x,y)+β3FLab,l(x,y)
Wherein F mix represents a fusion segmented image, F RGB,l represents a low-frequency component in a semantic segmentation result of an RGB image, β 1 represents a weight coefficient of the RGB image, F HSV,l represents a low-frequency component in a semantic segmentation result of an HSV image, β 2 represents a weight coefficient of the HSV image, F Lab,l represents a low-frequency component in a semantic segmentation result of a Lab image, and β 3 represents a weight coefficient of the Lab image;
S3033: and fusing high-frequency components of semantic segmentation results of the RGB image, the HSV image and the Lab image by adopting a maximum value fusion rule:
Fmix(x,y)=max[FRGB,h(x,y),FRGB,h(x,y),FRGB,h(x,y)]
wherein max [ ] represents taking the maximum value, F RGB,h represents a high-frequency component in the semantic segmentation result of the RGB image, F HSV,h represents a high-frequency component in the semantic segmentation result of the HSV image, and F Lab,h represents a high-frequency component in the semantic segmentation result of the Lab image;
S3034: and obtaining a fused segmented image through inverse wavelet transformation of the fused frequency components.
5. The method for replacing a bone disc based on image recognition according to claim 1, wherein S4 specifically comprises:
S401: generating a gray level histogram of the bone plate image;
S402: calculating gradient components of the bone plate image:
Wherein G x represents a horizontal gradient component, G y represents a vertical gradient component, (x, y) represents pixel coordinates, and h represents a desktop image;
s403: calculating the gradient intensity and gradient direction of the pixel points:
Wherein G represents gradient strength, and θ represents gradient direction;
S404: when the bone disk image has a plurality of gradient information, reserving maximum value pixel points and inhibiting non-maximum value pixel points;
S405: setting a high threshold and a low threshold, and determining the pixel point as a strong edge pixel point when the gradient strength of the pixel point is greater than the high threshold; when the gradient strength of the pixel points is between the low threshold value and the high threshold value, determining that the pixel points are weak edge pixel points; when the edge pixel gradient value of the pixel point is smaller than the low threshold value, suppressing the pixel point;
S406: connecting the strong edge pixel points to obtain the outline of the bone plate;
s407: and extracting a bone plate area according to the bone plate outline.
6. The method for replacing a bone disk based on image recognition according to claim 5, wherein the determination modes of the high threshold and the low threshold are specifically as follows:
determining that k is more than or equal to 0 and less than or equal to 255 when the threshold k is segmented;
Counting the proportion r f of foreground pixel points with gray values in the range of [0, k ] to the bone plate image, the average gray u f of the foreground pixel points, the proportion r a of background pixel points with gray values in the range of (k, 255) to the bone plate image and the average gray u a of the background pixel points under the current segmentation threshold k;
calculating the inter-class variance of the partition under the current partition threshold k:
σ2=rfra(uf-ua)2
Wherein σ 2 represents the inter-class variance;
taking a segmentation threshold corresponding to the maximum value of the inter-class variance as an optimal segmentation threshold k m;
Determining the high threshold and the low threshold according to an optimal segmentation threshold k m:
H=km
where H represents a high threshold and L represents a low threshold.
7. The method for replacing a bone disc based on image recognition according to claim 1, wherein S5 is specifically:
Calculating the profile integrity of the bone plate profile according to the following formula:
Where O represents the contour integrity, S a represents the actual area of the bone disk, and S m represents the minimum circumscribed circle area of the bone disk area.
8. The method for replacing a bone disc based on image recognition according to claim 1, wherein the step S7 specifically comprises:
S701: extracting white pixel points in the bone plate area, and counting the total number S w of white pixels;
S702: judging whether the white pixel points are communicated with the outline of the bone plate through other white pixel points; if yes, determining the pixel as an edge white pixel and reserving the pixel; otherwise, removing;
s703: calculating the edge white pixel ratio in the bone plate area:
Wherein R represents an edge white pixel ratio, S we represents an edge white pixel total number, and S represents a bone disk region pixel total number.
9. The method for replacing a bone disc based on image recognition according to claim 1, wherein S8 is specifically:
the bone plate filling degree was calculated according to the following formula:
σ=λ1O+λ2Sw3R
Wherein σ represents the bone plate filling degree, O represents the contour integrity, λ 1 represents the weight coefficient of the contour integrity, S w represents the total number of white pixels, λ 2 represents the weight coefficient of the total number of white pixels, R represents the edge white pixel duty ratio, and λ 3 represents the weight coefficient of the edge white pixel duty ratio.
10. A bone disc replacement system based on image recognition, comprising a processor and a memory for storing processor executable instructions; the processor is configured to invoke the instructions stored in the memory to perform the image recognition based bone disc replacement method of any of claims 1 to 9.
CN202410060918.9A 2024-01-16 2024-01-16 A bone disc replacement method and system based on image recognition Active CN118038446B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410060918.9A CN118038446B (en) 2024-01-16 2024-01-16 A bone disc replacement method and system based on image recognition

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410060918.9A CN118038446B (en) 2024-01-16 2024-01-16 A bone disc replacement method and system based on image recognition

Publications (2)

Publication Number Publication Date
CN118038446A true CN118038446A (en) 2024-05-14
CN118038446B CN118038446B (en) 2025-02-07

Family

ID=90995882

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410060918.9A Active CN118038446B (en) 2024-01-16 2024-01-16 A bone disc replacement method and system based on image recognition

Country Status (1)

Country Link
CN (1) CN118038446B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005070908A (en) * 2003-08-20 2005-03-17 Matsumoto Takashi Measuring method and system for in-hospital meal intake
CN104463167A (en) * 2014-11-20 2015-03-25 中国科学院上海微系统与信息技术研究所 Automatic restaurant settlement method and system
CN112132153A (en) * 2020-09-22 2020-12-25 山东大学 Tomato fruit recognition method and system based on clustering and morphological processing
JP2021096766A (en) * 2019-12-19 2021-06-24 キヤノンマーケティングジャパン株式会社 Information processing device, information processing system, notification method, and program
CN114764810A (en) * 2021-01-15 2022-07-19 南京医智镜医疗科技有限公司 Medical image segmentation method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005070908A (en) * 2003-08-20 2005-03-17 Matsumoto Takashi Measuring method and system for in-hospital meal intake
CN104463167A (en) * 2014-11-20 2015-03-25 中国科学院上海微系统与信息技术研究所 Automatic restaurant settlement method and system
JP2021096766A (en) * 2019-12-19 2021-06-24 キヤノンマーケティングジャパン株式会社 Information processing device, information processing system, notification method, and program
CN112132153A (en) * 2020-09-22 2020-12-25 山东大学 Tomato fruit recognition method and system based on clustering and morphological processing
CN114764810A (en) * 2021-01-15 2022-07-19 南京医智镜医疗科技有限公司 Medical image segmentation method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
张先洁 等: "基于超像素特征向量的果树冠层分割方法", 江苏农业学报, no. 3, 30 June 2021 (2021-06-30), pages 724 - 730 *

Also Published As

Publication number Publication date
CN118038446B (en) 2025-02-07

Similar Documents

Publication Publication Date Title
CN107194919B (en) Mobile phone screen defect detection method based on regular texture background reconstruction
CN105004737B (en) Fruit surface defect detection method based on adaptive impovement type gradient information
CN111161222B (en) A Visual Saliency Based Defect Detection Method for Printing Cylinders
CN110782413B (en) Image processing method, device, equipment and storage medium
CN102959582B (en) Image processing apparatus
CN109544583B (en) Method, device and equipment for extracting interested area of leather image
CN115082451B (en) Stainless steel soup ladle defect detection method based on image processing
Nevriyanto et al. Image enhancement using the image sharpening, contrast enhancement, and Standard Median Filter (Noise Removal) with pixel-based and human visual system-based measurements
CN107392904A (en) A kind of partitioning algorithm of the medical image based on mathematical morphology
CN118172608B (en) Method and system for analyzing bacterial culture image of helicobacter pylori
CN104616259B (en) A kind of adaptive non-local mean image de-noising method of noise intensity
CN109376782B (en) Support vector machine cataract classification method and device based on eye image features
CN103700077B (en) A kind of method for adaptive image enhancement based on human-eye visual characteristic
CN102118547A (en) Image weighted filtering method
CN118154518A (en) Pole piece defect detection method and device based on multi-scale wavelet transformation
CN116596879A (en) Grape downy mildew self-adaptive identification method based on quantiles of boundary samples
CN117576137A (en) Rock slice image edge detection method based on improved canny algorithm
CN106327436A (en) Filtering method and device based on multichannel noise detection
CN115100077B (en) Image enhancement method and device
CN103839245A (en) Retinex night color image enhancement method based on statistical regularities
CN110298835B (en) A leather surface damage detection method, system and related device
JP2018185265A (en) Information processor, method for control, and program
CN100367770C (en) Method for removing isolated noise point in video
CN118038446A (en) Bone disc replacement method and system based on image recognition
Dannemiller et al. A new method for the segmentation of algae images using retinex and support vector machine

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
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载