[go: up one dir, main page]

CN114693629A - Image recognition method and device, electronic equipment and readable medium - Google Patents

Image recognition method and device, electronic equipment and readable medium Download PDF

Info

Publication number
CN114693629A
CN114693629A CN202210301397.2A CN202210301397A CN114693629A CN 114693629 A CN114693629 A CN 114693629A CN 202210301397 A CN202210301397 A CN 202210301397A CN 114693629 A CN114693629 A CN 114693629A
Authority
CN
China
Prior art keywords
image
target image
color distribution
edge
distribution condition
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
CN202210301397.2A
Other languages
Chinese (zh)
Other versions
CN114693629B (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.)
Beijing Chengshi Wanglin Information Technology Co Ltd
Original Assignee
Beijing Chengshi Wanglin Information 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 Beijing Chengshi Wanglin Information Technology Co Ltd filed Critical Beijing Chengshi Wanglin Information Technology Co Ltd
Priority to CN202210301397.2A priority Critical patent/CN114693629B/en
Publication of CN114693629A publication Critical patent/CN114693629A/en
Application granted granted Critical
Publication of CN114693629B publication Critical patent/CN114693629B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics

Landscapes

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

Abstract

The embodiment of the invention provides an image identification method, an image identification device, electronic equipment and a readable medium, wherein the method comprises the following steps: acquiring a target image submitted to an application program; extracting contour edge lines from the target image; determining an edge region in the target image based on the contour edge line; determining the color distribution condition of the edge area; when the color distribution condition meets a preset color distribution condition, identifying the target image as a screen shot image; wherein the color distribution condition is based on a background correspondence setting when an image is viewed in the application program. According to the embodiment of the invention, whether the target image is the screen capture image is determined by automatically identifying whether the edge area of the target image meets the color distribution condition, so that the identification efficiency of the screen capture image is improved.

Description

图像识别方法、装置、电子设备及可读介质Image recognition method, device, electronic device and readable medium

技术领域technical field

本发明实施例涉及互联网技术领域,特别是涉及一种图像识别方法、一种图像识别装置、一种电子设备以及一种计算机可读介质。Embodiments of the present invention relate to the field of Internet technologies, and in particular, to an image recognition method, an image recognition apparatus, an electronic device, and a computer-readable medium.

背景技术Background technique

随着互联网技术的发展,用户通过在智能手机、计算机等终端设备中安装的应用程序(Application,APP)实现网络购物、房屋交易、找工作等服务,不仅大大提高了人们生活的便利性,也丰富了生活的多样性。With the development of Internet technology, users can realize online shopping, house transaction, job search and other services through applications (Application, APP) installed in terminal devices such as smartphones and computers, which not only greatly improves the convenience of people's life, but also enrich the diversity of life.

在用户使用应用程序提供的各项服务时,可以通过图像来确定是否进行网络购物或者房屋交易等等。然而,应用程序中的帖子数量庞大,可能会存在发布有包括盗用合法用户的图像的帖子,目前常见的盗图方式之一是截屏,通过截屏得到图像为截屏图像。When the user uses the various services provided by the application, the image can be used to determine whether to conduct online shopping or house transaction, etc. However, the number of posts in the application is huge, and there may be posts that include images that embezzle legitimate users. One of the common ways of stealing images is to take screenshots, and the images obtained by taking screenshots are screenshots.

目前是通过人工审核的方式,来识别用户上传的图像是否截屏图像。然而,单纯的依靠人工审核存在成本较高的缺点,此外,受限于人工识别效率低的缺点,面对应用程序中的帖子数量庞大的问题,无法对所有用户上传的图像做到及时的审核,因此会产生大量的截屏图像在线上出现的风险,进而影响用户使用体验。Currently, manual review is used to identify whether an image uploaded by a user is a screenshot image. However, relying solely on manual review has the disadvantage of high cost. In addition, due to the low efficiency of manual recognition, facing the huge number of posts in the application, it is impossible to review all images uploaded by users in a timely manner. , so there is a risk of a lot of screenshots appearing online, which in turn affects the user experience.

发明内容SUMMARY OF THE INVENTION

本发明实施例是提供一种图像识别方法、装置、电子设备以及计算机可读存储介质,以解决无法及时审核截屏图像的问题。Embodiments of the present invention provide an image recognition method, apparatus, electronic device, and computer-readable storage medium, so as to solve the problem of inability to review screenshot images in time.

本发明实施例公开了一种图像识别方法,所述方法包括:The embodiment of the present invention discloses an image recognition method, and the method includes:

获取提交至应用程序的目标图像;Get the target image submitted to the application;

从所述目标图像中提取轮廓边缘线;extracting contour edge lines from the target image;

基于所述轮廓边缘线,在所述目标图像中确定边缘区域;determining edge regions in the target image based on the contour edge lines;

确定所述边缘区域的色彩分布情况;determining the color distribution of the edge region;

在所述色彩分布情况满足预设色彩分布条件时,将所述目标图像识别为截屏图像;其中,所述色彩分布条件为基于在所述应用程序中查看图像时的背景对应设置。When the color distribution condition satisfies a preset color distribution condition, the target image is identified as a screenshot image; wherein, the color distribution condition is based on the background corresponding setting when viewing the image in the application program.

可选地,所述基于所述轮廓边缘线,在所述目标图像中确定边缘区域,包括:Optionally, the determining an edge area in the target image based on the contour edge line includes:

分别获取所述轮廓边缘线的至少两个像素坐标,以及所述轮廓边缘线与所述目标图像的边缘之间的距离;respectively acquiring at least two pixel coordinates of the contour edge line and the distance between the contour edge line and the edge of the target image;

根据所述像素坐标确定所述轮廓边缘线的角度;Determine the angle of the contour edge line according to the pixel coordinates;

将所述角度为预设角度、且与所述目标图像的边缘之间的距离最小的预设数量的所述轮廓边缘线,确定为目标轮廓边缘线;Determining a preset number of the contour edge lines whose angle is a preset angle and the distance from the edge of the target image is the smallest as the target contour edge line;

将所述目标轮廓边缘线与所述目标图像的边缘之间的所述目标图像,确定为边缘区域。The target image between the target contour edge line and the edge of the target image is determined as an edge area.

可选地,在所述根据所述像素坐标确定所述轮廓边缘线的角度之后,所述方法还包括:Optionally, after determining the angle of the contour edge line according to the pixel coordinates, the method further includes:

在不存在所述角度为预设角度的所述轮廓边缘线时,将所述目标图像识别为非截屏图像。When there is no contour edge line whose angle is a preset angle, the target image is identified as a non-screenshot image.

可选地,所述确定所述边缘区域的色彩分布情况,包括:Optionally, the determining the color distribution of the edge region includes:

获取所述边缘区域中像素的像素值;obtaining the pixel value of the pixel in the edge area;

采用所述像素值计算所述边缘区域的均值和方差;所述均值和所述方差用于表征所述边缘区域的色彩分布情况。The pixel value is used to calculate the mean and variance of the edge area; the mean and the variance are used to characterize the color distribution of the edge area.

可选地,所述在所述色彩分布情况满足预设色彩分布条件时,将所述目标图像识别为截屏图像,包括:Optionally, when the color distribution condition satisfies a preset color distribution condition, identifying the target image as a screenshot image includes:

在所述均值和所述方差满足针对指定颜色的背景对应设置的预设色彩分布条件,且所述目标图像不是户型图时,将所述目标图像识别为截屏图像。When the mean value and the variance satisfy a preset color distribution condition corresponding to a specified color background, and the target image is not a floor plan, the target image is identified as a screenshot image.

可选地,通过如下方式确定所述目标图像是否是户型图:Optionally, determine whether the target image is a floor plan in the following manner:

获取在所述应用程序中提交的所述目标图像的图像信息;Obtain the image information of the target image submitted in the application;

基于所述图像信息确定所述目标图像是否是户型图。Whether the target image is a floor plan is determined based on the image information.

可选地,在所述确定所述边缘区域的色彩分布情况之后,所述方法还包括:Optionally, after the determining the color distribution of the edge region, the method further includes:

在所述色彩分布情况不满足预设色彩分布条件时,将所述目标图像识别为非截屏图像。When the color distribution condition does not meet the preset color distribution condition, the target image is identified as a non-screenshot image.

可选地,在所述在所述色彩分布情况满足预设色彩分布条件时,将所述目标图像识别为截屏图像之后,所述方法还包括:Optionally, after the target image is identified as a screenshot image when the color distribution condition satisfies a preset color distribution condition, the method further includes:

若所述目标图像识别为截屏图像,则禁止在所述应用程序中发布包含所述目标图像的帖子。If the target image is identified as a screenshot image, publishing a post containing the target image in the application is prohibited.

本发明实施例还公开了一种图像识别装置,所述装置包括:The embodiment of the present invention also discloses an image recognition device, the device includes:

目标图像获取模块,用于获取提交至应用程序的目标图像;The target image acquisition module is used to acquire the target image submitted to the application;

轮廓边缘线提取模块,用于从所述目标图像中提取轮廓边缘线;an outline edge line extraction module for extracting outline edge lines from the target image;

边缘区域确定模块,用于基于所述轮廓边缘线,在所述目标图像中确定边缘区域;an edge area determination module, configured to determine an edge area in the target image based on the contour edge line;

色彩分布情况确定模块,用于确定所述边缘区域的色彩分布情况;a color distribution determination module, used to determine the color distribution of the edge area;

图像识别模块,用于在所述色彩分布情况满足预设色彩分布条件时,将所述目标图像识别为截屏图像;其中,所述色彩分布条件为基于在所述应用程序中查看图像时的背景对应设置。An image recognition module for recognizing the target image as a screenshot image when the color distribution condition satisfies a preset color distribution condition; wherein, the color distribution condition is based on the background when viewing the image in the application program corresponding settings.

可选地,所述边缘区域确定模块,用于分别获取所述轮廓边缘线的至少两个像素坐标,以及所述轮廓边缘线与所述目标图像的边缘之间的距离;根据所述像素坐标确定所述轮廓边缘线的角度;将所述角度为预设角度、且与所述目标图像的边缘之间的距离最小的预设数量的所述轮廓边缘线,确定为目标轮廓边缘线;将所述目标轮廓边缘线与所述目标图像的边缘之间的所述目标图像,确定为边缘区域。Optionally, the edge area determination module is configured to separately obtain at least two pixel coordinates of the contour edge line and the distance between the contour edge line and the edge of the target image; according to the pixel coordinates determining the angle of the contour edge line; determining the preset number of contour edge lines whose angle is a preset angle and the distance from the edge of the target image is the smallest as the target contour edge line; The target image between the target contour edge line and the edge of the target image is determined as an edge area.

可选地,所述边缘区域确定模块,用于在不存在所述角度为预设角度的所述轮廓边缘线时,将所述目标图像识别为非截屏图像。Optionally, the edge area determination module is configured to identify the target image as a non-screenshot image when there is no contour edge line whose angle is a preset angle.

可选地,所述色彩分布情况确定模块,用于获取所述边缘区域中像素的像素值;采用所述像素值计算所述边缘区域的均值和方差;所述均值和所述方差用于表征所述边缘区域的色彩分布情况。Optionally, the color distribution determination module is used to obtain the pixel value of the pixel in the edge area; the pixel value is used to calculate the mean value and variance of the edge area; the mean value and the variance are used to represent The color distribution of the edge area.

可选地,所述图像识别模块,用于在所述均值和所述方差满足针对指定颜色的背景对应设置的预设色彩分布条件,且所述目标图像不是户型图时,将所述目标图像识别为截屏图像。Optionally, the image recognition module is configured to classify the target image when the mean value and the variance satisfy preset color distribution conditions set corresponding to the background of the specified color, and the target image is not a floor plan. Recognized as a screenshot image.

可选地,所述图像识别模块,用于获取在所述应用程序中提交的所述目标图像的图像信息;基于所述图像信息确定所述目标图像是否是户型图。Optionally, the image recognition module is configured to acquire image information of the target image submitted in the application; determine whether the target image is a floor plan based on the image information.

可选地,所述图像识别模块,用于在所述色彩分布情况不满足预设色彩分布条件时,将所述目标图像识别为非截屏图像。Optionally, the image recognition module is configured to recognize the target image as a non-screenshot image when the color distribution does not meet a preset color distribution condition.

可选地,所述装置还包括,禁止发布模块,用于若所述目标图像识别为截屏图像,则禁止在所述应用程序中发布包含所述目标图像的帖子。Optionally, the apparatus further includes a publishing prohibiting module, configured to prohibit publishing a post containing the target image in the application program if the target image is identified as a screenshot image.

本发明实施例还公开了一种电子设备,包括处理器、通信接口、存储器和通信总线,其中,所述处理器、所述通信接口以及所述存储器通过所述通信总线完成相互间的通信;An embodiment of the present invention further discloses an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;

所述存储器,用于存放计算机程序;the memory for storing computer programs;

所述处理器,用于执行存储器上所存放的程序时,实现如本发明实施例所述的方法。The processor is configured to implement the method according to the embodiment of the present invention when executing the program stored in the memory.

本发明实施例还公开了一个或多个计算机可读介质,其上存储有指令,当由一个或多个处理器执行时,使得所述处理器执行如本发明实施例所述的方法。The embodiments of the present invention also disclose one or more computer-readable media, on which instructions are stored, and when executed by one or more processors, cause the processors to perform the method according to the embodiments of the present invention.

本发明实施例还公开了一种计算机程序产品,该程序产品被存储在存储介质中,该计算机程序产品被至少一个处理器执行以实现如本发明实施例所述的方法。The embodiment of the present invention also discloses a computer program product, the program product is stored in a storage medium, and the computer program product is executed by at least one processor to implement the method according to the embodiment of the present invention.

本发明实施例包括以下优点:The embodiments of the present invention include the following advantages:

在本发明实施例中,获取提交至应用程序的目标图像,并从目标图像中提取轮廓边缘线,基于轮廓边缘线在目标图像中确定边缘区域后,确定边缘区域的色彩分布情况,若色彩分布情况满足预设色彩分布条件,则可以将目标图像识别为截屏图像,其中,色彩分布条件为基于在应用程序中查看图像时的背景对应设置,若边缘区域的色彩分布情况满足预设色彩分布条件,说明目标图像可能是截屏了背景的截屏图像。本发明实施例通过自动识别目标图像的边缘区域是否满足色彩分布条件,来确定目标图像是否是截屏图像,提高了截屏图像的识别效率。In the embodiment of the present invention, the target image submitted to the application is acquired, the contour edge line is extracted from the target image, and after determining the edge area in the target image based on the contour edge line, the color distribution of the edge area is determined, if the color distribution If the condition satisfies the preset color distribution condition, the target image can be identified as a screenshot image. The color distribution condition is based on the corresponding setting of the background when viewing the image in the application. If the color distribution of the edge area satisfies the preset color distribution condition , indicating that the target image may be a screenshot image with a screenshot of the background. The embodiment of the present invention determines whether the target image is a screenshot image by automatically identifying whether the edge area of the target image satisfies the color distribution condition, thereby improving the recognition efficiency of the screenshot image.

附图说明Description of drawings

图1是本发明实施例中提供的一种应用环境的示意图;1 is a schematic diagram of an application environment provided in an embodiment of the present invention;

图2是本发明实施例中提供的一种图像识别方法的步骤流程图;2 is a flow chart of steps of an image recognition method provided in an embodiment of the present invention;

图3是本发明实施例中提供的一种房屋图像的截屏图像之一;3 is one of the screenshot images of a house image provided in an embodiment of the present invention;

图4是本发明实施例中提供的一种房屋图像的截屏图像之二;4 is the second screenshot of a house image provided in an embodiment of the present invention;

图5是本发明实施例中提供的一种房屋图像的截屏图像之三;FIG. 5 is the third screenshot image of a house image provided in an embodiment of the present invention;

图6是本发明实施例中提供的一种房屋图像的轮廓边缘线的示意图;6 is a schematic diagram of a contour edge line of a house image provided in an embodiment of the present invention;

图7是本发明实施例中提供的一种户型图的示意图;7 is a schematic diagram of a house type diagram provided in an embodiment of the present invention;

图8是本发明实施例中提供的一种图像识别的流程图;8 is a flowchart of an image recognition provided in an embodiment of the present invention;

图9是本发明实施例中提供的一种图像识别装置的结构框图。FIG. 9 is a structural block diagram of an image recognition apparatus provided in an embodiment of the present invention.

具体实施方式Detailed ways

为使本发明的上述目的、特征和优点能够更加明显易懂,下面结合附图和具体实施方式对本发明作进一步详细的说明。In order to make the above objects, features and advantages of the present invention more clearly understood, the present invention will be described in further detail below with reference to the accompanying drawings and specific embodiments.

本发明实施例所提供的图像识别方法,可以应用于如图1所示的应用环境中。其中,终端设备102均通过网络与服务器104进行通信。具体地,服务器104获取用户通过终端设备102提交到应用程序的目标图像,从目标图像中提取轮廓边缘线,基于轮廓边缘线,在目标图像中确定边缘区域,确定边缘区域的色彩分布情况,在色彩分布情况满足预设色彩分布条件时,将目标图像识别为截屏图像;其中,色彩分布条件为基于在应用程序中查看图像时的背景对应设置。The image recognition method provided by the embodiment of the present invention can be applied to the application environment shown in FIG. 1 . The terminal devices 102 all communicate with the server 104 through the network. Specifically, the server 104 obtains the target image submitted by the user to the application program through the terminal device 102, extracts the contour edge line from the target image, determines the edge area in the target image based on the contour edge line, determines the color distribution of the edge area, and When the color distribution condition satisfies the preset color distribution condition, the target image is identified as a screenshot image; wherein, the color distribution condition is based on the corresponding setting of the background when viewing the image in the application program.

实际应用中,终端设备102可以但不限于是各种个人计算机、笔记本电脑、智能手机、平板电脑、机器人、车载终端和便携式可穿戴设备,服务器104可以用独立的服务器或者是多个服务器组成的服务器集群来实现。In practical applications, the terminal device 102 can be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, robots, vehicle-mounted terminals and portable wearable devices, and the server 104 can be an independent server or composed of multiple servers. server cluster to achieve.

参照图2,示出了本发明实施例中提供的一种图像识别方法的步骤流程图,具体可以包括如下步骤:Referring to FIG. 2, a flowchart of steps of an image recognition method provided in an embodiment of the present invention is shown, which may specifically include the following steps:

步骤202、获取提交至应用程序的目标图像。Step 202: Acquire the target image submitted to the application.

在具体实现中,终端设备上可以运行应用程序,例如生活类应用程序。通过生活类应用程序可以为用户提供房屋交易功能、车辆买卖功能、家政服务功能和休闲功能等。In a specific implementation, an application program, such as a life application program, can be run on the terminal device. Through life applications, users can be provided with house transaction functions, vehicle purchase and sale functions, housekeeping service functions and leisure functions.

其中,目标图像可以是包含指定对象的图像。例如,包含房屋的房屋图像、包含车辆的车辆图像、包含物品的物品图像等。Wherein, the target image may be an image containing a specified object. For example, a house image including a house, a vehicle image including a vehicle, an item image including an item, and the like.

示例性地,房东用户或者经纪人用户可以在生活类应用程序中上传关于房屋交易的帖子,为了让浏览帖子的房客用户更好理解到房屋的情况,在帖子中通常包含房屋图像,例如关于房屋环境的照片,若该帖子允许在应用程序上发布,那么房客用户就可以在浏览到该帖子后,确定是否与帖子的发布用户进行进一步沟通交流。在本发明实施例中,若检测到用户在生活类应用程序中上传房屋交易的帖子时,并且该房屋交易的帖子中包含房屋图像,则可以将该帖子中的房屋图像作为目标图像。For example, a landlord user or a broker user can upload a post about a house transaction in a life application. In order to make the tenant user who browses the post better understand the situation of the house, the post usually contains house images, such as about the house. A photo of the environment, if the post is allowed to be published on the app, then the guest user can browse to the post to determine whether to further communicate with the user who posted the post. In this embodiment of the present invention, if it is detected that a user uploads a house transaction post in a life application program, and the house transaction post contains a house image, the house image in the post can be used as the target image.

步骤204、从所述目标图像中提取轮廓边缘线。Step 204, extracting contour edge lines from the target image.

其中,轮廓边缘线,又叫“外部线条”,指图像中个体、群体或景物的外边缘界线,是一个对象与另一个对象之间、对象与背景之间的分界线。Among them, the contour edge line, also known as "external line", refers to the outer edge boundary of an individual, group or scene in an image, which is the boundary between one object and another object, and between the object and the background.

示例性地,若目标图像为房屋图像,并且目标图像中包括了吊灯、床、桌子、窗、窗帘、楼梯等关于房屋的内容,则可以从该目标图像中提取出吊灯、床、桌子、窗、窗帘、楼梯等的轮廓边缘线。作为一个可选实施例,可以使用Canny、Sobel、Prewitt、Roberts、Marr-Hildreth等边缘检测算法,提取出目标图像中所有内容的轮廓边缘线。Exemplarily, if the target image is a house image, and the target image includes chandeliers, beds, tables, windows, curtains, stairs and other related content about the house, the chandeliers, beds, tables, and windows can be extracted from the target image. , curtains, stairs, etc. contour edge lines. As an optional embodiment, edge detection algorithms such as Canny, Sobel, Prewitt, Roberts, Marr-Hildreth, etc. can be used to extract the contour edge lines of all contents in the target image.

在具体实现中,目标图像可能是通过截屏方式盗用的截屏图像,具体地,截屏图像通常是用户通过对应用程序中展示的图像进行截屏后得到。由于在应用程序中展示图像时,为了不影响用户正常浏览图像,通常是在应用程序中预先设置的背景上展示图像,其中,背景通常是纯色的,例如黑色的背景或者白色的背景,正是如此,截屏图像中除了包含被截屏图像本身之外,还包含在应用程序中展示被截屏图像时的背景。In a specific implementation, the target image may be a screenshot image stolen by taking a screenshot. Specifically, the screenshot image is usually obtained by a user by taking a screenshot of an image displayed in an application program. When displaying images in an application, in order not to affect the user's normal browsing of images, the images are usually displayed on the background preset in the application, wherein the background is usually a solid color, such as a black background or a white background, which is exactly In this way, the screenshot image not only includes the screenshot image itself, but also includes the background when the screenshot image is displayed in the application.

以下采用几个具体示例对截屏图像进行说明:参照图3,是本发明的一种房屋图像的截屏图像之一,该图像中除了包括被截屏图像302之外,还包括了背景304;参照图4,是本发明的一种房屋图像的截屏图像之二,该图像中除了包括被截屏图像402之外,还包括了背景404;参照图5,是本发明的一种房屋图像的截屏图像之三,该图像中除了包括被截屏图像502之外,还包括了背景504。Several specific examples are used to describe the screenshot image below: Referring to FIG. 3 , it is one of the screenshot images of a house image according to the present invention. In addition to the screenshot image 302 , the image also includes a background 304 ; 4, is the second screenshot image of a house image according to the present invention, in addition to the screen shot image 402, the image also includes a background 404; with reference to FIG. Third, in addition to the screen shot image 502 , the image also includes a background 504 .

基于上述截屏图像包含背景的特点,如果目标图像是截屏图像,那么从目标图像中提取的轮廓边缘线,除了包括被截屏图像中本身的内容,还包括应用程序的背景。以房屋图像为例,从房屋图像中提取的轮廓边缘线,除了包含房屋图像中的吊灯、床、桌子、窗、窗帘、楼梯等之外,还将包含应用程序展示房屋图像时的背景对应的轮廓边缘线。示例性地,参照图6,是本发明的一种房屋图像的轮廓边缘线的示意图,该图中包括了背景对应的轮廓边缘线602,以及房屋图像中其他内容的轮廓边缘线。Based on the above-mentioned feature that the screenshot image contains a background, if the target image is a screenshot image, the contour edge line extracted from the target image includes the background of the application program in addition to the content of the screenshot image itself. Taking the house image as an example, the contour edge lines extracted from the house image will not only contain the chandeliers, beds, tables, windows, curtains, stairs, etc. Outline edge lines. Exemplarily, referring to FIG. 6 , which is a schematic diagram of a contour edge line of a house image according to the present invention, the figure includes a contour edge line 602 corresponding to the background and contour edge lines of other contents in the house image.

步骤206、基于所述轮廓边缘线,在所述目标图像中确定边缘区域。Step 206: Determine an edge region in the target image based on the contour edge line.

其中,边缘区域是指目标图像中基于轮廓边缘线所确定的图像区域。The edge area refers to the image area determined based on the contour edge line in the target image.

在本发明实施例中,在得到目标图像中的所有轮廓边缘线后,就可以基于轮廓边缘线,在目标图像中确定一个或者多个边缘区域。示例性地,参照图6,图中白色的图像区域604,都属于基于轮廓边缘线602确定的目标图像中的边缘区域。In this embodiment of the present invention, after all contour edge lines in the target image are obtained, one or more edge regions may be determined in the target image based on the contour edge lines. Exemplarily, referring to FIG. 6 , the white image areas 604 in the figure all belong to the edge areas in the target image determined based on the contour edge lines 602 .

步骤208、确定所述边缘区域的色彩分布情况。Step 208: Determine the color distribution of the edge region.

步骤210、在所述色彩分布情况满足预设色彩分布条件时,将所述目标图像识别为截屏图像;其中,所述色彩分布条件为基于在所述应用程序中查看图像时的背景对应设置。Step 210: When the color distribution condition satisfies a preset color distribution condition, identify the target image as a screenshot image; wherein the color distribution condition is based on the background corresponding setting when viewing the image in the application program.

其中,色彩分布情况用于表示边缘区域中像素的颜色值的整体分布情况,例如,边缘区域中像素的颜色值所偏向的一种颜色,例如,偏向黑色,或者,偏向白色。The color distribution is used to represent the overall distribution of the color values of the pixels in the edge area, for example, a color to which the color values of the pixels in the edge area are biased, for example, biased toward black, or biased toward white.

其中,色彩分布条件为基于在应用程序中查看图像时的背景对应设置,因此,在本发明实施例中,在基于轮廓边缘线在目标图像中确定一个或者多个边缘区域后,进一步确定各个边缘区域的色彩分布情况,若边缘区域的色彩分布情况满足预设色彩分布条件,可以说明目标图像中包括了在应用程序中展示图像时的背景,则可以将目标图像识别为截屏图像。可选地,可以利用计算机视觉技术,基于在应用程序中查看图像时的背景进行色彩分布条件的设置。Wherein, the color distribution condition is based on the corresponding setting of the background when viewing the image in the application program. Therefore, in the embodiment of the present invention, after determining one or more edge regions in the target image based on the contour edge line, each edge region is further determined. The color distribution of the area. If the color distribution of the edge area satisfies the preset color distribution conditions, it means that the target image includes the background when the image is displayed in the application, and the target image can be recognized as a screenshot image. Optionally, computer vision technology can be used to set the color distribution conditions based on the background when viewing the image in the application.

在上述图像识别方法中,获取提交至应用程序的目标图像,并从目标图像中提取轮廓边缘线,基于轮廓边缘线在目标图像中确定边缘区域后,确定边缘区域的色彩分布情况,若色彩分布情况满足预设色彩分布条件,则可以将目标图像识别为截屏图像,其中,色彩分布条件为基于在应用程序中查看图像时的背景对应设置,若边缘区域的色彩分布情况满足预设色彩分布条件,说明目标图像可能是截屏了背景的截屏图像。本发明实施例通过自动识别目标图像的边缘区域是否满足色彩分布条件,来确定目标图像是否是截屏图像,提高了截屏图像的识别效率。In the above image recognition method, the target image submitted to the application is acquired, and the contour edge line is extracted from the target image. After determining the edge area in the target image based on the contour edge line, the color distribution of the edge area is determined. If the color distribution If the condition satisfies the preset color distribution condition, the target image can be identified as a screenshot image. The color distribution condition is based on the corresponding setting of the background when viewing the image in the application. If the color distribution of the edge area satisfies the preset color distribution condition , indicating that the target image may be a screenshot image with a screenshot of the background. The embodiment of the present invention determines whether the target image is a screenshot image by automatically identifying whether the edge area of the target image satisfies the color distribution condition, thereby improving the recognition efficiency of the screenshot image.

在上述实施例的基础上,提出了上述实施例的变型实施例,在此需要说明的是,为了使描述简要,在变型实施例中仅描述与上述实施例的不同之处。On the basis of the above-mentioned embodiment, a modified embodiment of the above-mentioned embodiment is proposed. It should be noted here that, in order to simplify the description, only the difference from the above-mentioned embodiment is described in the modified embodiment.

在一示例性实施例中,所述步骤206、基于所述轮廓边缘线,在所述目标图像中确定边缘区域,可以包括如下步骤:In an exemplary embodiment, the step 206 of determining an edge region in the target image based on the contour edge line may include the following steps:

分别获取所述轮廓边缘线的至少两个像素坐标,以及所述轮廓边缘线与所述目标图像的边缘之间的距离;respectively acquiring at least two pixel coordinates of the contour edge line and the distance between the contour edge line and the edge of the target image;

根据所述像素坐标确定所述轮廓边缘线的角度;Determine the angle of the contour edge line according to the pixel coordinates;

将所述角度为预设角度、且与所述目标图像的边缘之间的距离最小的预设数量的所述轮廓边缘线,确定为目标轮廓边缘线;Determining a preset number of the contour edge lines whose angle is a preset angle and the distance from the edge of the target image is the smallest as the target contour edge line;

将所述目标轮廓边缘线与所述目标图像的边缘之间的所述目标图像,确定为边缘区域。The target image between the target contour edge line and the edge of the target image is determined as an edge area.

在具体实现中,在应用程序中展示的图像通常是矩形的,因此若对应用程序中展示的图像进行截屏,那么得到的截屏图像中背景对应的轮廓边缘线,若以水平线为基准,其角度应当是90度或者0度的直线,因此在本发明的一个可选示例中,预设角度可以设置为90度或者0度。此外,截屏图像中的背景部分,位于截屏图像中的最靠近图像的边缘的位置处,更加具体来说,是位于截屏图像中的上、下、左、右靠近截屏图像的边缘的位置处,这是因为被截屏图像在应用程序中展示时,通常是展示在背景的中间,因此在本发明的一个可选示例中,预设数量可以设置为4。In the specific implementation, the image displayed in the application program is usually rectangular, so if a screenshot of the image displayed in the application program is taken, the contour edge line corresponding to the background in the obtained screenshot image, if based on the horizontal line, its angle It should be a straight line of 90 degrees or 0 degrees, so in an optional example of the present invention, the preset angle may be set to 90 degrees or 0 degrees. In addition, the background portion in the screenshot image is located at the position closest to the edge of the image in the screenshot image, and more specifically, is located in the upper, lower, left and right positions in the screenshot image near the edge of the screenshot image, This is because when the screenshot image is displayed in the application, it is usually displayed in the middle of the background, so in an optional example of the present invention, the preset number can be set to 4.

在本发明实施例中,在从目标图像中提取出轮廓边缘线时,分别获取轮廓边缘线的至少两个像素坐标,若两个像素坐标都在坐标系的横轴或者竖轴,则可以确定轮廓边缘线的角度为90度或者0度,即满足预设角度,该轮廓边缘线是一条直线。若轮廓边缘线的角度为预设角度,则进一步确定这些轮廓边缘线与目标图像的边缘之间的距离,并将与目标图像的边缘之间的距离最小的预设数量的轮廓边缘线,例如,将与目标图像的边缘之间的距离最小的4条的轮廓边缘线,确定为目标轮廓边缘线,然后,就可以将目标轮廓边缘线与目标图像的边缘之间组合成的矩形框内的目标图像,确定为边缘区域。In the embodiment of the present invention, when the contour edge line is extracted from the target image, at least two pixel coordinates of the contour edge line are obtained respectively. If the two pixel coordinates are both on the horizontal axis or the vertical axis of the coordinate system, it can be determined that The angle of the contour edge line is 90 degrees or 0 degrees, that is, the preset angle is satisfied, and the contour edge line is a straight line. If the angle of the contour edge lines is a preset angle, the distances between these contour edge lines and the edge of the target image are further determined, and a preset number of contour edge lines with the smallest distance from the edge of the target image, for example , determine the 4 contour edge lines with the smallest distance from the edge of the target image as the target contour edge line, and then, you can combine the target contour edge line and the edge of the target image. The target image, identified as the edge region.

需要说明的是,预设角度和预设数量可以根据应用程序中展示图像时实际情况进行设置,例如,假设目标图像在应用程序中倾斜展示,则可以根据倾斜角度调整预设角度。假设在应用程序中左边和右边的背景完全被目标图像遮盖,则预设数量可以设置为2,本发明实施例对此不加以限制。It should be noted that the preset angle and the preset number can be set according to the actual situation when the image is displayed in the application. For example, if the target image is displayed obliquely in the application, the preset angle can be adjusted according to the inclination angle. Assuming that the left and right backgrounds in the application program are completely covered by the target image, the preset number may be set to 2, which is not limited in this embodiment of the present invention.

示例性地,参照图6,图6中上、下、左、右的四条虚线,就是目标图像的边缘。其中,假设确定为图6中的轮廓边缘线602为目标轮廓边缘线,则将目标轮廓边缘线602与虚线(即目标图像的边缘)组合可以得到矩形框,矩形框内的目标图像即为边缘区域604。Illustratively, referring to FIG. 6 , the four dotted lines on the upper, lower, left and right in FIG. 6 are the edges of the target image. Among them, assuming that the contour edge line 602 in FIG. 6 is determined as the target contour edge line, then a rectangular frame can be obtained by combining the target contour edge line 602 and the dotted line (ie, the edge of the target image), and the target image in the rectangular frame is the edge. area 604.

在上述示例性实施例中,在从目标图像中提取出轮廓边缘线后,将进一步从轮廓边缘线中确定出角度为预设角度、且与目标图像的边缘之间的距离最小的预设数量的轮廓边缘线,再与目标图像的边缘组合确定出边缘区域,用于后续基于边缘区域的色彩分布情况,来确定目标图像是否是截屏图像,可以减少需要确定的边缘区域的数量,减少计算资源的消耗。In the above-mentioned exemplary embodiment, after the contour edge line is extracted from the target image, a preset number of which the angle is a preset angle and the distance from the edge of the target image is the smallest will be determined from the contour edge line. The contour edge line is combined with the edge of the target image to determine the edge area, which is used to determine whether the target image is a screenshot image based on the color distribution of the edge area, which can reduce the number of edge areas that need to be determined and reduce computing resources. consumption.

需要说明的是,本发明实施例是通过边缘检测算法,从目标图像中提取轮廓边缘线,若边缘检测算法精度不高,则提取的轮廓边缘线会不够准确,而截屏图像中的背景与被截图像色彩反差较大,因此截屏图像中背景对应的轮廓边缘线是非常容易被边缘检测算法检测到,针对上述特点,本发明实施例可以无需使用精度很高的边缘检测算法,即使对目标图像中一些细节内容无法准确检测到,也不影响对目标图像的识别。It should be noted that, in the embodiment of the present invention, the edge detection algorithm is used to extract the contour edge line from the target image. If the precision of the edge detection algorithm is not high, the extracted contour edge line will not be accurate enough, and the background in the screenshot image is different from the object image. The color contrast of the screenshot image is relatively large, so the contour edge line corresponding to the background in the screenshot image is very easy to be detected by the edge detection algorithm. In view of the above characteristics, the embodiment of the present invention can eliminate the need to use a high-precision edge detection algorithm, even for the target image. Some details cannot be detected accurately, and it does not affect the recognition of the target image.

在一示例性实施例中,在所述根据所述像素坐标确定所述轮廓边缘线的角度之后,所述方法还可以包括如下步骤:In an exemplary embodiment, after the determining the angle of the contour edge line according to the pixel coordinates, the method may further include the following steps:

在不存在所述角度为预设角度的所述轮廓边缘线时,将所述目标图像识别为非截屏图像。When there is no contour edge line whose angle is a preset angle, the target image is identified as a non-screenshot image.

在本发明实施例中,若轮廓边缘线的至少两个像素坐标,并不是都在坐标系的横轴或者竖轴,则可以确定轮廓边缘线的角度不是90度或者0度,即不满足预设角度,说明目标图像中并不存在背景对应的轮廓边缘线,不是一条直线,则可以将该目标图像识别为非截屏图像,即是合规图像。In the embodiment of the present invention, if the coordinates of at least two pixels of the contour edge line are not both on the horizontal axis or the vertical axis of the coordinate system, it can be determined that the angle of the contour edge line is not 90 degrees or 0 degrees, that is, it does not meet the predetermined Set the angle, indicating that there is no contour edge line corresponding to the background in the target image, and it is not a straight line, then the target image can be identified as a non-screenshot image, that is, a compliant image.

在上述示例性实施例中,在目标图像的轮廓边缘线中,不存在角度为预设角度的轮廓边缘线时,可以直接将目标图像识别为非截屏图像,而无需再从轮廓边缘线中,确定与目标图像的边缘之间的距离最小的预设数量的轮廓边缘线,提高了目标图像的识别效率。In the above exemplary embodiment, when there is no contour edge line with a preset angle in the contour edge line of the target image, the target image can be directly recognized as a non-screenshot image, without the need to extract the contour edge line from the contour edge line. Determining a preset number of contour edge lines with the smallest distance from the edge of the target image improves the recognition efficiency of the target image.

在一示例性实施例中,所述步骤208、确定所述边缘区域的色彩分布情况,可以包括如下步骤:In an exemplary embodiment, the step 208, determining the color distribution of the edge region, may include the following steps:

获取所述边缘区域中像素的像素值;obtaining the pixel value of the pixel in the edge area;

采用所述像素值计算所述边缘区域的均值和方差;所述均值和所述方差用于表征所述边缘区域的色彩分布情况。The pixel value is used to calculate the mean and variance of the edge area; the mean and the variance are used to characterize the color distribution of the edge area.

其中,均值是图像中像素的颜色值的平均值,基于均值可以确定图像偏向的颜色,例如,偏向黑色或者偏向白色。方差反映了图像中像素的颜色值与平均值的偏离程度。Wherein, the mean value is the average value of the color values of the pixels in the image, and based on the mean value, the biased color of the image can be determined, for example, biased toward black or biased toward white. Variance reflects how far the color values of pixels in an image deviate from the mean.

在本发明实施例中,获取目标图像中各个边缘区域的像素的像素值,以基于像素值计算边缘区域的均值和方差,从而可以根据均值和方差来确定边缘区域的色彩分布情况。当然,除了可以基于均值和方差来确定定边缘区域的色彩分布情况之外,还可以基于边缘区域的均方值、均方差、标准差,来确定边缘区域的色彩分布情况,本发明实施例对此无需加以限制。In the embodiment of the present invention, the pixel values of the pixels of each edge region in the target image are obtained to calculate the mean and variance of the edge region based on the pixel values, so that the color distribution of the edge region can be determined according to the mean and variance. Of course, in addition to determining the color distribution of the edge region based on the mean and variance, the color distribution of the edge region can also be determined based on the mean square value, mean square error, and standard deviation of the edge region. This need not be restricted.

在上述示例性实施例中,根据边缘区域的中像素的像素值计算得到的均值和方差,来确定边缘区域的色彩分布情况,实现简单、准确且高效。In the above exemplary embodiment, the color distribution of the edge region is determined according to the mean value and variance calculated from the pixel values of the pixels in the edge region, which is simple, accurate and efficient.

具体的,预设色彩分布条件可以是满足指定颜色,指定颜色是指定图像的颜色,此时,当色彩分布情况满足指定颜色,且目标图像不是指定图像时,将目标图像识别为截屏图像。Specifically, the preset color distribution condition may be that the specified color is satisfied, and the specified color is the color of the specified image. In this case, when the color distribution condition satisfies the specified color and the target image is not the specified image, the target image is identified as a screenshot image.

在一示例性实施例中,指定图像可以是户型图,指定颜色是户型图的颜色,所述步骤210、在所述色彩分布情况满足预设色彩分布条件时,将所述目标图像识别为截屏图像,可以包括如下步骤:In an exemplary embodiment, the specified image may be a floor plan, and the specified color is the color of the floor plan. In step 210, when the color distribution satisfies a preset color distribution condition, identify the target image as a screenshot. image, which can include the following steps:

在所述均值和所述方差满足针对指定颜色的背景对应设置的预设色彩分布条件,且所述目标图像不是户型图时,将所述目标图像识别为截屏图像。When the mean value and the variance satisfy a preset color distribution condition corresponding to a specified color background, and the target image is not a floor plan, the target image is identified as a screenshot image.

其中,预设色彩分布条件包括针对应用程序查看图像时的背景对应的预设均值和预设方差,因此,若在均值和方差满足预设均值和预设方差时,则可以将该目标图像识别为截屏图像。示例性地,如果目标图像是RGB色彩模式,则目标图像中每一个像素会分配一个0~255范围内的像素值,其中,0是表示黑色,255是表示白色。假设基于边缘区域的像素,计算得到均值mean和方差std,当mean>220以及std<10时,说明边缘区域偏向白色,且整体像素值的偏离程度较小,则可以将该边缘区域确定为白色区域,当mean<5以及std<10时,说明边缘区域偏向黑色,且整体像素值的偏离程度较小,则可以将该边缘区域确定为黑色区域。在本发明实施例中,若确定边缘区域是白色区域或者黑色区域,则可以将目标图像识别为截屏图像。The preset color distribution conditions include a preset mean and a preset variance corresponding to the background when the application is viewing an image. Therefore, if the mean and variance satisfy the preset mean and preset variance, the target image can be identified. for screenshots. Exemplarily, if the target image is in the RGB color mode, each pixel in the target image is assigned a pixel value in the range of 0 to 255, where 0 means black and 255 means white. Assuming that the mean value and variance std are calculated based on the pixels of the edge area, when mean>220 and std<10, it means that the edge area tends to be white, and the deviation of the overall pixel value is small, then the edge area can be determined as white area, when mean<5 and std<10, it means that the edge area is inclined to black, and the deviation of the overall pixel value is small, then the edge area can be determined as a black area. In this embodiment of the present invention, if it is determined that the edge area is a white area or a black area, the target image may be identified as a screenshot image.

当然,如果目标图像是CMYK颜色模式、HSB颜色模式、YUV颜色模式等等,还可以将边缘区域转换为RGB色彩模式后再计算均值和方差,以确定目标图像是否是截屏图像,本发明实施例对此不加以限制。Of course, if the target image is in CMYK color mode, HSB color mode, YUV color mode, etc., you can also convert the edge area to RGB color mode and then calculate the mean and variance to determine whether the target image is a screenshot image. Embodiments of the present invention This is not restricted.

在具体实现中,目标图像可以是房屋图像,而房屋图像包括了房屋照片之外,还可以包括户型图,具体地,参照图7,是本发明实施例中提供的一种户型图的示意图,户型图是指房屋的平面空间布局图,即对房屋的各个独立空间的使用功能、相应位置、大小进行描述的图型。在实际应用中,为了能够更加直观的看清房屋的走向布局,大部分的户型图都是采用白色或者偏白色。In a specific implementation, the target image may be a house image, and the house image may also include a floor plan in addition to the house photo. Specifically, referring to FIG. 7 , it is a schematic diagram of a floor plan provided in an embodiment of the present invention, The floor plan refers to the plan space layout of the house, that is, the diagram that describes the use function, corresponding location and size of each independent space of the house. In practical applications, in order to be able to see the layout of the house more intuitively, most of the floor plans are white or white.

在一种可选实施例中,指定图像是户型图,指定颜色是户型图的颜色,例如,如果户型图的颜色是白色,则指定颜色是白色。在本发明实施例中,考虑到目标图像可以是户型图,如果在边缘区域的均值和方差满足针对非指定颜色(例如黑色)的背景对应设置的色彩分布条件时,则可以将目标图像识别为截屏图像,如果在边缘区域的均值和方差满足针对指定颜色(例如白色)的背景对应设置的色彩分布条件,则将进一步确定目标图像是否是户型图,具体地,如果目标图像既满足针对指定颜色的背景对应设置的色彩分布条件,又不是户型图,则可以将该目标图像识别为截屏图像。In an optional embodiment, the specified image is a floor plan, and the specified color is a color of the floor plan. For example, if the color of the floor plan is white, the specified color is white. In this embodiment of the present invention, considering that the target image may be a floor plan, if the mean and variance of the edge area satisfy the color distribution conditions set for the background of a non-specified color (for example, black), the target image can be identified as Screenshot image, if the mean and variance in the edge area satisfy the color distribution conditions set for the specified color (for example, white) background, it will be further determined whether the target image is a floor plan, specifically, if the target image both satisfies the specified color The background corresponding to the set color distribution conditions, and it is not a floor plan, the target image can be identified as a screenshot image.

在上述示例性实施例中,如果边缘区域的均值和方差满足针对指定颜色的背景对应设置的色彩分布条件,说明目标图像可能是特殊的图像,例如户型图,则可以确定该目标图像是否是户型图,以进一步识别目标图像是否是截屏图像,避免错误识别的情况,提高识别准确率。In the above exemplary embodiment, if the mean and variance of the edge area satisfy the color distribution conditions set for the background of the specified color, indicating that the target image may be a special image, such as a floor plan, it can be determined whether the target image is a floor plan to further identify whether the target image is a screenshot image, avoid misrecognition, and improve the recognition accuracy.

在一示例性实施例中,通过如下方式确定所述目标图像是否是户型图:In an exemplary embodiment, whether the target image is a floor plan is determined by:

获取在所述应用程序中提交的所述目标图像的图像信息;Obtain the image information of the target image submitted in the application;

基于所述图像信息确定所述目标图像是否是户型图。Whether the target image is a floor plan is determined based on the image information.

在具体实现中,用户在应用程序中提交图像时,还可以提交关于图像的图像信息,例如,如果图像是户型图,则在应用程序中可以提交用于指示该图像是户型图的图像信息。In a specific implementation, when a user submits an image in an application, image information about the image can also be submitted. For example, if the image is a floorplan, image information indicating that the image is a floorplan can be submitted in the application.

在本发明实施例中,如果边缘区域的均值和方差满足针对指定颜色的背景对应设置的色彩分布条件,例如针对白色的背景对应设置的色彩分布条件时,说明该图像可能是户型图,则获取该目标图像的图像信息,以基于图像信息确定目标图像是否是户型图,若基于图像信息确定目标图像确实是户型图,则可以将目标图像识别为非截屏图像,即是合规图像,若基于图像信息确定目标图像不是户型图,则可以将目标图像识别为截屏图像,即不合规图像。In the embodiment of the present invention, if the mean value and variance of the edge area satisfy the color distribution conditions set corresponding to the background of the specified color, for example, when the color distribution conditions corresponding to the white background are set, it means that the image may be a floor plan, and then obtain The image information of the target image is used to determine whether the target image is a floor plan based on the image information. If it is determined based on the image information that the target image is indeed a floor plan, the target image can be identified as a non-screenshot image, that is, a compliant image. If the image information determines that the target image is not a floor plan, the target image can be identified as a screenshot image, that is, an illegal image.

在上述示例性实施例中,获取用户提交的目标图像的图像信息,以结合预设色彩分布条件和图像信息来识别目标图像是否是截屏图像,可以提高目标图像的识别准确率。In the above exemplary embodiment, the image information of the target image submitted by the user is acquired to identify whether the target image is a screenshot image in combination with preset color distribution conditions and image information, which can improve the recognition accuracy of the target image.

在一示例性实施例中,在所述确定所述边缘区域的色彩分布情况之后,所述方法还可以包括如下步骤:In an exemplary embodiment, after the determining the color distribution of the edge region, the method may further include the following steps:

在所述色彩分布情况不满足预设色彩分布条件时,将所述目标图像识别为非截屏图像。When the color distribution condition does not meet the preset color distribution condition, the target image is identified as a non-screenshot image.

在本发明实施例中,在目标图像中确定一个或者多个边缘区域后,进一步确定各个边缘区域的色彩分布情况,若边缘区域的色彩分布情况不满足预设色彩分布条件,可以说明目标图像中没有包括在应用程序中展示图像时的背景,则可以将目标图像识别为非截屏图像,即合规图像。In the embodiment of the present invention, after determining one or more edge regions in the target image, the color distribution of each edge region is further determined. Without including the context in which the image is displayed in the application, the target image can be identified as a non-screenshot image, i.e. a compliant image.

示例性地,假设基于边缘区域的像素,计算得到均值mean和方差std,即不满足mean>220以及std<10,也不满足mean<5以及std<10时,说明边缘区域的色彩分布情况不满足预设色彩分布条件,则可以将目标图像识别为非截屏图像。Exemplarily, it is assumed that the mean value and the variance std are calculated based on the pixels of the edge area, that is, when the mean>220 and std<10 are not satisfied, and the mean<5 and std<10 are not satisfied, it means that the color distribution of the edge area is not good. If the preset color distribution conditions are met, the target image can be recognized as a non-screenshot image.

在上述示例性实施例中,在通过识别目标图像的边缘区域不满足色彩分布条件,说明目标图像不是截屏图像,则可以将目标图像识别为非截屏图像,提高了目标图像的识别效率。In the above exemplary embodiment, if the edge region of the target image does not satisfy the color distribution condition, indicating that the target image is not a screenshot image, the target image can be identified as a non-screenshot image, which improves the recognition efficiency of the target image.

在一示例性实施例中,在所述在所述色彩分布情况满足预设色彩分布条件时,将所述目标图像识别为截屏图像之后,所述方法还可以包括如下步骤:In an exemplary embodiment, after the target image is identified as a screenshot image when the color distribution condition satisfies a preset color distribution condition, the method may further include the following steps:

若所述目标图像识别为截屏图像,则禁止在所述应用程序中发布包含所述目标图像的帖子。If the target image is identified as a screenshot image, publishing a post containing the target image in the application is prohibited.

在具体实现中,目标图像可以是用户提交至应用程序的帖子中图像,例如,房屋交易的帖子中的房屋图像,若目标图像识别为截屏图像,则说明帖子中的图像可能是对已有的图像进行非法二次利用后的图像,为了保证应用程序中所有用户的财产安全和人生安全,将不允许包含截屏图像的帖子在在应用程序中发布。In a specific implementation, the target image may be an image in a post submitted by a user to the application, for example, a house image in a post on a house transaction. If the target image is identified as a screenshot image, it means that the image in the post may be an existing image. Images after illegal secondary use of images, in order to ensure the property safety and life safety of all users in the application, posts containing screenshots will not be allowed to be published in the application.

在上述示例性实施例中,若识别到用户提交至应用程序的帖子中的图像为截屏图像,将禁止该帖子在应用程序中发布,提高了帖子的审核效率,尤其在帖子数量庞大时,可以有效地减少虚假信息在应用程序上发布,提高了应用程序中展示的帖子的准确度,避免虚假信息的帖子给用户带来的不必要麻烦,用户可以放心使用应用程序,提升了用户的信任度。In the above exemplary embodiment, if it is recognized that the image in the post submitted by the user to the application is a screenshot image, the post will be prohibited from being published in the application, which improves the review efficiency of the post, especially when the number of posts is large. Effectively reduce the release of false information on the application, improve the accuracy of the posts displayed in the application, avoid unnecessary trouble for users caused by false information posts, users can use the application with confidence, and improve the user's trust. .

为了使本领域技术人员更好地理解本发明实施例,以下采用一个具体示例进行说明。参照图8,是本发明实施例提供的一种图像识别的流程图,包括如下步骤:In order to make those skilled in the art better understand the embodiments of the present invention, a specific example is used for description below. Referring to FIG. 8, it is a flowchart of an image recognition provided by an embodiment of the present invention, including the following steps:

步骤802、获取目标图像。Step 802: Acquire a target image.

步骤804、使用canny边缘检测算法,提取出目标图像中所有的轮廓边缘线;Step 804, using the canny edge detection algorithm to extract all contour edge lines in the target image;

步骤806、通过同一条轮廓边缘线上的像素坐标,提取出角度为0度或90度的轮廓边缘线(直线),并进一步筛选出与目标图像的边缘最接近的轮廓边缘线,即距离目标图像上下左右的边缘距离最近的四条轮廓边缘线。如果目标图像包括角度和距离均符合条件的目标轮廓边缘线,则执行步骤808,如果目标图像不包括角度和距离均符合条件的目标轮廓边缘线,则执行步骤816。Step 806: Extract the contour edge line (straight line) with an angle of 0 degrees or 90 degrees through the pixel coordinates on the same contour edge line, and further screen out the contour edge line closest to the edge of the target image, that is, the distance from the target image. The top, bottom, left, and right edges of the image are the closest four contour edge lines. If the target image includes the target contour edge line whose angle and distance both meet the conditions, go to step 808 , and if the target image does not include the target contour edge line whose angle and distance both meet the conditions, go to step 816 .

步骤808、将目标轮廓边缘线与目标图像的边缘进行组合成为一个矩形框,矩形框内的目标图像即为边缘区域,并计算出边缘区域内的像素的均值mean和方差std。Step 808: Combine the edge of the target contour and the edge of the target image into a rectangular frame, the target image in the rectangular frame is the edge area, and calculate the mean and variance std of the pixels in the edge area.

步骤810、当mean>220以及std<10时,将边缘区域确定为白色区域,当mean<5以及std<10时,将边缘区域确定为黑色区域,若边缘区域是白色区域,则执行步骤812,若边缘区域是黑色区域,则执行步骤814。其中,如果边缘区域的均值mean和方差std,不满足mean>220以及std<10,或者mean<5以及std<10的色彩分布条件,即边缘区域既不是黑色区域也不是白色区域,则执行步骤816。Step 810, when mean>220 and std<10, determine the edge area as a white area, when mean<5 and std<10, determine the edge area as a black area, if the edge area is a white area, then execute step 812 , and if the edge area is a black area, step 814 is executed. Among them, if the mean and variance std of the edge area do not satisfy the color distribution conditions of mean>220 and std<10, or mean<5 and std<10, that is, the edge area is neither black nor white, then perform the steps 816.

步骤812、考虑到如果目标图像是户型图,则边缘区域可能会被识别为白色区域,会产生错召,因此,目标图像中提取出为白色区域的边缘区域时,需要进一步获取用户提供的图像信息,判断目标图像是否为户型图,若是,则执行步骤816,若否,则执行步骤814。Step 812: Considering that if the target image is a floor plan, the edge area may be identified as a white area, which will cause false calls. Therefore, when the edge area of the white area is extracted from the target image, it is necessary to further obtain the image provided by the user. information, determine whether the target image is a floor plan, if yes, go to step 816, if not, go to step 814.

步骤814、确定为截屏图像。Step 814: Determine the screenshot image.

步骤816、确定为非截屏图像。Step 816: Determine the image as a non-screenshot image.

应用本发明实施例,可以在用户在应用程序中发布帖子时,识别帖子中的图像作为目标图像,并确定是否为通过截屏方式盗取的截屏图像,能够保证在部署资源耗费很少的前提下,对于非法二次使用的截屏图像进行高召回,具有特征稳定、识别准确度高、鲁棒性高的特点,有效节省了人力的审核成本。By applying the embodiments of the present invention, when a user publishes a post in an application program, an image in the post can be identified as a target image, and whether it is a screenshot image stolen by a screenshot method can be ensured under the premise that deployment resources are less expensive. , for high recall of illegally used screenshot images, it has the characteristics of stable features, high recognition accuracy, and high robustness, which effectively saves the cost of human review.

需要说明的是,对于方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本发明实施例并不受所描述的动作顺序的限制,因为依据本发明实施例,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作并不一定是本发明实施例所必须的。It should be noted that, for the sake of simple description, the method embodiments are described as a series of action combinations, but those skilled in the art should know that the embodiments of the present invention are not limited by the described action sequences, because According to embodiments of the present invention, certain steps may be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.

参照图9,示出了本发明实施例中提供的一种图像识别装置的结构框图,具体可以包括如下模块:Referring to FIG. 9, a structural block diagram of an image recognition apparatus provided in an embodiment of the present invention is shown, which may specifically include the following modules:

目标图像获取模块902,用于获取提交至应用程序的目标图像;a target image acquisition module 902, configured to acquire the target image submitted to the application;

轮廓边缘线提取模块904,用于从所述目标图像中提取轮廓边缘线;an outline edge line extraction module 904, used for extracting outline edge lines from the target image;

边缘区域确定模块906,用于基于所述轮廓边缘线,在所述目标图像中确定边缘区域;an edge region determination module 906, configured to determine an edge region in the target image based on the contour edge line;

色彩分布情况确定模块908,用于确定所述边缘区域的色彩分布情况;a color distribution determination module 908, configured to determine the color distribution of the edge region;

图像识别模块910,用于在所述色彩分布情况满足预设色彩分布条件时,将所述目标图像识别为截屏图像;其中,所述色彩分布条件为基于在所述应用程序中查看图像时的背景对应设置。The image recognition module 910 is configured to recognize the target image as a screenshot image when the color distribution condition satisfies a preset color distribution condition; wherein, the color distribution condition is based on the image when viewing the image in the application program. Background corresponding settings.

在一示例性实施例中,所述边缘区域确定模块906,用于分别获取所述轮廓边缘线的至少两个像素坐标,以及所述轮廓边缘线与所述目标图像的边缘之间的距离;根据所述像素坐标确定所述轮廓边缘线的角度;将所述角度为预设角度、且与所述目标图像的边缘之间的距离最小的预设数量的所述轮廓边缘线,确定为目标轮廓边缘线;将所述目标轮廓边缘线与所述目标图像的边缘之间的所述目标图像,确定为边缘区域。In an exemplary embodiment, the edge region determination module 906 is configured to obtain at least two pixel coordinates of the contour edge line and the distance between the contour edge line and the edge of the target image respectively; The angle of the contour edge line is determined according to the pixel coordinates; the preset number of contour edge lines whose angle is a preset angle and whose distance from the edge of the target image is the smallest are determined as the target contour edge line; the target image between the target contour edge line and the edge of the target image is determined as an edge area.

在一示例性实施例中,所述边缘区域确定模块906,用于在不存在所述角度为预设角度的所述轮廓边缘线时,将所述目标图像识别为非截屏图像。In an exemplary embodiment, the edge area determination module 906 is configured to identify the target image as a non-screenshot image when there is no contour edge line whose angle is a preset angle.

在一示例性实施例中,所述色彩分布情况确定模块908,用于获取所述边缘区域中像素的像素值;采用所述像素值计算所述边缘区域的均值和方差;所述均值和所述方差用于表征所述边缘区域的色彩分布情况。In an exemplary embodiment, the color distribution determination module 908 is configured to obtain pixel values of pixels in the edge area; use the pixel values to calculate the mean and variance of the edge area; the mean and all The variance is used to characterize the color distribution of the edge region.

在一示例性实施例中,所述图像识别模块910,用于在在所述均值和所述方差满足针对指定颜色的背景对应设置的预设色彩分布条件,且所述目标图像不是户型图时,将所述目标图像识别为截屏图像。In an exemplary embodiment, the image recognition module 910 is configured to, when the mean value and the variance satisfy the preset color distribution conditions set for the background of the specified color, and the target image is not a floor plan , identifying the target image as a screenshot image.

在一示例性实施例中,所述图像识别模块910,用于获取在所述应用程序中提交的所述目标图像的图像信息;基于所述图像信息确定所述目标图像是否是户型图。In an exemplary embodiment, the image recognition module 910 is configured to acquire image information of the target image submitted in the application; determine whether the target image is a floor plan based on the image information.

在一示例性实施例中,所述图像识别模块910,用于在所述色彩分布情况不满足预设色彩分布条件时,将所述目标图像识别为非截屏图像。In an exemplary embodiment, the image recognition module 910 is configured to recognize the target image as a non-screenshot image when the color distribution does not meet a preset color distribution condition.

在一示例性实施例中,所述装置还包括,禁止发布模块,用于若所述目标图像识别为截屏图像,则禁止在所述应用程序中发布包含所述目标图像的帖子。In an exemplary embodiment, the apparatus further includes a publishing prohibiting module, configured to prohibit publishing a post containing the target image in the application program if the target image is identified as a screenshot image.

在本发明实施例中,获取提交至应用程序的目标图像,并从目标图像中提取轮廓边缘线,基于轮廓边缘线在目标图像中确定边缘区域后,确定边缘区域的色彩分布情况,若色彩分布情况满足预设色彩分布条件,则可以将目标图像识别为截屏图像,其中,色彩分布条件为基于在应用程序中查看图像时的背景对应设置,若边缘区域的色彩分布情况满足预设色彩分布条件,说明目标图像可能是截屏了背景的截屏图像。本发明实施例通过自动识别目标图像的边缘区域是否满足色彩分布条件,来确定目标图像是否是截屏图像,提高了截屏图像的识别效率。In the embodiment of the present invention, the target image submitted to the application is acquired, the contour edge line is extracted from the target image, and after determining the edge area in the target image based on the contour edge line, the color distribution of the edge area is determined, if the color distribution If the condition satisfies the preset color distribution condition, the target image can be identified as a screenshot image. The color distribution condition is based on the corresponding setting of the background when viewing the image in the application. If the color distribution of the edge area satisfies the preset color distribution condition , indicating that the target image may be a screenshot image with a screenshot of the background. The embodiment of the present invention determines whether the target image is a screenshot image by automatically identifying whether the edge area of the target image satisfies the color distribution condition, thereby improving the recognition efficiency of the screenshot image.

对于装置实施例而言,由于其与方法实施例基本相似,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。As for the apparatus embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and reference may be made to the partial description of the method embodiment for related parts.

优选的,本发明实施例还提供了一种电子设备,包括:处理器,存储器,存储在存储器上并可在处理器上运行的计算机程序,该计算机程序被处理器执行时实现上述图像识别方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。Preferably, an embodiment of the present invention further provides an electronic device, comprising: a processor, a memory, a computer program stored in the memory and running on the processor, and the computer program is executed by the processor to implement the above image recognition method Each process of the embodiment can achieve the same technical effect, and to avoid repetition, it will not be repeated here.

本发明实施例还提供了一种计算机可读存储介质,计算机可读存储介质上存储有计算机程序,计算机程序被处理器执行时实现上述图像识别方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。其中,所述的计算机可读存储介质,如只读存储器(Read-Only Memory,简称ROM)、随机存取存储器(Random Access Memory,简称RAM)、磁碟或者光盘等。Embodiments of the present invention also provide a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, each process of the above image recognition method embodiment is implemented, and the same technology can be achieved. The effect, in order to avoid repetition, is not repeated here. The computer-readable storage medium is, for example, a read-only memory (Read-Only Memory, ROM for short), a random access memory (Random Access Memory, RAM for short), a magnetic disk, or an optical disk.

本发明实施例提供一种计算机程序产品,该程序产品被存储在存储介质中,该程序产品被至少一个处理器执行以实现如上述图像识别方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。An embodiment of the present invention provides a computer program product, the program product is stored in a storage medium, and the program product is executed by at least one processor to implement the various processes in the above image recognition method embodiments, and can achieve the same technical effect , in order to avoid repetition, it will not be repeated here.

需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。It should be noted that, herein, the terms "comprising", "comprising" or any other variation thereof are intended to encompass non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements, It also includes other elements not expressly listed or inherent to such a process, method, article or apparatus. Without further limitation, an element qualified by the phrase "comprising a..." does not preclude the presence of additional identical elements in a process, method, article or apparatus that includes the element.

通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本发明各个实施例所述的方法。From the description of the above embodiments, those skilled in the art can clearly understand that the method of the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is better implementation. Based on this understanding, the technical solutions of the present invention can be embodied in the form of software products in essence or the parts that make contributions to the prior art, and the computer software products are stored in a storage medium (such as ROM/RAM, magnetic disk, CD), including several instructions to make a terminal (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) execute the methods described in the various embodiments of the present invention.

上面结合附图对本发明的实施例进行了描述,但是本发明并不局限于上述的具体实施方式,上述的具体实施方式仅仅是示意性的,而不是限制性的,本领域的普通技术人员在本发明的启示下,在不脱离本发明宗旨和权利要求所保护的范围情况下,还可做出很多形式,均属于本发明的保护之内。The embodiments of the present invention have been described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific embodiments, which are merely illustrative rather than restrictive. Under the inspiration of the present invention, without departing from the spirit of the present invention and the scope protected by the claims, many forms can be made, which all belong to the protection of the present invention.

本领域普通技术人员可以意识到,结合本发明实施例中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。Those skilled in the art can realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in the embodiments of the present invention can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each particular application, but such implementations should not be considered beyond the scope of the present invention.

所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described systems, devices and units may refer to the corresponding processes in the foregoing method embodiments, which will not be repeated here.

在本申请所提供的实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the embodiments provided in this application, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.

所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.

另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.

所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。The functions, if implemented in the form of software functional units and sold or used as independent products, may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention can be embodied in the form of a software product in essence, or the part that contributes to the prior art or the part of the technical solution. The computer software product is stored in a storage medium, including Several instructions are used to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes: a U disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk and other mediums that can store program codes.

以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以权利要求的保护范围为准。The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention. should be included within the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.

Claims (11)

1. An image recognition method, characterized in that the method comprises:
acquiring a target image submitted to an application program;
extracting contour edge lines from the target image;
determining an edge region in the target image based on the contour edge line;
determining the color distribution condition of the edge area;
when the color distribution condition meets a preset color distribution condition, identifying the target image as a screen shot image; wherein the color distribution condition is based on a background correspondence setting when an image is viewed in the application program.
2. The method of claim 1, wherein determining an edge region in the target image based on the contour edge line comprises:
respectively acquiring at least two pixel coordinates of the contour edge line and a distance between the contour edge line and the edge of the target image;
determining the angle of the contour edge line according to the pixel coordinates;
determining a preset number of the contour edge lines with the angle as a preset angle and the minimum distance between the contour edge lines and the edge of the target image as target contour edge lines;
and determining the target image between the target contour edge line and the edge of the target image as an edge area.
3. The method of claim 2, wherein after said determining the angle of the contour edge line from the pixel coordinates, the method further comprises:
and when the contour edge line with the preset angle does not exist, identifying the target image as a non-screen capture image.
4. The method of claim 1, wherein determining the color distribution of the edge region comprises:
acquiring a pixel value of a pixel in the edge area;
calculating the mean and variance of the edge region by using the pixel values; the mean value and the variance are used for characterizing the color distribution condition of the edge area.
5. The method according to claim 4, wherein the identifying the target image as a screenshot image when the color distribution condition satisfies a preset color distribution condition comprises:
and when the mean value and the variance meet preset color distribution conditions correspondingly set for a background of a specified color and the target image is not a house-type image, identifying the target image as a screen shot image.
6. The method of claim 5, wherein determining whether the target image is a house type map is performed by:
acquiring image information of the target image submitted in the application program;
determining whether the target image is a house type map based on the image information.
7. The method according to claim 1, wherein after the determining the color distribution of the edge region, the method further comprises:
and when the color distribution condition does not meet the preset color distribution condition, identifying the target image as a non-screenshot image.
8. The method according to claim 1, wherein after the target image is identified as a screenshot image when the color distribution condition satisfies a preset color distribution condition, the method further comprises:
and if the target image is identified as a screen capture image, prohibiting a post containing the target image from being issued in the application program.
9. An image recognition apparatus, characterized in that the apparatus comprises:
the target image acquisition module is used for acquiring a target image submitted to an application program;
the contour edge line extraction module is used for extracting contour edge lines from the target image;
an edge region determining module, configured to determine an edge region in the target image based on the contour edge line;
the color distribution condition determining module is used for determining the color distribution condition of the edge area;
the image identification module is used for identifying the target image as a screen capture image when the color distribution condition meets a preset color distribution condition; wherein the color distribution condition is based on a background correspondence setting when an image is viewed in the application program.
10. An electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
the memory is used for storing a computer program;
the processor, when executing a program stored on the memory, implementing the method of any of claims 1 to 8.
11. One or more computer-readable media having instructions stored thereon that, when executed by one or more processors, cause the processors to perform the method of any of claims 1-8.
CN202210301397.2A 2022-03-25 2022-03-25 Image recognition method, device, electronic device and readable medium Active CN114693629B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210301397.2A CN114693629B (en) 2022-03-25 2022-03-25 Image recognition method, device, electronic device and readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210301397.2A CN114693629B (en) 2022-03-25 2022-03-25 Image recognition method, device, electronic device and readable medium

Publications (2)

Publication Number Publication Date
CN114693629A true CN114693629A (en) 2022-07-01
CN114693629B CN114693629B (en) 2025-01-10

Family

ID=82139652

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210301397.2A Active CN114693629B (en) 2022-03-25 2022-03-25 Image recognition method, device, electronic device and readable medium

Country Status (1)

Country Link
CN (1) CN114693629B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116612134A (en) * 2023-05-30 2023-08-18 阳光智维科技股份有限公司 Image processing method and related device

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108256530A (en) * 2017-12-29 2018-07-06 北京城市网邻信息技术有限公司 Image-recognizing method, device and equipment
CN109002842A (en) * 2018-06-27 2018-12-14 北京字节跳动网络技术有限公司 Image-recognizing method and device
CN111126254A (en) * 2019-12-23 2020-05-08 Oppo广东移动通信有限公司 Image recognition method, device, equipment and storage medium
CN111144425A (en) * 2019-12-27 2020-05-12 五八有限公司 Method and device for detecting screen shot picture, electronic equipment and storage medium
CN112085094A (en) * 2020-09-08 2020-12-15 中国平安财产保险股份有限公司 Document image reproduction detection method and device, computer equipment and storage medium
CN112257709A (en) * 2020-10-23 2021-01-22 北京云杉世界信息技术有限公司 Signboard photo auditing method and device, electronic equipment and readable storage medium
CN112258481A (en) * 2020-10-23 2021-01-22 北京云杉世界信息技术有限公司 Portal photo reproduction detection method
CN112329572A (en) * 2020-10-27 2021-02-05 苏州中科先进技术研究院有限公司 Rapid static living body detection method and device based on frame and flash point
CN113222952A (en) * 2021-05-20 2021-08-06 支付宝(杭州)信息技术有限公司 Method and device for identifying copied image

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108256530A (en) * 2017-12-29 2018-07-06 北京城市网邻信息技术有限公司 Image-recognizing method, device and equipment
CN109002842A (en) * 2018-06-27 2018-12-14 北京字节跳动网络技术有限公司 Image-recognizing method and device
CN111126254A (en) * 2019-12-23 2020-05-08 Oppo广东移动通信有限公司 Image recognition method, device, equipment and storage medium
CN111144425A (en) * 2019-12-27 2020-05-12 五八有限公司 Method and device for detecting screen shot picture, electronic equipment and storage medium
CN112085094A (en) * 2020-09-08 2020-12-15 中国平安财产保险股份有限公司 Document image reproduction detection method and device, computer equipment and storage medium
CN112257709A (en) * 2020-10-23 2021-01-22 北京云杉世界信息技术有限公司 Signboard photo auditing method and device, electronic equipment and readable storage medium
CN112258481A (en) * 2020-10-23 2021-01-22 北京云杉世界信息技术有限公司 Portal photo reproduction detection method
CN112329572A (en) * 2020-10-27 2021-02-05 苏州中科先进技术研究院有限公司 Rapid static living body detection method and device based on frame and flash point
CN113222952A (en) * 2021-05-20 2021-08-06 支付宝(杭州)信息技术有限公司 Method and device for identifying copied image

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116612134A (en) * 2023-05-30 2023-08-18 阳光智维科技股份有限公司 Image processing method and related device

Also Published As

Publication number Publication date
CN114693629B (en) 2025-01-10

Similar Documents

Publication Publication Date Title
CN108616563B (en) Virtual information establishing method, searching method and application system of mobile object
US9704033B2 (en) Visual search utilizing color descriptors
US10210423B2 (en) Image match for featureless objects
US11538096B2 (en) Method, medium, and system for live preview via machine learning models
WO2018028546A1 (en) Key point positioning method, terminal, and computer storage medium
CN111914775B (en) Living body detection method, living body detection device, electronic equipment and storage medium
JP5822322B2 (en) Network capture and 3D display of localized and segmented images
US8189961B2 (en) Techniques in optical character recognition
US9270899B1 (en) Segmentation approaches for object recognition
US9916513B2 (en) Method for processing image and computer-readable non-transitory recording medium storing program
CN106844492A (en) A kind of method of recognition of face, client, server and system
CN108229330A (en) Face fusion recognition methods and device, electronic equipment and storage medium
WO2014164236A1 (en) Local image enhancement for text recognition
CN108389053B (en) Payment method, payment device, electronic equipment and readable storage medium
CN111553251A (en) Certificate four-corner incomplete detection method, device, equipment and storage medium
CN112818874B (en) Image processing method, device, equipment and storage medium
CN107832598A (en) Solve lock control method and Related product
WO2022237026A1 (en) Plane information detection method and system
WO2024001617A1 (en) Method and apparatus for identifying behavior of playing with mobile phone
CN113469138A (en) Object detection method and device, storage medium and electronic equipment
CN114693629A (en) Image recognition method and device, electronic equipment and readable medium
CN112633143B (en) Image processing system, method, head-mounted device, processing device, and storage medium
CN109040588A (en) Face image photographing method and device, storage medium and terminal
KR102605451B1 (en) Electronic device and method for providing multiple services respectively corresponding to multiple external objects included in image
CN106846351B (en) Image processing method and client

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