CN106446859B - Utilize the method for stain and the trace of blood in mobile phone front camera automatic identification human eye - Google Patents

Utilize the method for stain and the trace of blood in mobile phone front camera automatic identification human eye Download PDF

Info

Publication number
CN106446859B
CN106446859B CN201610877173.0A CN201610877173A CN106446859B CN 106446859 B CN106446859 B CN 106446859B CN 201610877173 A CN201610877173 A CN 201610877173A CN 106446859 B CN106446859 B CN 106446859B
Authority
CN
China
Prior art keywords
image
human eye
point
threshold
camera
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201610877173.0A
Other languages
Chinese (zh)
Other versions
CN106446859A (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.)
Xian University of Electronic Science and Technology
Original Assignee
Xian University of Electronic Science and Technology
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 Xian University of Electronic Science and Technology filed Critical Xian University of Electronic Science and Technology
Priority to CN201610877173.0A priority Critical patent/CN106446859B/en
Publication of CN106446859A publication Critical patent/CN106446859A/en
Application granted granted Critical
Publication of CN106446859B publication Critical patent/CN106446859B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/18Eye characteristics, e.g. of the iris
    • G06V40/19Sensors therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0012Biomedical image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30004Biomedical image processing
    • G06T2207/30041Eye; Retina; Ophthalmic

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Health & Medical Sciences (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • General Physics & Mathematics (AREA)
  • Nuclear Medicine, Radiotherapy & Molecular Imaging (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Quality & Reliability (AREA)
  • Radiology & Medical Imaging (AREA)
  • Medical Informatics (AREA)
  • Ophthalmology & Optometry (AREA)
  • Human Computer Interaction (AREA)
  • Multimedia (AREA)
  • Image Analysis (AREA)
  • Image Processing (AREA)

Abstract

本发明公开了一种利用手机前置摄像头自动识别人眼中黑点和血丝的方法。其方案是:1)通过智能手机上的距离传感器识别人像与摄像头之间的距离d;2)在距离d大于阈值D的距离范围内保持手机所成图像原分辨率不变,在距离d小于阈值D时进行插值,提高所成图像分辨率使相机中能更精确显示人眼图像;3)对插值后人眼图像依次做图像灰度化、sobel边缘检测、图像分割、图像二值化处理;4)从处理过的人眼图像中切割出单眼图像;5)识别单眼图像中出现的血丝和黑点;6)并自动给用户提示。本发明将智能手机与健康生活相结合,可用于增加手机的功能,以提供对人体眼部出现的微小血丝和黑点的自动识别及提示。

The invention discloses a method for automatically identifying black spots and blood streaks in human eyes by using a front camera of a mobile phone. The solution is: 1) identify the distance d between the portrait and the camera through the distance sensor on the smartphone; 2) keep the original resolution of the image formed by the mobile phone unchanged within the distance d greater than the threshold D, and keep the original resolution of the image formed by the mobile phone unchanged when the distance d is less than Interpolation is performed when the threshold is D, and the resolution of the resulting image is increased so that the human eye image can be displayed more accurately in the camera; 3) The interpolated human eye image is sequentially processed by image grayscale, sobel edge detection, image segmentation, and image binarization ; 4) Cut out the monocular image from the processed human eye image; 5) Identify the bloodshot and black spots that appear in the monocular image; 6) And automatically give the user a prompt. The invention combines the smart phone with healthy life, and can be used to increase the functions of the mobile phone to provide automatic identification and prompts for tiny bloodshots and black spots appearing in human eyes.

Description

利用手机前置摄像头自动识别人眼中黑点和血丝的方法Method for automatically identifying black spots and bloodshot eyes in human eyes by using the front camera of a mobile phone

技术领域technical field

本发明属于图像处理技术领域,特别涉及一种提高前置摄像头所成图像分辨率及自动识别人眼中黑点和血丝的方法,可用于增加手机的功能。The invention belongs to the technical field of image processing, and in particular relates to a method for improving the resolution of an image formed by a front camera and automatically identifying black spots and bloodshot eyes in human eyes, which can be used to increase the functions of mobile phones.

随着科学技术的进步,拥有智能手机已经成为普遍现象,而人们对健康生活的要求也越来越高。人们除了用手机进行基础通信外,还时常运用手机前置摄像头自拍,但在调节焦距期望得到更加细节的信息时,却降低了清晰度,并不能得到很清晰的影像。此外,人们也常用前置摄像头充当镜子,既希望看到全局又看到局部,而且在看局部时,希望越清晰越好,因此调节摄像头焦距,但是同样得不到很清晰的影像,因而不能很好的观察到自己面部更加细节的一些信息。With the advancement of science and technology, owning a smart phone has become a common phenomenon, and people's requirements for a healthy life are getting higher and higher. In addition to using mobile phones for basic communication, people often use the front camera of the mobile phone to take selfies, but when adjusting the focus to obtain more detailed information, the definition is reduced and a very clear image cannot be obtained. In addition, people often use the front camera as a mirror, hoping to see both the overall situation and the local area, and when looking at the local area, they hope that the clearer the better, so they adjust the focal length of the camera, but they can’t get a very clear image, so they can’t It is very good to observe some more detailed information of my face.

现在市场上主流的高配版手机,其前置摄像头的像素大多都要比后置摄像头像素低很多,例如华为P9前置摄像头像素为800万像素,中兴ZTE AKON天机7前置摄像头像素为800万像素,iphone7前置摄像头像素为700万像素,OPPO R9前置摄像头像素为1600万像素,这些主流的高配手机前置摄像头在近距离拉近时均会出现细小麻点,特别是当人们利用手机前置摄像头拍摄功能充当镜子要观测自己眼部的细节信息时,却不能通过调节摄像头焦距看到清晰的影像,而且对于眼部的血丝和黑点这些细节信息也没有一个自动的识别的功能,远远不能满足人们日益增长的对健康的需求。Most of the mainstream high-end mobile phones on the market now have a front camera with much lower pixels than the rear camera. For example, the front camera of Huawei P9 has 8 million pixels, and the front camera of ZTE ZTE AKON 7 has 8 million pixels. Pixels, iphone7 front camera pixels are 7 million pixels, OPPO R9 front camera pixels are 16 million pixels, these mainstream high-end mobile phone front cameras will have small pits when zooming in close, especially when people use mobile phones The front camera shooting function acts as a mirror to observe the details of your eyes, but you can’t see a clear image by adjusting the focal length of the camera, and there is no automatic recognition function for details such as bloodshot eyes and black spots. It is far from meeting people's growing demand for health.

发明内容Contents of the invention

本发明的目的在于针对上述现有技术的不足,提供一种利用手机前置摄像头自动识别人眼中黑点和血丝的方法,以满足人们日益增长的对健康的需求。The purpose of the present invention is to address the above-mentioned deficiencies in the prior art, and provide a method for automatically identifying black spots and bloodshot eyes in people's eyes by using the front camera of a mobile phone, so as to meet people's growing needs for health.

为实现上述目的,本发明的技术方案包括如下:To achieve the above object, technical solutions of the present invention include as follows:

(1)通过智能手机上的距离传感器识别人像与摄像头之间的距离d;(1) recognize the distance d between the portrait and the camera by the distance sensor on the smart phone;

(2)设定距离阈值R=1m,将人像与摄像头之间的距离d与设定的阈值R进行比较:若d>R,则保持手机所成图像原分辨率不变;若d<R,则执行步骤(3);(2) Set the distance threshold R=1m, and compare the distance d between the portrait and the camera with the set threshold R: if d>R, keep the original resolution of the image formed by the mobile phone unchanged; if d<R , then execute step (3);

(3)利用双线性插值算法对前置摄像头所成图像进行插值,插值个数N为的整数倍,使相机中能更精确显示人眼图像;(3) Use the bilinear interpolation algorithm to interpolate the image formed by the front camera, and the interpolation number N is Integer multiples of , so that the human eye image can be displayed more accurately in the camera;

(4)对插值后的人眼图像进行灰度化和sobel算子边缘检测,并根据边缘检测结果寻找x,y方向人眼的区域,舍弃不是人眼区域的点,完成人眼裁剪,再对裁剪后的人眼图像进行二值化处理得到二值化图像;(4) Carry out grayscale and sobel operator edge detection on the interpolated human eye image, and find the area of the human eye in the x and y directions according to the edge detection result, discard the points that are not the human eye area, and complete the human eye clipping, and then Performing binarization processing on the cropped human eye image to obtain a binarized image;

(5)对二值化图像进行横向和纵向计算,扫描分割出单眼图像,并用邻插值算法将单眼图像k归一化为32*16大小的单眼图像h;(5) Perform horizontal and vertical calculations on the binarized image, scan and segment the monocular image, and use the adjacent interpolation algorithm to normalize the monocular image k into a 32*16 monocular image h;

(6)选择大小为32*16且没有血丝和黑点的正常人单眼二值化图像,作为模板图像H,并用模版图像H与归一化单眼图像h做差获得人眼差值图像h’;(6) Select a normal human monocular binarized image with a size of 32*16 and no bloodshot and black spots as the template image H, and use the template image H to make a difference with the normalized monocular image h to obtain the human eye difference image h' ;

(7)对差值图像h’切割得到异样点图像h”,通过邻插值算法将异样点图像h”归一化为32*16大小的异样点图像h”’;(7) Cut the difference image h' to obtain the abnormal point image h", and normalize the abnormal point image h" into a 32*16 size abnormal point image h"' through the adjacent interpolation algorithm;

(8)计算归一化后异样点图像h”’中的白色点数C,并计算白色点数C与32*16的信息比g;(8) Calculate the number C of white points in the abnormal point image h"' after normalization, and calculate the information ratio g between the number C of white points and 32*16;

(9)设置判断黑点和血丝点的阈值G=0.6835,比较g与G的大小,若g=<G,则判为眼睛有黑点,若1>g>G,则判为眼睛有血丝点,若g=1,则判为眼睛正常;(9) Set the threshold G=0.6835 for judging black spots and bloodshot spots, compare the size of g and G, if g=<G, it is judged that the eyes have black spots, and if 1>g>G, then it is judged that the eyes have bloodshot eyes point, if g=1, it is judged that the eyes are normal;

(10)在前置摄像头照相界面向用户显示判定结果。(10) Display the judgment result to the user on the camera interface of the front camera.

本发明具有如下优点:The present invention has the following advantages:

1.本发明在手机前置摄像头的拍照功能基础上,首先利用插值技术提高拍照所成图像的分辨率,在将手机拍照所成图像分辨率提高的基础上,自动识别使用者眼中的血丝和黑点,不仅能提升现有手机前置摄像头的性能,而且更能增加用户拍照体验,使人们的生活更加智能便捷;1. On the basis of the photographing function of the front camera of the mobile phone, the present invention first utilizes interpolation technology to improve the resolution of the photographed image, and automatically recognizes bloodshot eyes and Black dots can not only improve the performance of the front camera of the existing mobile phone, but also increase the user's camera experience and make people's life more intelligent and convenient;

2.本发明能够根据人像与手机之间的距离,动态调节手机前置摄像头拍照所成图像的分辨率。使得此距离越近,图像的分辨率越高,这样就可使人们能更清晰的看到眼部细小的特征;2. The present invention can dynamically adjust the resolution of the image taken by the front camera of the mobile phone according to the distance between the portrait and the mobile phone. The closer the distance, the higher the resolution of the image, so that people can see the small features of the eye more clearly;

3.本发明能够自动识别人眼部存在的微小的血丝和黑点,为用户及时了解自己的眼睛状况提供了方便。3. The present invention can automatically identify tiny blood streaks and black spots in human eyes, which provides convenience for users to know their own eye conditions in time.

附图说明Description of drawings

图1是本发明的实现流程图;Fig. 1 is the realization flowchart of the present invention;

图2是本发明中双线性插值原理图;Fig. 2 is a schematic diagram of bilinear interpolation in the present invention;

图3是本发明中相机分辨率与距离d的关系图;Fig. 3 is a relationship diagram between camera resolution and distance d in the present invention;

具体实施方式Detailed ways

以下结合附图对本发明做详细说明:The present invention is described in detail below in conjunction with accompanying drawing:

参照图1,本发明的实现步骤如下:With reference to Fig. 1, the realization steps of the present invention are as follows:

步骤1,获取人像与摄像头之间的距离,即通过读取手机距离传感器测得人像与摄像头之间的距离d。Step 1, obtain the distance between the portrait and the camera, that is, the distance d between the portrait and the camera is measured by reading the distance sensor of the mobile phone.

步骤2,根据距离d判断是否改变前置摄像头所成图像的分辨率。Step 2, judge whether to change the resolution of the image formed by the front camera according to the distance d.

(2a)设定距离阈值R=1m,将人像与摄像头之间的距离d与设定的阈值R进行比较:若d>R,则保持所成图像分辨率不变;若d<R,则执行步骤(2b);(2a) Set the distance threshold R=1m, compare the distance d between the portrait and the camera with the set threshold R: if d>R, keep the image resolution unchanged; if d<R, then Execute step (2b);

(2b)利用双线性插值算法对前置摄像头所成的人像进行插值,插值个数N为的整数倍,使相机中能更精确显示人眼图像;(2b) Use the bilinear interpolation algorithm to interpolate the portrait formed by the front camera, and the interpolation number N is Integer multiples of , so that the human eye image can be displayed more accurately in the camera;

(2c)从人像图像的坐标(0,0)点开始,依次扫描该图像中的所有像素点,令扫描到的像素点坐标为(x,y),再以(x,y)为基础得到四个扫描像素点,分别为A(x,y),B(x+1,y),C(x,y+1),D(x+1,y+1),令这些扫描像素点的大小分别为f(A),f(B),f(C),f(D);(2c) Starting from the coordinates (0,0) of the portrait image, scan all the pixels in the image in sequence, let the scanned pixel coordinates be (x, y), and then get based on (x, y) Four scanning pixels, namely A(x,y), B(x+1,y), C(x,y+1), D(x+1,y+1), let these scanning pixels The sizes are f(A), f(B), f(C), f(D);

(2d)根据人像与摄像头之间的距离d确定以A(x,y),B(x+1,y),C(x,y+1),D(x+1,y+1)四点所围成的正方体区域中的插值点的个数为:其中常数δ=10;(2d) According to the distance d between the portrait and the camera, A(x,y), B(x+1,y), C(x,y+1), D(x+1,y+1) four The number of interpolation points in the cube area enclosed by the points is: where the constant δ=10;

(2e)利用双线性插值算法,确定A(x,y),B(x+1,y),C(x,y+1),D(x+1,y+1)四点中插值点的坐标和插值点像素的大小:(2e) Use the bilinear interpolation algorithm to determine the interpolation value of the four points A(x,y), B(x+1,y), C(x,y+1), and D(x+1,y+1) Coordinates of points and size in pixels of interpolated points:

(2e1)设最后插值点的坐标为(x’,y’),如图2所示。(2e1) Let the coordinates of the final interpolation point be (x', y'), as shown in Figure 2.

(2e2)计算x轴方向的插值点:(2e2) Calculate the interpolation point in the x-axis direction:

先计算出A(x,y),B(x+1,y)的中间插值点P1(x’,y),插值点P1的像素大小为:First calculate the intermediate interpolation point P1(x’,y) of A(x,y), B(x+1,y), the pixel size of the interpolation point P1 is:

f(P1)=(x+1-x’)*f(A)+(x’-x)*f(B);f(P1)=(x+1-x’)*f(A)+(x’-x)*f(B);

再计算出C(x,y+1),D(x+1,y+1)的中间插值点P2(x’,y),插值点像素的大小为:Then calculate the intermediate interpolation point P2(x’,y) of C(x,y+1), D(x+1,y+1), the size of the interpolation point pixel is:

f(P2)=(x+1-x’)*f(C)+(x’-x)*f(D);f(P2)=(x+1-x')*f(C)+(x'-x)*f(D);

(2e3)用M(x’,y’)表示P1(x’,y)与P2(x’,y)之间的插值点,该插值点像素的大小为:(2e3) Use M(x',y') to represent the interpolation point between P1(x',y) and P2(x',y), the size of the interpolation point pixel is:

由上式可知,当(x,y)确定,则插值点坐标大小x’是在(x,x+1)之间取值,y’是在(y,y+1)之间取值;It can be known from the above formula that when (x, y) is determined, the coordinate size of the interpolation point x’ takes a value between (x, x+1), and y’ takes a value between (y, y+1);

(2e4)进一步确定A(x,y),B(x+1,y),C(x,y+1),D(x+1,y+1)四点中插值点的坐标为该插值点像素的大小为:(2e4) Further determine the coordinates of the interpolation points in A(x, y), B(x+1, y), C(x, y+1), D(x+1, y+1) four points are The pixel size of the interpolation point is:

其中n=1,2...N;where n=1,2...N;

(2e5)完成插值之后所成图像分辨率与距离d的关系图如图3所示。(2e5) The relationship between the image resolution and the distance d after the interpolation is completed is shown in FIG. 3 .

步骤3,对插值后人眼图像进行预处理。Step 3, preprocessing the interpolated human eye image.

(3a)灰度化人眼图像,即采用图像处理的工具函数rgb2gray函数使彩色图像变为灰度图像;(3a) grayscale human eye image, that is, the tool function rgb2gray function of image processing is used to make the color image into a grayscale image;

(3b)检测图像边缘(3b) Detect image edges

检测图像边缘可以用的算子有robert算子、sobel算子、prewitt算子、krisch算子、laplacian算子、gauss-laplacian算子等,本步骤用的是sobel边缘检测。Operators that can be used to detect image edges include robert operator, sobel operator, prewitt operator, krisch operator, laplacian operator, gauss-laplacian operator, etc. This step uses sobel edge detection.

步骤4,人眼裁剪。Step 4, human eye cropping.

(4a)对检测出的人眼图像进行腐蚀,即用图像处理基本函数imerode移除人眼中的小对象区域,除去分割干扰项;(4a) corrode the detected human eye image, that is, use the image processing basic function imerode to remove the small object area in the human eye, and remove the segmentation interference item;

(4b)扫描寻找x,y方向人眼的区域,舍弃不是人眼区域的点完成人眼裁剪。(4b) Scan to find the area of the human eye in the x and y directions, and discard the points that are not in the human eye area to complete the human eye clipping.

步骤5,二值化裁剪后的人眼图像Step 5, binarize the cropped human eye image

(5a)获取二值化最佳阈值T:(5a) Obtain the optimal threshold T for binarization:

获取阈值的算法有双峰法、P参数法、Otsu法、最大阈值法、最佳阈值法等,本实例采用最佳阈值法获取二值化最佳阈值T;The algorithms for obtaining the threshold include bimodal method, P parameter method, Otsu method, maximum threshold method, optimal threshold method, etc. In this example, the optimal threshold method is used to obtain the optimal threshold T for binarization;

(5b)从裁剪后的人眼图像的坐标(0,0)点开始,依次扫描该图像中的所有像素点,令扫描到的像素点坐标为(x,y),像素值大小为f(x,y);(5b) Starting from the coordinates (0,0) of the cropped human eye image, scan all the pixels in the image in sequence, so that the scanned pixel coordinates are (x, y), and the pixel value is f( x,y);

(5c)将像素值f(x,y)与阈值T做比较,若像素值f(x,y)小于阈值T,则f(x,y)为0,若像素值f(x,y)大于等于阈值T,则f(x,y)为1。(5c) Compare the pixel value f(x,y) with the threshold T, if the pixel value f(x,y) is less than the threshold T, then f(x,y) is 0, if the pixel value f(x,y) Greater than or equal to the threshold T, then f(x,y) is 1.

步骤6,分割单眼图像。Step 6, segment the monocular image.

从二值化后人眼图像的坐标(0,0)点开始,依次扫描该图像中的所有像素,分别舍弃x方向像素求和为0的点,及y方向上像素求和为0的点,分割出两个单眼图像,即左眼图像k1和右眼图像k2。Starting from the coordinate (0,0) point of the human eye image after binarization, scan all the pixels in the image in sequence, and discard the points where the sum of pixels in the x direction is 0, and the points where the sum of pixels in the y direction is 0 , segment two single-eye images, that is, the left-eye image k1 and the right-eye image k2.

步骤7,归一化左眼图像,用邻插值算法将左眼图像k1归一化为32*16大小的左眼图像h1。Step 7, normalize the left-eye image, and use the adjacent interpolation algorithm to normalize the left-eye image k1 into a left-eye image h1 with a size of 32*16.

(7a)对左眼图像k1做几何变换,得到大小为32*16的变换后图像k’;(7a) Perform a geometric transformation on the left-eye image k1 to obtain a transformed image k' with a size of 32*16;

(7b)从变换后求得图像k’的坐标(0,0)点开始,依次扫描该图像中的所有像素点(x’,y’),寻找左眼图像k1中距离(x’,y’)最近的点(x,y),令(x’,y’)点的像素值k’(x’,y’)等于(x,y)点的像素值k(x,y),此时得到的图像k’即为左眼图像h1;(7b) Starting from the coordinate (0,0) of the image k' obtained after transformation, scan all the pixels (x', y') in the image in turn, and find the distance (x', y) in the left-eye image k1 ') the nearest point (x, y), let the pixel value k'(x', y') of the (x', y') point be equal to the pixel value k(x, y) of the (x, y) point, this The image k' obtained when is the left eye image h1;

用同样的方法处理右眼图像得到归一化为32*16大小的右眼图像h2。Use the same method to process the right-eye image to obtain the right-eye image h2 normalized to a size of 32*16.

步骤8,获得到人眼差值图像。Step 8, obtaining the human eye difference image.

(8a)选择大小为32*16且没有血丝和黑点的正常人左眼二值化图像,作为左眼模板图像H1,并用左眼模版图像H1与归一化左眼图像h1做差获得左眼差值图像h1’;(8a) Select a binarized image of the left eye of a normal person with a size of 32*16 and no bloodshot and black spots as the left eye template image H1, and use the difference between the left eye template image H1 and the normalized left eye image h1 to obtain the left eye difference value image h1';

(8b)选择大小为32*16且没有血丝和黑点的正常人右眼二值化图像,作为右眼模板图像H2,并用右眼模版图像H2与归一化右眼图像h2做差获得右眼差值图像h2’;(8b) Select a binarized image of the right eye of a normal person with a size of 32*16 and no bloodshot and black spots as the right eye template image H2, and use the right eye template image H2 to make a difference with the normalized right eye image h2 to obtain the right eye difference value image h2';

步骤9,获得异样点图像。Step 9, obtain the outlier point image.

(9a)对左眼差值图像h1’切割得到左眼异样点图像h1”,通过邻插值算法将左眼异样点图像h1”归一化为32*16大小的左眼异样点图像h1”’;(9a) Cut the left-eye difference image h1' to obtain the left-eye abnormal point image h1", and use the adjacent interpolation algorithm to normalize the left-eye abnormal point image h1" into a left-eye abnormal point image h1"' with a size of 32*16 ;

(9a)对右眼差值图像h2’切割得到右眼异样点图像h2”,通过邻插值算法将右异样点图像h2”归一化为32*16大小的右眼异样点图像h2”’。(9a) Cut the right-eye difference image h2' to obtain the right-eye abnormal point image h2", and normalize the right-eye abnormal point image h2" into a right-eye abnormal point image h2"' with a size of 32*16 through the adjacent interpolation algorithm.

步骤10,计算信息比。Step 10, calculate the information ratio.

(10a)计算归一化后左眼异样点图像h1”’中的白色点数C1,即从左眼异样点图像h1”’的坐标(0,0)点开始,扫描该图像的所有像素点,对像素值为1的点求和,得到左眼中白色点数C1,并计算左眼中白色点数C1与32*16的信息比g1;(10a) Calculate the number C1 of white points in the left-eye abnormal point image h1"' after normalization, that is, start from the coordinate (0,0) point of the left-eye abnormal point image h1"', scan all the pixels of the image, Sum the points with a pixel value of 1 to obtain the white point C1 in the left eye, and calculate the information ratio g1 between the white point C1 in the left eye and 32*16;

(10b)计算归一化后右眼异样点图像h2”’中的白色点数C2,即从右眼异样点图像h2”’的坐标(0,0)点开始,扫描该图像的所有像素点,对像素值为1的点求和,得到右眼中白色点数C2,并计算右眼中白色点数C2与32*16的信息比g2;(10b) Calculate the number of white points C2 in the right-eye abnormal point image h2"' after normalization, that is, start from the coordinate (0,0) point of the right-eye abnormal point image h2"', scan all the pixels of the image, Sum the points with a pixel value of 1 to obtain the white point C2 in the right eye, and calculate the information ratio g2 between the white point C2 in the right eye and 32*16;

步骤11,判定是否有血丝和黑点。Step 11, determine whether there are blood streaks and black spots.

(11a)设置判断黑点和血丝点的阈值G=0.6835;(11a) Setting the threshold G=0.6835 for judging black spots and bloodshot spots;

(11b)比较g1与G的大小,若g1=<G,则判为左眼中有黑点,若1>g1>G,则判为左眼中有血丝,若g1=1,则判为左眼正常;(11b) Compare the size of g1 and G. If g1=<G, it is judged as black spots in the left eye; if 1>g1>G, it is judged as bloodshot in the left eye; if g1=1, it is judged as left eye normal;

(11b)比较g2与G的大小,若g2=<G,则判为右眼中有黑点,若1>g2>G,则判为右眼中有血丝点,若g2=1,则判为右眼正常。(11b) Compare the size of g2 and G. If g2=<G, it is judged that there is a black spot in the right eye; if 1>g2>G, it is judged that there is a bloodshot spot in the right eye; Eyes are normal.

步骤12,在前置摄像头照相界面向用户提示判定结果。Step 12, prompting the user for the determination result on the camera interface of the front camera.

使用者可根据手机的提示及时去医院就诊治疗,以免耽误病情,保护眼睛健康。The user can go to the hospital for treatment in time according to the prompt of the mobile phone, so as not to delay the illness and protect the health of the eyes.

以上描述仅是本发明的一个具体实例,显然对于本领域的专业人员来说,在了解了本发明内容和原理后,都可能在不背离本发明原理、结构的情况下,进行形式和细节上的各种修正和改变,但是这些基本发明思想的修正和改变仍在本发明的权利要求保护范围之内。The above description is only a specific example of the present invention. Obviously, for those skilled in the art, after understanding the content and principle of the present invention, it is possible to carry out the form and details without departing from the principle and structure of the present invention. Various amendments and changes, but the amendments and changes of these basic inventive concepts are still within the protection scope of the claims of the present invention.

Claims (5)

1.一种利用手机前置摄像头自动识别人眼中黑点和血丝的系统,该系统执行如下功能步骤:1. A system that utilizes the front camera of a mobile phone to automatically identify black spots and bloodshot eyes, the system performs the following functional steps: (1)通过智能手机上的距离传感器识别人像与摄像头之间的距离d;(1) recognize the distance d between the portrait and the camera by the distance sensor on the smart phone; (2)设定距离阈值R=1m,将人像与摄像头之间的距离d与设定的阈值R进行比较:若d>R,则保持手机所成图像原分辨率不变;若d<R,则执行步骤(3);(2) Set the distance threshold R=1m, and compare the distance d between the portrait and the camera with the set threshold R: if d>R, keep the original resolution of the image formed by the mobile phone unchanged; if d<R , then execute step (3); (3)利用双线性插值算法对前置摄像头所成图像进行插值,插值个数N为(1-dR)的整数倍,使相机中能更精确显示人眼图像;(3) Use the bilinear interpolation algorithm to interpolate the image formed by the front camera, and the interpolation number N is an integer multiple of (1-d R ), so that the human eye image can be displayed more accurately in the camera; (4)对插值后的人眼图像进行灰度化和sobel算子边缘检测,并根据边缘检测结果寻找x,y方向人眼的区域,舍弃不是人眼区域的点,完成人眼裁剪,再对裁剪后的人眼图像进行二值化处理得到二值化图像;(4) Carry out grayscale and sobel operator edge detection on the interpolated human eye image, and find the area of the human eye in the x and y directions according to the edge detection result, discard the points that are not the human eye area, and complete the human eye clipping, and then Performing binarization processing on the cropped human eye image to obtain a binarized image; (5)对二值化图像进行横向和纵向计算,扫描分割出单眼图像,并用邻插值算法将单眼图像k归一化为32*16大小的单眼图像h;(5) Perform horizontal and vertical calculations on the binarized image, scan and segment the monocular image, and use the adjacent interpolation algorithm to normalize the monocular image k into a 32*16 monocular image h; (6)选择大小为32*16且没有血丝和黑点的正常人单眼二值化图像,作为模板图像H,并用模版图像H与归一化单眼图像h做差获得人眼差值图像h’;(6) Select a normal human monocular binarized image with a size of 32*16 and no bloodshot and black spots as the template image H, and use the template image H to make a difference with the normalized monocular image h to obtain the human eye difference image h' ; (7)对差值图像h’切割得到异样点图像h”,通过邻插值算法将异样点图像h”归一化为32*16大小的异样点图像h”’;(7) Cut the difference image h' to obtain the abnormal point image h", and normalize the abnormal point image h" into a 32*16 size abnormal point image h"' through the adjacent interpolation algorithm; (8)计算归一化后异样点图像h”’中的白色点数C,并计算白色点数C与32*16的信息比g;(8) Calculate the number C of white points in the abnormal point image h"' after normalization, and calculate the information ratio g between the number C of white points and 32*16; (9)设置判断黑点和血丝点的阈值G=0.6835,比较g与G的大小,若g=<G,则判为眼睛有黑点,若1>g>G,则判为眼睛有血丝点,若g=1,则判为眼睛正常;(9) Set the threshold G=0.6835 for judging black spots and bloodshot spots, compare the size of g and G, if g=<G, it is judged that the eyes have black spots, and if 1>g>G, then it is judged that the eyes have bloodshot eyes point, if g=1, it is judged that the eyes are normal; (10)在前置摄像头照相界面向用户显示判定结果。(10) Display the judgment result to the user on the camera interface of the front camera. 2.根据权利要求1所述的系统,其中步骤(3)中利用双线性插值算法对前置摄像头所成的图像进行插值,按如下步骤进行:2. system according to claim 1, wherein utilize bilinear interpolation algorithm to carry out interpolation to the image that front camera is formed in the step (3), carry out as follows: (3a)从人像图像的坐标(0,0)点开始,依次扫描该图像中的所有像素点,令扫描到的像素点坐标为(x,y),再以(x,y)为基础得到四个扫描像素点,分别为A(x,y),B(x+1,y),C(x,y+1),D(x+1,y+1),令这些扫描像素点的大小分别为f(A),f(B),f(C),f(D);(3a) Starting from the coordinates (0,0) of the portrait image, scan all the pixels in the image in sequence, let the scanned pixel coordinates be (x, y), and then use (x, y) as the basis to obtain Four scanning pixels, namely A(x,y), B(x+1,y), C(x,y+1), D(x+1,y+1), let these scanning pixels The sizes are f(A), f(B), f(C), f(D); (3b)根据人像与摄像头之间的距离d确定以A(x,y),B(x+1,y),C(x,y+1),D(x+1,y+1)四点所围成的正方形区域中的插值点的个数为:其中常数δ=10,距离阈值R=1m;(3b) According to the distance d between the portrait and the camera, A(x,y), B(x+1,y), C(x,y+1), D(x+1,y+1) four The number of interpolation points in the square area enclosed by the points is: Where constant δ=10, distance threshold R=1m; (3c)确定A(x,y),B(x+1,y),C(x,y+1),D(x+1,y+1)四点中插值点的坐标为计算插值点像素的大小为:(3c) Determine the coordinates of the interpolation points among the four points A(x,y), B(x+1,y), C(x,y+1), and D(x+1,y+1) as Calculate the pixel size of the interpolation point as: 其中n=1,2...N。where n=1,2...N. 3.根据权利要求1所述的系统,其中步骤(4)中对裁剪后的人眼图像进行二值化处理,按如下步骤进行:3. system according to claim 1, wherein in the step (4), carry out binarization processing to the human eye image after cropping, carry out as follows: (4a)利用最大方差阈值分割法获取二值化最佳阈值T;(4a) using the maximum variance threshold segmentation method to obtain the optimal threshold T of binarization; (4b)从裁剪后的人眼图像的坐标(0,0)点开始,依次扫描该图像中的所有像素点,令扫描到的像素点坐标为(x,y),像素值大小为f(x,y);(4b) Starting from the coordinates (0,0) of the cropped human eye image, scan all the pixels in the image in sequence, so that the scanned pixel coordinates are (x, y), and the pixel value is f( x,y); (4c)将像素值f(x,y)与阈值T做比较,若像素值f(x,y)小于阈值T,则f(x,y)为0,若像素值f(x,y)大于等于阈值T,则f(x,y)为1。(4c) Compare the pixel value f(x,y) with the threshold T, if the pixel value f(x,y) is less than the threshold T, then f(x,y) is 0, if the pixel value f(x,y) Greater than or equal to the threshold T, then f(x,y) is 1. 4.根据权利要求1所述的系统,其中步骤(5)中用邻插值算法将单眼图像归一化为32*16大小的单眼图像h,按如下步骤进行:4. The system according to claim 1, wherein in the step (5), the monocular image is normalized to the monocular image h of 32*16 size with the adjacent interpolation algorithm, as follows: (5a)将单眼图像k做几何变换,得到大小为32*16的变换后图像k’;(5a) Geometrically transform the monocular image k to obtain a transformed image k' with a size of 32*16; (5b)从变换后图像k’的坐标(0,0)点开始,依次扫描该图像中的所有像素点(x’,y’),寻找单眼图像k中距离(x’,y’)最近的点(x,y),令(x’,y’)点的像素值k’(x’,y’)等于(x,y)点的像素值k(x,y),此时得到的图像k’即为单眼图像h。(5b) Starting from the coordinate (0,0) point of the transformed image k', scan all the pixels (x', y') in the image in turn, and find the closest distance (x', y') in the monocular image k The point (x, y) of the point (x', y'), let the pixel value k'(x', y') of the point (x', y') be equal to the pixel value k(x, y) of the point (x, y), and the obtained Image k' is the monocular image h. 5.根据权利要求1所述的系统,其中步骤(8)中计算归一化后异样点图像h”’中的白色点数C,是从异样点图像h”’的坐标(0,0)点开始,扫描该图像的所有像素点,对像素值为1的点求和,得到白色点数C。5. The system according to claim 1, wherein the white point number C in the abnormal point image h"' after calculating normalization in the step (8) is from the coordinate (0,0) point of the abnormal point image h"' At the beginning, scan all the pixels of the image, sum the points whose pixel value is 1, and obtain the number C of white points.
CN201610877173.0A 2016-10-08 2016-10-08 Utilize the method for stain and the trace of blood in mobile phone front camera automatic identification human eye Active CN106446859B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610877173.0A CN106446859B (en) 2016-10-08 2016-10-08 Utilize the method for stain and the trace of blood in mobile phone front camera automatic identification human eye

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610877173.0A CN106446859B (en) 2016-10-08 2016-10-08 Utilize the method for stain and the trace of blood in mobile phone front camera automatic identification human eye

Publications (2)

Publication Number Publication Date
CN106446859A CN106446859A (en) 2017-02-22
CN106446859B true CN106446859B (en) 2019-11-01

Family

ID=58171581

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610877173.0A Active CN106446859B (en) 2016-10-08 2016-10-08 Utilize the method for stain and the trace of blood in mobile phone front camera automatic identification human eye

Country Status (1)

Country Link
CN (1) CN106446859B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109472772B (en) * 2018-09-29 2020-12-01 歌尔光学科技有限公司 Image stain detection method, device and equipment
CN112022083B (en) * 2020-07-31 2023-02-10 上海理工大学 Fovea centralis positioning method and system based on bidirectional scanning
CN113040704A (en) * 2020-11-23 2021-06-29 泰州国安医疗用品有限公司 Portable diagnosis platform and method based on blood silk distribution state

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104463102A (en) * 2014-11-07 2015-03-25 中国石油大学(华东) Human eye positioning method based on point-by-point scanning

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104463102A (en) * 2014-11-07 2015-03-25 中国石油大学(华东) Human eye positioning method based on point-by-point scanning

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
An Improved Bilinear Interpolation Algorithm of Converting Standard-definition Television Images to High-definition Television Images;Lu Jing等;《2009 WASE International Conference on Information Engineering》;20091231;第441-444 *
基于卷积神经网络的眼球血丝诊断;吴聪等;《软件导刊》;20160531;第15卷(第5期);第140-142页 *
基于计算机视觉的人眼行为识别算法分析;马文刚;《中国优秀硕士学位论文全文数据库-信息科技辑》;20141015(第10期);第I138-1031页 *

Also Published As

Publication number Publication date
CN106446859A (en) 2017-02-22

Similar Documents

Publication Publication Date Title
EP3477931B1 (en) Image processing method and device, readable storage medium and electronic device
KR102291081B1 (en) Image processing method and apparatus, electronic device and computer-readable storage medium
US9754153B2 (en) Method and apparatus for facial image processing
EP3480784B1 (en) Image processing method, and device
KR101390756B1 (en) Facial feature detection method and device
KR101662846B1 (en) Apparatus and method for generating bokeh in out-of-focus shooting
CN107734253A (en) Image processing method, device, mobile terminal and computer-readable storage medium
CN106981078B (en) Sight line correction method and device, intelligent conference terminal and storage medium
CN106598221A (en) Eye key point detection-based 3D sight line direction estimation method
WO2018082389A1 (en) Skin colour detection method and apparatus, and terminal
US10692230B2 (en) Document imaging using depth sensing camera
CN103810478A (en) Sitting posture detection method and device
WO2018082388A1 (en) Skin color detection method and device, and terminal
WO2014180255A1 (en) Data processing method, apparatus, computer storage medium and user terminal
CN103472915B (en) reading control method based on pupil tracking, reading control device and display device
US20160093028A1 (en) Image processing method, image processing apparatus and electronic device
CN106446859B (en) Utilize the method for stain and the trace of blood in mobile phone front camera automatic identification human eye
CN104537627B (en) A kind of post-processing approach of depth image
WO2020038065A1 (en) Image processing method, terminal, and computer storage medium
KR20150053438A (en) Stereo matching system and method for generating disparity map using the same
CN111047619B (en) Face image processing method and device and readable storage medium
CN111630569B (en) Binocular matching method, visual imaging device and device with storage function
CN115761827A (en) Cosmetic progress detection method, device, equipment and storage medium
WO2022127491A1 (en) Image processing method and device, and storage medium and terminal
CN110610171A (en) Image processing method and device, electronic equipment and computer readable storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
OL01 Intention to license declared
OL01 Intention to license declared