WO2020253062A1 - 一种图像边界的检测方法及装置 - Google Patents

一种图像边界的检测方法及装置 Download PDF

Info

Publication number
WO2020253062A1
WO2020253062A1 PCT/CN2019/118348 CN2019118348W WO2020253062A1 WO 2020253062 A1 WO2020253062 A1 WO 2020253062A1 CN 2019118348 W CN2019118348 W CN 2019118348W WO 2020253062 A1 WO2020253062 A1 WO 2020253062A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
outer contour
monochrome
generate
averaging
Prior art date
Application number
PCT/CN2019/118348
Other languages
English (en)
French (fr)
Inventor
杨祎
王炜
Original Assignee
平安科技(深圳)有限公司
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 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2020253062A1 publication Critical patent/WO2020253062A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • G06F18/2411Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on the proximity to a decision surface, e.g. support vector machines
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/28Quantising the image, e.g. histogram thresholding for discrimination between background and foreground patterns
    • GPHYSICS
    • G06COMPUTING; 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/107Static hand or arm
    • 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/12Fingerprints or palmprints
    • G06V40/13Sensors therefor
    • 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/12Fingerprints or palmprints
    • G06V40/1347Preprocessing; Feature extraction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10024Color image

Definitions

  • This application relates to the field of image processing technology, and in particular to a method and device for detecting image boundaries.
  • Detecting the image boundary is usually used in the process of image recognition. Take the palm boundary as an example. This method is the basis of gesture recognition and palmprint recognition. When detecting the palm boundary, it is susceptible to background interference, such as the skin of the face and neck, or clothing with a color similar to skin color, etc., especially when the background is complex and changeable, the background interference seriously affects the accuracy of detecting the palm boundary.
  • background interference such as the skin of the face and neck, or clothing with a color similar to skin color, etc.
  • the palm boundary is detected with the palm center.
  • the calculation of the average point of the concave point, the corrosion algorithm and the coordinate value weighting in the execution step all correct the image.
  • the background interference can be reduced, the gesture contour cannot be accurately detected.
  • the present application provides an image boundary detection method and device, the main purpose of which is to detect the image boundary problem in the prior art.
  • an image boundary detection method including:
  • an image boundary detection device including:
  • a computer-readable storage medium stores at least one computer-readable executable instruction, and the computer-readable executable instruction causes a processor to execute The corresponding operation of the image boundary detection method.
  • a computer device including: a processor, a memory, a communication interface, and a communication bus.
  • the processor, the memory, and the communication interface complete mutual communication through the communication bus.
  • Communication; the memory is used to store at least one computer-readable executable instruction, the computer-readable executable instruction causes the processor to perform operations corresponding to the above-mentioned image boundary detection method.
  • the embodiment of the present application can reduce background interference and enhance detection robustness by performing averaging and binarization processing on the image.
  • the SVM algorithm is used to determine whether the outer contour image is a palm image, the amount of calculation can be reduced and the detection speed can be increased.
  • the recursive image content step by step increases the accuracy of extracting the outer contour image and improves the accuracy of judging the palm boundary.
  • FIG. 1 shows a flowchart of a method for detecting image boundaries provided by an embodiment of the present application
  • FIG. 2 shows a flowchart of another image boundary detection method provided by an embodiment of the present application
  • Fig. 5 shows a schematic structural diagram of a computer device provided by an embodiment of the present application.
  • the embodiment of the present application provides a method for detecting an image boundary. As shown in FIG. 1, the method includes:
  • the pixel value is [137,56,128], [113,127,92], [89,162,104], the same basic corresponding value is averaged, and each pixel value is regenerated [26, -59, 20], [0, 12, -8], [-24, 47,- 4], which can reduce the amount of subsequent data calculations, while enhancing the clarity and integrity of the image.
  • edge detection is to identify points with obvious brightness changes in digital images. Compared with boundary images, the outer contour image extracted according to the edge detection algorithm greatly reduces the amount of data, and eliminates irrelevant information, and retains the structural properties of the image.
  • Edge detection algorithms can basically be divided into search-based detection methods and zero-crossing-based detection methods.
  • the search-based detection method detects the boundary contour by finding the maximum and minimum values in the first derivative of the image, and locates the boundary contour in the direction of the maximum gradient.
  • the detection method based on zero crossing finds the boundary contour by finding the second derivative zero crossing of the image, and locates the boundary contour at the zero crossing point of the second derivative.
  • the outer contour image refers to the binarized contour image of all objects in the image to be measured, and the number of outer contour images is greater than one. If the objects in the image to be tested include buildings, roads, and vehicles in the shooting background, as well as heads, hands, and arms, then the outer contour image includes a one-to-one binarization of buildings, roads, vehicles, heads, hands, and arms. Contour image.
  • the target image refers to the image of any object, which can be a hand image, a human face image, an animal image, and so on.
  • the target image is shot from various angles.
  • the target image is a hand image
  • the target image includes a target image of at least one hand posture
  • the hand posture includes five-finger combined palm extension, five-finger open palm extension, and part of the fingers slightly bent palm extension.
  • Palm posture refers to the different relative positions of the palm and the fingers including the palm and the fingers. If the palm image is used as the basis for biometric identification, and the target image composed of fingers and palm is used as the basis for distinguishing the palm from other objects, it can ensure that the palm image is included in the image to be tested and the smaller the amount of image data, the better.
  • the SVM algorithm is used to judge whether the outer contour image is the target image according to the pre-trained SVM model.
  • the SVM model is actually a linear classifier, which is trained based on the training images and their corresponding classification results. Training images can be divided into two categories, positive sample images that contain the target image and negative sample images that do not contain the target image.
  • the corresponding classification results include two categories that contain the target image and those that do not contain the target image.
  • the outer contour image is the target image, mark the outer contour pixels in the outer contour image in the image to be measured until all the outer contour images have completed the steps of judgment or judgment and marking. After judging whether all the outer contour images are target images, the outer contour image will be marked as all the outer contour pixels of the target image in the image to be measured. Regardless of whether the method of side-judgment and side-marking is adopted, or the method of first-judging and then-marking is adopted, as long as it is ensured that all the outer contour images have gone through the judgment process, all the outer contour images of the palm are marked in the image to be measured.
  • Mark the outer contour pixels by changing the color of the pixels, uniformly recording the positions of the outer contour pixels, and adding marks for the outer contour pixels.
  • This application provides an image boundary detection method. First, according to the preset reference color, the test image is averaged to generate an averaged image, and then the averaged image is binarized to generate the boundary image, and then according to the edge Detection algorithm, extract the outer contour image of the object in the boundary image, and then judge whether the outer contour image is the target image according to the support vector machine SVM algorithm, and finally if the judgment result is yes, mark the outer contour of the outer contour image in the image to be measured pixel.
  • the embodiment of the present application can reduce background interference and enhance detection robustness by performing averaging and binarization processing on the image.
  • the amount of calculation can be reduced and the detection speed can be increased.
  • the recursive image content step by step increases the accuracy of extracting the outer contour image and improves the accuracy of judging the palm boundary.
  • the embodiment of the present application provides another image boundary detection method. As shown in FIG. 2, the method includes:
  • the preset reference colors include the color brightness corresponding to the three basic colors of red, green, and blue.
  • the method of generating it relative to the averaged image specifically includes: establishing a monochrome channel according to the preset reference color, the monochrome channel including the red channel , Green channel and blue channel; respectively acquire the monochrome image of the image to be tested passing through the red channel, the green channel and the blue channel; perform the averaging processing on the monochrome image to generate a single color Averaging image; merging the single-color averaging image to generate the averaging image.
  • the monochromatic channel is used to filter out other colors in the image under test except the color of the channel to change the color in the image under test. After different monochromatic channels, the corresponding monochromatic image is generated, and the number of monochromatic channels corresponds to that of the monochromatic image.
  • the averaging process is performed on each monochrome image, and the colors other than the basic colors in the monochrome image are as close as possible to a certain color in the basic colors, and each monochrome image generates a monochrome average image. According to the color recording method of the monochrome average image, the three monochrome average images are combined to generate an average image of the image to be tested.
  • the boundary image is a binary image, including two gray values of 0 or 255. Compared with the image to be tested, the amount of data is less, and it can highlight the contour of the object in the image to be tested.
  • the edge of the image is the image contour, which generally refers to an area where the intensity of the image changes drastically in a certain local area.
  • the intensity changes generally include step changes and roof changes.
  • the purpose of edge detection is to find a set of pixels with step changes or roof changes.
  • the peak of the first derivative for step changes is the edge point
  • the zero point of the first derivative for the roof change is the edge point.
  • various operators are instantiated according to the principle of derivative division to be directly used in the calculation process.
  • the first-order derivative operators include: Roberts Cross operator, Prewitt operator, Sobel operator, Kirsch operator, compass operator, etc.
  • extracting the outer contour image of the object in the boundary image includes: calculating the gradient film and the local gradient direction of the boundary image according to a preset edge detection operator; obtaining the gradient in the gradient direction The maximum value and the minimum value of the film; the outer contour image is generated and extracted according to the relative position corresponding to the maximum value and the minimum value in the boundary image.
  • the preset edge operators are any one of the first derivative operators.
  • Determining whether the outer contour image is the target image refers to determining whether the shape formed by the outer contour image is the target image shape, that is, whether the object image corresponding to the position of the outer contour image in the image to be measured is the target image. Determining whether the outer contour image is a target image specifically includes: randomly selecting a starting pixel from the outer contour image, and recording the starting pixel position of the starting pixel; calculating the starting pixel, and The pixel variance between adjacent pixels corresponding to the starting pixel point, and the adjacent pixel position of the adjacent pixel point is recorded; if the pixel variance is less than a first preset threshold, the adjacent pixel point is determined The pixel is the new starting pixel; if the adjacent pixel position is the same as the starting pixel position, the SVM model is used to extract the contour vector of the outer contour image; if the contour vector is the same as the preset feature vector If the similarity of is greater than the second preset threshold, it is determined that the outer contour image is the target image.
  • the outline image can be divided into two types: closed and non-closed. Randomly select the starting pixel point in the outer contour image, calculate the pixel variance between this point and the adjacent pixel point, if the pixel variance is less than the first preset threshold, then the pixel point is considered to be continuous before, an exemplary first The preset threshold is 1.5. When the continuous pixels can recursively to the starting pixel, it is considered that the outer contour image is closed. For the closed contour, the SVM classification and recognition method is adopted.
  • the recognition process includes: using the pre-trained SVM model to calculate the contour vectors of various objects in the outer contour image, using the SVM trained preset feature vector and contour vector to compare, the similarity exceeds the second preset threshold, then it is considered
  • the outer contour image is the target image, and the exemplary second preset threshold is 90%.
  • the SVM model Before extracting the contour vector of the outer contour image by using the SVM model, it further includes: acquiring a training image, the training image includes a positive sample image and a negative sample image; training and saving the SVM model according to the training image.
  • the SVM model When training the SVM model, it can be trained to obtain image features that have a greater impact on judging whether it is a palm. Then the image feature is recorded in the SVM model so that the contour vector corresponding to the feature of the outer contour image can be extracted according to the SVM model.
  • the preset feature vector can be general data, or the average value corresponding to the feature vectors of all images in the training data containing the target image, or the feature vector of any image containing the target image in the training data. In the embodiment, the source of the preset feature vector is not limited.
  • Palm prints refer to the various lines on the surface of the palm between the wrist and the fingers. The morphology of palm prints is controlled by genetic genes. Even if the epidermis peels off for some reason, the new palm print lines maintain their original structure. The most important feature in palmprints is the line feature, and the clearest stripes in these line features basically do not change with the life of a person.
  • Point features mainly refer to the skin surface features on the palm of the hand that are similar to fingerprints, such as the singular points and patterns formed locally in palm prints and mastoid lines.
  • Texture characteristics mainly refer to some lines that are shorter and thinner than the lines, but their distribution on the palm is irregular.
  • the characteristics of palm prints also include geometric characteristics: such as the width, length and geometric shape of the palm, and the distribution of different areas of the palm.
  • the method for extracting the user's palmprint features is the same as the method for extracting the palmprint features of the palm image in step 207. Compare the palmprint feature of the palm image with the user's palmprint feature in the palmprint recognition library. If the palmprint feature of the palm image is the same as the palmprint feature of a user, then the palm in the palm image is the palm of a user , To generate a prompt message that the image to be tested is successfully recognized.
  • the prompt information may be the execution information of opening the door, may be the recording information of successful identification, or the execution information of locking the door.
  • the execution operation after successful identification is not limited in this application.
  • This application provides an image boundary detection method. First, according to the preset reference color, the test image is averaged to generate an averaged image, and then the averaged image is binarized to generate the boundary image, and then according to the edge Detection algorithm, extract the outer contour image of the object in the boundary image, and then judge whether the outer contour image is the target image according to the support vector machine SVM algorithm, and finally if the judgment result is yes, mark the outer contour of the outer contour image in the image to be measured pixel.
  • the embodiment of the present application can reduce background interference and enhance detection robustness by performing averaging and binarization processing on the image.
  • the amount of calculation can be reduced and the detection speed can be increased.
  • the recursive image content step by step increases the accuracy of extracting the outer contour image and improves the accuracy of judging the palm boundary.
  • an embodiment of the present application provides an image boundary detection device. As shown in FIG. 3, the device includes:
  • the first generating module 31 is configured to perform averaging processing on the image to be tested according to a preset reference color to generate an averaging image
  • the judging module 34 is used to judge whether the outer contour image is a target image according to the support vector machine SVM algorithm;
  • This application provides an image boundary detection device. First, according to the preset reference color, the test image is averaged to generate an averaged image, and then the averaged image is binarized to generate a boundary image, and then according to the edge Detection algorithm, extract the outer contour image of the object in the boundary image, and then judge whether the outer contour image is the target image according to the support vector machine SVM algorithm, and finally if the judgment result is yes, mark the outer contour of the outer contour image in the image to be measured pixel.
  • the embodiment of the present application can reduce background interference and enhance detection robustness by performing averaging and binarization processing on the image.
  • an embodiment of the present application provides another image boundary detection device.
  • the device includes:
  • the first generating module 41 is configured to perform averaging processing on the image to be tested according to a preset reference color to generate an averaging image
  • the second generating module 42 is configured to perform binarization processing on the averaged image to generate a boundary image
  • the judging module 44 is used to judge whether the outer contour image is a target image according to the support vector machine SVM algorithm;
  • the marking module 45 is used for marking the outer contour pixels of the outer contour image in the image to be measured if the judgment result is yes.
  • the first generating module 41 includes:
  • the establishment unit 411 is configured to establish a monochromatic channel according to a preset reference color, the monochromatic channel including a red channel, a green channel and a blue channel;
  • An acquiring unit 412 configured to respectively acquire a monochrome image in which the image to be tested passes through the red channel, the green channel, and the blue channel;
  • the merging unit 414 is configured to merge the single-color averaged image to generate the averaged image.
  • the generating unit 413 includes:
  • the calculation subunit 4131 is also used to calculate the cumulative probability c(j) of the distribution probability, and the cumulative probability function for calculating the cumulative probability is
  • the generating subunit 4132 is configured to perform a product operation on the preset pixel range value and the cumulative probability c(j) to generate the monochrome average image.
  • the first extraction module 43 includes:
  • the calculation unit 431 is configured to calculate the gradient film and the local gradient direction of the boundary image according to a preset edge detection operator
  • the obtaining unit 432 is configured to obtain the maximum value and the minimum value of the gradient film in the gradient direction;
  • the extraction unit 433 is configured to generate and extract the outer contour image according to the relative position corresponding to the maximum value and the minimum value in the boundary image.
  • judgment module 44 includes:
  • the selecting unit 441 is configured to randomly select a starting pixel point from the outer contour image, and record the starting pixel position of the starting pixel point;
  • the calculation unit 442 is configured to calculate the starting pixel point and the pixel variance between adjacent pixels corresponding to the starting pixel point, and record the adjacent pixel positions of the adjacent pixels;
  • the calculation unit 442 is further configured to determine that the adjacent pixel is a new starting pixel if the pixel variance is less than a first preset threshold;
  • the extraction unit 443 is configured to extract the contour vector of the outer contour image by using the SVM model if the adjacent pixel position is the same as the starting pixel position;
  • the determining unit 444 is configured to determine that the outer contour image is a target image if the similarity between the contour vector and the preset feature vector is greater than a second preset threshold.
  • the device further includes:
  • the training unit 446 is configured to train and save the SVM model according to the training image.
  • the device further includes:
  • the obtaining module 46 is configured to, after marking the outer contour pixels of the outer contour image in the image to be measured, obtain an effective image within the outer contour of the image to be measured according to the pixels of the outer contour image;
  • the third generating module 48 is configured to generate a prompt message indicating that the image to be tested is successfully recognized if the image feature is recorded in a preset feature recognition library;
  • This application provides an image boundary detection device. First, according to the preset reference color, the test image is averaged to generate an averaged image, and then the averaged image is binarized to generate a boundary image, and then according to the edge Detection algorithm, extract the outer contour image of the object in the boundary image, and then judge whether the outer contour image is the target image according to the support vector machine SVM algorithm, and finally if the judgment result is yes, mark the outer contour of the outer contour image in the image to be measured pixel.
  • the embodiment of the present application can reduce background interference and enhance detection robustness by performing averaging and binarization processing on the image.
  • the amount of calculation can be reduced and the detection speed can be increased.
  • the recursive image content step by step increases the accuracy of extracting the outer contour image and improves the accuracy of judging the palm boundary.
  • FIG. 5 shows a schematic structural diagram of a computer device according to an embodiment of the present application, and the specific embodiment of the present application does not limit the specific implementation of the computer device.
  • the computer device may include: a processor (processor) 502, a communication interface (Communications Interface) 504, a memory (memory) 506, and a communication bus 508.
  • processor processor
  • communication interface Communication Interface
  • memory memory
  • the processor 502, the communication interface 504, and the memory 506 communicate with each other through the communication bus 508.
  • the communication interface 504 is used to communicate with network elements of other devices, such as clients or other servers.
  • the processor 502 is configured to execute the program 510, and specifically can execute the relevant steps in the embodiment of the image boundary detection method described above.
  • the program 510 may include program code, and the program code includes computer-readable executable instructions.
  • the processor 502 may be a central processing unit CPU, or an ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present application.
  • the one or more processors included in the computer device may be the same type of processor, such as one or more CPUs; or different types of processors, such as one or more CPUs and one or more ASICs.
  • the memory 506 is used to store the program 510.
  • the memory 506 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), for example, at least one disk memory.
  • the program 510 may be specifically used to cause the processor 502 to perform the following operations:
  • the image to be tested is averaged to generate an averaged image; the averaged image is binarized to generate a boundary image; according to the edge detection algorithm, the outer contour of the object in the boundary image is extracted Image; According to the support vector machine SVM algorithm, determine whether the outer contour image is a target image; if the judgment result is yes, mark the outer contour pixels of the outer contour image in the image to be measured.
  • modules or steps of this application can be implemented by a general computing device, and they can be concentrated on a single computing device or distributed in a network composed of multiple computing devices.
  • they can be implemented with program codes executable by the computing device, so that they can be stored in the storage device for execution by the computing device, and in some cases, can be executed in a different order than here.

Abstract

本申请公开了一种图像边界的检测方法及装置,涉及图像处理技术领域,为解决现有技术中不能准确检测手掌边界的问题而发明。该方法主要包括:根据预置基准颜色,对待测图像进行均值化处理,生成均值化图像;将所述均值化图像进行二值化处理,生成边界图像;按照边缘检测算法,提取所述边界图像中物体的外轮廓图像;按照支持向量机SVM算法,判断所述外轮廓图像是否为目标图像;如果判断结果为是,则在待测图像中标记所述外轮廓图像的外轮廓像素点。本申请主要应用于图像识别的过程中。

Description

一种图像边界的检测方法及装置
本申请要求与2019年6月20日提交中国专利局、申请号为201910534900.7、申请名称为“一种图像边界的检测方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在申请中。
技术领域
本申请涉及图像处理技术领域,特别是涉及一种图像边界的检测方法及装置。
背景技术
检测图像边界,通常应用于图像识别的过程中,以检测手掌边界为例,该方法是手势识别和掌纹识别的基础。在检测手掌边界时容易受到背景干扰,如面部、颈部的皮肤或颜色与肤色相似的衣物等,特别是在背景复杂多变的情况下,背景干扰严重影响检测手掌边界的准确性。
在现有技术中,是通过取得手势图像,提取该手势图像在设定范围内的最大轮廓;计算最大轮廓的中的多个凹陷点的坐标值,得到多个凹陷点的平均点;使用腐蚀法多次处理最大轮廓,使处理后的轮廓的面积小于最大轮廓的面积且和最大轮廓的面积为设定比例;对处理后的轮廓的各像素点的坐标值进行加权,权值为该像素点在处理后的轮廓中的高度;计算加权后的像素点的平均点,得到第一平均点;判断第一平均点和凹陷点的平均点的欧拉距离是否小于设定阈值,如果为是则以第一平均点为手掌中心,对处理后的轮廓进行选择,去掉手臂部分,得到手势轮廓。
通过上述方案以手掌中心检测手掌边界,在执行步骤中的计算凹陷点的平均点、腐蚀算法和坐标值加权都对图像做修正处理,虽然能够减少背景干扰,但是不能准确的检测手势轮廓。
发明内容
有鉴于此,本申请提供一种图像边界的检测方法及装置,主要目的在于现有技术中不能准确检测图像边界的问题。
依据本申请一个方面,提供了一种图像边界的检测方法,包括:
根据预置基准颜色,对待测图像进行均值化处理,生成均值化图像;将所述均值化图像进行二值化处理,生成边界图像;按照边缘检测算法,提取所述边界图像中物体的外轮廓图像;按照支持向量机SVM算法,判断所述外轮廓图像是否为目标图像;如果判断结果为是,则在待测图像中标记所述外轮廓图像的外轮廓像素点。
依据本申请另一个方面,提供了一种图像边界的检测装置,包括:
第一生成模块,用于根据预置基准颜色,对待测图像进行均值化处理,生成均值化图像;第二生成模块,用于将所述均值化图像进行二值化处理,生成边界图像;第一提取模块,用于按照边缘检测算法,提取所述边界图像中物体的外轮廓图像;判断模块,用于按照支持向量机SVM算法,判断所述外轮廓图像是 否为目标图像;标记模块,用于如果判断结果为是,则在待测图像中标记所述外轮廓图像的外轮廓像素点。
根据本申请的又一方面,提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有至少一种计算机可读执行指令,所述计算机可读执行指令使处理器执行如上述图像边界的检测方法对应的操作。
根据本申请的再一方面,提供了一种计算机设备,包括:处理器、存储器、通信接口和通信总线,所述处理器、所述存储器和所述通信接口通过所述通信总线完成相互间的通信;所述存储器用于存放至少一种计算机可读执行指令,所述计算机可读执行指令使所述处理器执行上述图像边界的检测方法对应的操作。
借由上述技术方案,本申请实施例提供的技术方案至少具有下列优点:本申请提供了一种图像边界的检测方法及装置,首先根据预置基准颜色,对待测图像进行均值化处理,生成均值化图像,然后将均值化图像进行二值化处理,生成边界图像,再按照边缘检测算法,提取边界图像中物体的外轮廓图像,再按照支持向量机SVM算法,判断外轮廓图像是否为目标图像,最后如果判断结果为是,则在待测图像中标记外轮廓图像的外轮廓像素点。与现有技术相比,本申请实施例通过对图像进行均值化和二值化处理,能够减少背景干扰增强检测鲁棒性。在采用SVM算法判断外轮廓图像是否为手掌图像时,能够减少计算量提高检测速度。通过均值化图像、二值化图像和外轮廓图像的阶梯式提取方案,一步一步的递归图像内容,增加提取外轮廓图像的准确性,以提高判断手掌边界的准确性。
上述说明仅是本申请技术方案的概述,为了能够更清楚了解本申请的技术手段,而可依照说明书的内容予以实施,并且为了让本申请的上述和其它目的、特征和优点能够更明显易懂,以下特举本申请的具体实施方式。
附图说明
通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本申请的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:
图1示出了本申请实施例提供的一种图像边界的检测方法流程图;
图2示出了本申请实施例提供的另一种图像边界的检测方法流程图;
图3示出了本申请实施例提供的一种图像边界的检测装置组成框图;
图4示出了本申请实施例提供的另一种图像边界的检测装置组成框图;
图5示出了本申请实施例提供的一种计算机设备的结构示意图。
具体实施方式
下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。
本申请实施例提供了一种图像边界的检测方法,如图1所示,该方法包括:
101、根据预置基准颜色,对待测图像进行均值化处理,生成均值化图像。
预置基准颜色是指现在RGB标准中的红、绿、蓝三种基本色的设置参数,行业中通常选取为[123.7,116.8,103.9]。均值化处理就是将待测图像中的除了基本色之外的颜色尽量向基本色中的某一种颜色靠拢,均值化处理后的均值化图像与待测图像相比会缩小图像中像素之间的差距,同时增加图像对比度。在均值化图像中比较容易区分手掌肤色和背景色。待测图像是由多个像素点构成,如果采用RGB标准则每个像素点由红绿蓝三种参数表示,如像素点值为[137,56,128],[113,127,92],[89,162,104],将相同基本上对应值进行均值化处理,重新生成各个像素点值[26,-59,20],[0,12,-8],[-24,47,-4],能够减少后续的数据运算量,同时增强图像的清晰度和完整性。
102、将所述均值化图像进行二值化处理,生成边界图像。
二值化处理就是将图像上的像素点的灰度值设置为0或255,也就是将整个图像呈现出明显的黑白效果的过程。在数字图像处理中,图像的二值化使图像中数据量大为减少,从而能凸显出待测图像中物体的轮廓。边界图像的灰度值包括0或255,与均值化图像相比减少大量数据。边界图像中背景图像也只有黑白两种颜色,能够消除背景图像中的部分干扰因素。
103、按照边缘检测算法,提取所述边界图像中物体的外轮廓图像。
边缘检测的目的是标识数字图像中亮度变化明显的点,按照边缘检测算法提取的外轮廓图像与边界图像相比,大幅度减少数据量,并且剔除不相关信息,保留图像的结构属性。边缘检测算法基本上可以分为基于查找的检测方法和基于零穿越的检测方法。基于查找的检测方法通过寻找图像一阶导数中的最大值和最小值来检测边界轮廓,将边界轮廓定位在梯度最大的方向。基于零穿越的检测方法通过寻找图像二阶导数零穿越来寻找边界轮廓,将边界轮廓定位在二阶导数的过零点。外轮廓图像是指待测图像中所有物体的二值化的轮廓图像,外轮廓图像的图像数量大于1。如果待测图像中的物体包括拍摄背景中的建筑、马路、车辆,以及拍摄头、手、胳膊,那么外轮廓图像包括与建筑、马路、车辆、头、手、胳膊一一对应的二值化的轮廓图像。
104、按照支持向量机SVM算法,判断所述外轮廓图像是否为目标图像。
目标图像是指任意物体的图像,可以为手部图像、人脸图像、动物图像等等。为了进行有效识别,目 标图像通过各种角度进行拍摄。如果目标图像为手部图像,那么目标图像包括至少一种手姿势的目标图像,手姿势包括五指合并掌心伸展、五指张开掌心伸展和部分手指微屈掌心伸展等等。手掌姿势是指包括手掌和手指,且手掌与手指的不同相对位置。如果应用手掌图像作为生物识别依据,以手指和手掌组成的目标图像作为区分手掌与其他物体的依据,能够保证待测图像中包括手掌图像且图像数据量越小越好。在本步骤中,需要判断每一张外轮廓图像是否为目标图像。SVM算法用于根据预先训练好的SVM模型,判断外轮廓图像是否为目标图像。SVM模型实际上是线性分类器,是根据训练图像及其对应的分类结果训练得到的。训练图像可以分为两类,包含目标图像的正样本图像和不包含目标图像的负样本图像,相应的分类结果包括包含目标图像和不包含目标图像两类。
105、如果判断结果为是,则在所述待测图像中标记所述外轮廓图像的外轮廓像素点。
如果判断外轮廓图像为目标图像,则在待测图像中标记外轮廓图像中的外轮廓像素点,至到所有的外轮廓图像都完成判断或判断并标记的步骤。还可以判断所有的外轮廓图像是否为目标图像后,将在待测图像中标记外轮廓图像为目标图像的所有的外轮廓像素点。无论采用边判断边标记的方式,还是采用先判断后标记的方式,只要保证所有的外轮廓图像都经过判断过程,所有的外轮廓图像为手掌的都在待测图像中被标记即可。
在待测图像中标记外轮廓像素点,以便于获取外轮廓点内部的有效图像,以进行图像识别。标记外轮廓像素点可采用更改像素点颜色、统一记录外轮廓像素点位置和为外轮廓像素点添加标识等方式。
本申请提供了一种图像边界的检测方法,首先根据预置基准颜色,对待测图像进行均值化处理,生成均值化图像,然后将均值化图像进行二值化处理,生成边界图像,再按照边缘检测算法,提取边界图像中物体的外轮廓图像,再按照支持向量机SVM算法,判断外轮廓图像是否为目标图像,最后如果判断结果为是,则在待测图像中标记外轮廓图像的外轮廓像素点。与现有技术相比,本申请实施例通过对图像进行均值化和二值化处理,能够减少背景干扰增强检测鲁棒性。在采用SVM算法判断外轮廓图像是否为手掌图像时,能够减少计算量提高检测速度。通过均值化图像、二值化图像和外轮廓图像的阶梯式提取方案,一步一步的递归图像内容,增加提取外轮廓图像的准确性,以提高判断手掌边界的准确性。
本申请实施例提供了另一种图像边界的检测方法,如图2所示,该方法包括:
201、根据预置基准颜色,对待测图像进行均值化处理,生成均值化图像。
预置基准颜色包括红、绿、蓝三种基本色对应的颜色亮度,与其相对于均值化图像的生成方法具体包括:根据预置基准颜色,建立单色通道,所述单色通道包括红色通道、绿色通道和蓝色通道;分别获取所述待测图像经过所述红色通道、所述绿色通道和所述蓝色通道的单色图像;将所述单色图像进行均值化处理,生成单色均值化图像;合并所述单色均值化图像,生成所述均值化图像。
单色通道用于滤除待测图像中该通道色彩以外的其他色彩,以改变待测图像中的颜色。经过不同的单 色通道,生成与其对应的单色图像,单色通道的数量与单色图像的一一对应的。对每个单色图像进行均值化处理,将单色图像中除了基本色之外的颜色尽量像基本色中的某一种颜色靠拢,每个单色图像生成一个单色均值图像。根据单色均值图像中色彩的记录方式,合并三个单色均值图像,生成待测图像的均值化图像。
将单色图像进行均值化处理,生成单色均值化图像,具体包括:计算所述单色图像的像素在各灰度级中的分布概率p(i),p(i)=n i/n,i∈(0,1,…L-1),其中i为图像的灰度级个数,p(i)为第i个灰度级的分布概率,ni为所述待测图像中属于第i个灰度级的像素点个数,n为所述待测图像的像素点的总数,L为正整数且最大值为256;计算所述分布概率的累计概率c(j),所述计算累计概率的累计概率函数为
Figure PCTCN2019118348-appb-000001
将预置像素范围值与所述累计概率c(j)做乘积运算,生成所述单色均值图像。
202、将所述均值化图像进行二值化处理,生成边界图像。
边界图像是二值化图像,包括0或255两种灰度值,与待测图像相比数据量较少,能够凸显出待测图像中物体的轮廓。
203、按照边缘检测算法,提取所述边界图像中物体的外轮廓图像。
图像边缘也就是图像轮廓,一般是指图像在某一局部强度剧烈变化的区域,强度变化一般包括阶跃变化和屋顶变化。边缘检测的目的在于找到具有阶跃变化或者屋顶变化的像素点的集合。根据图像的变化特点,对于阶跃变化一阶导数的峰值为边缘点,对于屋顶变化一阶导数的零点为边缘点。为了便于计算,根据导数分割原理进行实例化形成各种算子,以在计算过程中直接使用。一阶导数算子包括:Roberts Cross算子,Prewitt算子,Sobel算子,Kirsch算子和罗盘算子等等。
按照边缘检测算法,提取边界图像中物体的外轮廓图像,具体包括:根据预置边缘检测算子,计算所述边界图像的梯度膜和局部梯度方向;在所述梯度方向上,获取所述梯度膜的最大值和最小值;根据在所述边界图像中所述最大值和所述最小值对应的相对位置,生成并提取所述外轮廓图像。其中预置边缘算子分别为一阶导数算子中的任一算子。
204、按照支持向量机SVM算法,判断所述外轮廓图像是否为目标图像。
判断外轮廓图像是否为目标图像,是指判断外轮廓图像构成的形状是否为目标图像形状,也就是判断待测图像中与外轮廓图像位置相对应的物体图像是否为目标图像。判断外轮廓图像是否为目标图像,具体包括:从所述外轮廓图像中,随机选取起始像素点,并记录所述起始像素点的起始像素位置;计算所述起始像素点,与所述起始像素点对应的相邻像素点之间的像素方差,并记录所述相邻像素点的相邻像素位置;如果所述像素方差小于第一预置阈值,则确定所述相邻像素点为新的起始像素点;如果所述相邻像素位置与所述起始像素位置相同,则利用SVM模型提取所述外轮廓图像的轮廓向量;如果所述轮廓向量与预置特征向量的相似度大于第二预置阈值,则确定所述外轮廓图像是目标图像。
外轮廓图像可以分为封闭和非封闭两种。在外轮廓图像中随机选取起始像素点,计算该点与相邻像素点之间的像素方差,如果像素方差小于第一预置阈值,则认为该像素点之前为连续的,示例性的第一预置阈值为1.5。当连续的像素点能递归到起始像素点的时候,认为是外轮廓图像封闭的,对封闭的轮廓,采用SVM分类识别的方式。识别过程包括:利用预先训练好的SVM模型计算外轮廓图像中各种物体的轮廓向量,利用SVM训练好的预置特征向量和轮廓向量进行对比,相似度超过第二预置阈值,则认为该外轮廓图像是目标图像,示例性的第二预置阈值为90%。
利用SVM模型提取外轮廓图像的轮廓向量之前,还包括:获取训练图像,所述训练图像中包括正样本图像和负样本图像;根据所述训练图像,训练并保存SVM模型。在训练SVM模型时,能够训练得到对判断是否为手掌影响较大的图像特征。然后将该图像特征记录在SVM模型中,以便于根据SVM模型提取外轮廓图像的与该特征对应的轮廓向量。预置特征向量,可以是通用数据,也可以是训练数据中包含目标图像的所有图像的特征向量对应的平均值,还可以是训练数据中任一包含目标图像的图像的特征向量,在本申请实施例中对预置特征向量的来源不做限定。
205、如果判断结果为是,则在所述待测图像中标记所述外轮廓图像的外轮廓像素点。
在待测图像中标记外轮廓像素点,以便于获取外轮廓点内部的图像,以进行掌纹识别。标记外轮廓像素点可采用更改像素点颜色、统一记录外轮廓像素点位置和为外轮廓像素点添加标识等方式。
206、根据所述外轮廓图像像素点,获取所述待测图像中外轮廓内的有效图像。
在待测图像中被标记的外轮廓像素点,构成了目标图像形状。以外轮廓像素点为边界点,在待测图像中且在边界点内部的图像为有效图像,有效图像是指包括识别图像有效信息的图像部分。
207、提取所述有效图像的图像特征。
以有效图像为手掌图像为例进行说明,利用掌纹的纹线特征、点特征、纹理特征和几何特征完全可以确定一个人的身份,提取掌纹特征也就是提取手掌图像的纹线特征、点特征、纹理特征和几何特征。掌纹是指手腕与手指之间的手掌表面上的各种纹线。掌纹的形态由遗传基因控制,即使由于某种原因表皮剥落,新生的掌纹纹线仍保持着原来的结构。掌纹中最重要的特征是纹线特征,而且这些纹线特征中最清晰的几条纹线基本上是伴随人的一生不发生变化的。点特征主要是指手掌上所具有的和指纹类似的皮肤表面特征,如掌纹乳突纹在局部形成的奇异点及纹形。纹理特征,主要是指比纹线更短、更细的一些纹线,但其在手掌上分布是毫无规律的。掌纹的特征还包括几何特征:如手掌的宽度、长度和几何形状,以及手掌不同区域的分布。
208、如果所述图像特征记录在预置特征识别库中,则生成所述待测图像识别成功的提示信息。
以有效图像为手掌图像为例进行说明,在掌纹识别之前,通常需要录入用户掌纹,提取用户掌纹特征,然后将用户掌纹特征保存在掌纹识别库中。提取用户掌纹特征的方法与步骤207中提取手掌图像的掌纹特 征的方法相同。将手掌图像的掌纹特征与掌纹识别库中的用户掌纹特征进行比较,如果手掌图像的掌纹特征与某一用户掌纹特征相同,则该手掌图像中的手掌是某一用户的手掌,生成待测图像识别成功的提示信息。该提示信息可以是开门的执行信息,可以是识别成功的记录信息,还可以是锁门的执行信息,在本申请中对识别成功后的执行操作不做限定。
209、如果所述图像特征未记录在所述预置特征识别库中,则生成所述待测图像识别失败的提示信息。
以有效图像为手掌图像为例进行说明,本步骤是与步骤208是并列的两个判断分支,其判断过程相同,如果手掌图像的掌纹特征与掌纹识别库中的某一用户掌纹特征不同,则该手掌图像中的手掌不是某一用户的手掌,生成识别失败的提示信息。该提示信息,可以是重新拍摄待测图像的摄像头启动信息,可以是通知管理员的告警信息,还可以是锁死当前掌纹识别系统的防护信息,在本申请中对识别失败后的执行操作不做限定。
本申请提供了一种图像边界的检测方法,首先根据预置基准颜色,对待测图像进行均值化处理,生成均值化图像,然后将均值化图像进行二值化处理,生成边界图像,再按照边缘检测算法,提取边界图像中物体的外轮廓图像,再按照支持向量机SVM算法,判断外轮廓图像是否为目标图像,最后如果判断结果为是,则在待测图像中标记外轮廓图像的外轮廓像素点。与现有技术相比,本申请实施例通过对图像进行均值化和二值化处理,能够减少背景干扰增强检测鲁棒性。在采用SVM算法判断外轮廓图像是否为手掌图像时,能够减少计算量提高检测速度。通过均值化图像、二值化图像和外轮廓图像的阶梯式提取方案,一步一步的递归图像内容,增加提取外轮廓图像的准确性,以提高判断手掌边界的准确性。
进一步的,作为对上述图1所示方法的实现,本申请实施例提供了一种图像边界的检测装置,如图3所示,该装置包括:
第一生成模块31,用于根据预置基准颜色,对待测图像进行均值化处理,生成均值化图像;
第二生成模块32,用于将所述均值化图像进行二值化处理,生成边界图像;
第一提取模块33,用于按照边缘检测算法,提取所述边界图像中物体的外轮廓图像;
判断模块34,用于按照支持向量机SVM算法,判断所述外轮廓图像是否为目标图像;
标记模块35,用于如果判断结果为是,则在待测图像中标记所述外轮廓图像的外轮廓像素点。
本申请提供了一种图像边界的检测装置,首先根据预置基准颜色,对待测图像进行均值化处理,生成均值化图像,然后将均值化图像进行二值化处理,生成边界图像,再按照边缘检测算法,提取边界图像中物体的外轮廓图像,再按照支持向量机SVM算法,判断外轮廓图像是否为目标图像,最后如果判断结果为是,则在待测图像中标记外轮廓图像的外轮廓像素点。与现有技术相比,本申请实施例通过对图像进行均值化和二值化处理,能够减少背景干扰增强检测鲁棒性。在采用SVM算法判断外轮廓图像是否为手掌图像时,能够减少计算量提高检测速度。通过均值化图像、二值化图像和外轮廓图像的阶梯式提取方案,一 步一步的递归图像内容,增加提取外轮廓图像的准确性,以提高判断手掌边界的准确性。
进一步的,作为对上述图2所示方法的实现,本申请实施例提供了另一种图像边界的检测装置,如图4所示,该装置包括:
第一生成模块41,用于根据预置基准颜色,对待测图像进行均值化处理,生成均值化图像;
第二生成模块42,用于将所述均值化图像进行二值化处理,生成边界图像;
第一提取模块43,用于按照边缘检测算法,提取所述边界图像中物体的外轮廓图像;
判断模块44,用于按照支持向量机SVM算法,判断所述外轮廓图像是否为目标图像;
标记模块45,用于如果判断结果为是,则在待测图像中标记所述外轮廓图像的外轮廓像素点。
进一步地,所述第一生成模块41,包括:
建立单元411,用于根据预置基准颜色,建立单色通道,所述单色通道包括红色通道、绿色通道和蓝色通道;
获取单元412,用于分别获取所述待测图像经过所述红色通道、所述绿色通道和所述蓝色通道的单色图像;
生成单元413,用于将所述单色图像进行均值化处理,生成单色均值化图像;
合并单元414,用于合并所述单色均值化图像,生成所述均值化图像。
进一步地,所述生成单元413,包括:
计算子单元4131,用于计算所述单色图像的像素在各灰度级中的分布概率p(i),p(i)=n i/n,i∈(0,1,…L-1),其中i为图像的灰度级个数,p(i)为第i个灰度级的分布概率,ni为所述待测图像中属于第i个灰度级的像素点个数,n为所述待测图像的像素点的总数,L为正整数且最大值为256;
所述计算子单元4131,还用于计算所述分布概率的累计概率c(j),所述计算累计概率的累计概率函数为
Figure PCTCN2019118348-appb-000002
生成子单元4132,用于将预置像素范围值与所述累计概率c(j)做乘积运算,生成所述单色均值图像。
进一步地,所述第一提取模块43,包括:
计算单元431,用于根据预置边缘检测算子,计算所述边界图像的梯度膜和局部梯度方向;
获取单元432,用于在所述梯度方向上,获取所述梯度膜的最大值和最小值;
提取单元433,用于根据在所述边界图像中所述最大值和所述最小值对应的相对位置,生成并提取所述外轮廓图像。
进一步地,所述判断模块44,包括:
选取单元441,用于从所述外轮廓图像中,随机选取起始像素点,并记录所述起始像素点的起始像素位置;
计算单元442,用于计算所述起始像素点,与所述起始像素点对应的相邻像素点之间的像素方差,并记录所述相邻像素点的相邻像素位置;
所述计算单元442,还用于如果所述像素方差小于第一预置阈值,则确定所述相邻像素点为新的起始像素点;
提取单元443,用于如果所述相邻像素位置与所述起始像素位置相同,则利用SVM模型提取所述外轮廓图像的轮廓向量;
确定单元444,用于如果所述轮廓向量与预置特征向量的相似度大于第二预置阈值,则确定所述外轮廓图像是目标图像。
进一步地,所述装置还包括:
获取单元445,用于所述利用SVM模型提取所述外轮廓图像的轮廓向量之前,获取训练图像,所述训练图像中包括正样本图像和负样本图像;
训练单元446,用于根据所述训练图像,训练并保存SVM模型。
进一步地,所述装置还包括:
获取模块46,用于所述在待测图像中标记所述外轮廓图像的外轮廓像素点之后,根据所述外轮廓图像像素点,获取所述待测图像中外轮廓内的有效图像;
第二提取模块47,用于提取所述有效图像的图像特征;
第三生成模块48,用于如果所述图像特征记录在预置特征识别库中,则生成所述待测图像识别成功的提示信息;
所述第三生成模块48,还用于如果所述图像特征未记录在所述预置特征识别库中,则生成所述待测图像识别失败的提示信息。
本申请提供了一种图像边界的检测装置,首先根据预置基准颜色,对待测图像进行均值化处理,生成均值化图像,然后将均值化图像进行二值化处理,生成边界图像,再按照边缘检测算法,提取边界图像中物体的外轮廓图像,再按照支持向量机SVM算法,判断外轮廓图像是否为目标图像,最后如果判断结果为是,则在待测图像中标记外轮廓图像的外轮廓像素点。与现有技术相比,本申请实施例通过对图像进行均值化和二值化处理,能够减少背景干扰增强检测鲁棒性。在采用SVM算法判断外轮廓图像是否为手掌图像时,能够减少计算量提高检测速度。通过均值化图像、二值化图像和外轮廓图像的阶梯式提取方案,一步一步的递归图像内容,增加提取外轮廓图像的准确性,以提高判断手掌边界的准确性。
根据本申请一个实施例提供了一种计算机可读存储介质,所述计算机可读存储介质存储有至少一种计算机可读执行指令,该计算机可读执行指令可执行上述任意方法实施例中的图像边界的检测方法。该计算机可读存储介质可以为非易失性存储介质,也可以为易失性存储介质。
图5示出了根据本申请一个实施例提供的一种计算机设备的结构示意图,本申请具体实施例并不对计算机设备的具体实现做限定。
如图5所示,该计算机设备可以包括:处理器(processor)502、通信接口(Communications Interface)504、存储器(memory)506、以及通信总线508。
其中:处理器502、通信接口504、以及存储器506通过通信总线508完成相互间的通信。通信接口504,用于与其它设备比如客户端或其它服务器等的网元通信。处理器502,用于执行程序510,具体可以执行上述图像边界的检测方法实施例中的相关步骤。具体地,程序510可以包括程序代码,该程序代码包括计算机可读执行指令。处理器502可能是中央处理器CPU,或者是特定集成电路ASIC(Application Specific Integrated Circuit),或者是被配置成实施本申请实施例的一个或多个集成电路。计算机设备包括的一个或多个处理器,可以是同一类型的处理器,如一个或多个CPU;也可以是不同类型的处理器,如一个或多个CPU以及一个或多个ASIC。存储器506,用于存放程序510。存储器506可能包含高速RAM存储器,也可能还包括非易失性存储器(non-volatile memory),例如至少一个磁盘存储器。程序510具体可以用于使得处理器502执行以下操作:
根据预置基准颜色,对待测图像进行均值化处理,生成均值化图像;将所述均值化图像进行二值化处理,生成边界图像;按照边缘检测算法,提取所述边界图像中物体的外轮廓图像;按照支持向量机SVM算法,判断所述外轮廓图像是否为目标图像;如果判断结果为是,则在待测图像中标记所述外轮廓图像的外轮廓像素点。
显然,本领域的技术人员应该明白,上述的本申请的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,可选地,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本申请不限制于任何特定的硬件和软件结合。
以上所述仅为本申请的优选实施例而已,并不用于限制本申请,对于本领域的技术人员来说,本申请可以有各种更改和变化。凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包括在本申请的保护范围之内。

Claims (20)

  1. 一种图像边界的检测方法,其特征在于,包括:
    根据预置基准颜色,对待测图像进行均值化处理,生成均值化图像;
    将所述均值化图像进行二值化处理,生成边界图像;
    按照边缘检测算法,提取所述边界图像中物体的外轮廓图像;
    按照支持向量机SVM算法,判断所述外轮廓图像是否为目标图像;
    如果判断结果为是,则在所述待测图像中标记所述外轮廓图像的外轮廓像素点。
  2. 如权利要求1所述的方法,其特征在于,所述根据预置基准颜色,对待测图像进行均值化处理,生成均值化图像,包括:
    根据预置基准颜色,建立单色通道,所述单色通道包括红色通道、绿色通道和蓝色通道;
    分别获取所述待测图像经过所述红色通道、所述绿色通道和所述蓝色通道的单色图像;
    将所述单色图像进行均值化处理,生成单色均值化图像;
    合并所述单色均值化图像,生成所述均值化图像。
  3. 如权利要求2所述的方法,其特征在于,所述将所述单色图像进行均值化处理,生成单色均值化图像,包括:
    计算所述单色图像的像素在各灰度级中的分布概率p(i),p(i)=n i/n,i∈(0,1,…L-1),其中i为图像的灰度级个数,p(i)为第i个灰度级的分布概率,n i为所述待测图像中属于第i个灰度级的像素点个数,n为所述待测图像的像素点的总数,L为正整数且最大值为256;
    计算所述分布概率的累计概率c(j),所述计算累计概率的累计概率函数为
    Figure PCTCN2019118348-appb-100001
    将预置像素范围值与所述累计概率c(j)做乘积运算,生成所述单色均值图像。
  4. 如权利要求1所述的方法,其特征在于,所述按照边缘检测算法,提取所述边界图像中物体的外轮廓图像,包括:
    根据预置边缘检测算子,计算所述边界图像的梯度膜和局部梯度方向;
    在所述梯度方向上,获取所述梯度膜的最大值和最小值;
    根据所述边界图像中所述最大值和所述最小值对应的相对位置,生成并提取所述外轮廓图像。
  5. 如权利要求1所述的方法,其特征在于,所述按照支持向量机SVM算法,判断所述外轮廓图像是否为目标图像,包括:
    从所述外轮廓图像中,随机选取起始像素点,并记录所述起始像素点的起始像素位置;
    计算所述起始像素点,与所述起始像素点对应的相邻像素点之间的像素方差,并记录所述相邻像素点的相邻像素位置;
    如果所述像素方差小于第一预置阈值,则确定所述相邻像素点为新的起始像素点;
    如果所述相邻像素位置与所述起始像素位置相同,则利用SVM模型提取所述外轮廓图像的轮廓 向量;
    如果所述轮廓向量与预置特征向量的相似度大于第二预置阈值,则确定所述外轮廓图像是目标图像。
  6. 如权利要求5所述的方法,其特征在于,所述利用SVM模型提取所述外轮廓图像的轮廓向量之前,所述方法还包括:
    获取训练图像,所述训练图像中包括正样本图像和负样本图像;
    根据所述训练图像,训练并保存SVM模型。
  7. 如权利要求1所述的方法,其特征在于,所述在待测图像中标记所述外轮廓图像的外轮廓像素点之后,所述方法还包括:
    根据所述外轮廓图像像素点,获取所述待测图像中外轮廓内的有效图像;
    提取所述有效图像的图像特征;
    如果所述图像特征记录在预置特征识别库中,则生成所述待测图像识别成功的提示信息;
    如果所述图像特征未记录在所述预置特征识别库中,则生成所述待测图像识别失败的提示信息。
  8. 一种图像边界的检测装置,其特征在于,包括:
    第一生成模块,用于根据预置基准颜色,对待测图像进行均值化处理,生成均值化图像;
    第二生成模块,用于将所述均值化图像进行二值化处理,生成边界图像;
    第一提取模块,用于按照边缘检测算法,提取所述边界图像中物体的外轮廓图像;
    判断模块,用于按照支持向量机SVM算法,判断所述外轮廓图像是否为目标图像;
    标记模块,用于如果判断结果为是,则在待测图像中标记所述外轮廓图像的外轮廓像素点。
  9. 如权利要求8所述的装置,其特征在于,所述第一生成模块,包括:
    建立单元,用于根据预置基准颜色,建立单色通道,所述单色通道包括红色通道、绿色通道和蓝色通道;
    获取单元,用于分别获取所述待测图像经过所述红色通道、所述绿色通道和所述蓝色通道的单色图像;
    生成单元,用于将所述单色图像进行均值化处理,生成单色均值化图像;
    合并单元,用于合并所述单色均值化图像,生成所述均值化图像。
  10. 如权利要求9所述的装置,其特征在于,所述生成单元,包括:
    计算子单元,用于计算所述单色图像的像素在各灰度级中的分布概率p(i),p(i)=n i/n,i∈(0,1,…L-1),其中i为图像的灰度级个数,p(i)为第i个灰度级的分布概率,n i为所述待测图像中属于第i个灰度级的像素点个数,n为所述待测图像的像素点的总数,L为正整数且最大值为256;
    所述计算子单元,还用于计算所述分布概率的累计概率c(j),所述计算累计概率的累计概率函 数为
    Figure PCTCN2019118348-appb-100002
    生成子单元,用于将预置像素范围值与所述累计概率c(j)做乘积运算,生成所述单色均值图像。
  11. 如权利要求8所述的装置,其特征在于,所述第一提取模块,包括:
    计算单元,用于根据预置边缘检测算子,计算所述边界图像的梯度膜和局部梯度方向;
    获取单元,用于在所述梯度方向上,获取所述梯度膜的最大值和最小值;
    提取单元,用于根据所述边界图像中所述最大值和所述最小值对应的相对位置,生成并提取所述外轮廓图像。
  12. 如权利要求8所述的装置,其特征在于,所述判断模块,包括:
    选取单元,用于从所述外轮廓图像中,随机选取起始像素点,并记录所述起始像素点的起始像素位置;
    计算单元,用于计算所述起始像素点,与所述起始像素点对应的相邻像素点之间的像素方差,并记录所述相邻像素点的相邻像素位置;
    所述计算单元,还用于如果所述像素方差小于第一预置阈值,则确定所述相邻像素点为新的起始像素点;
    提取单元,用于如果所述相邻像素位置与所述起始像素位置相同,则利用SVM模型提取所述外轮廓图像的轮廓向量;
    确定单元,用于如果所述轮廓向量与预置特征向量的相似度大于第二预置阈值,则确定所述外轮廓图像是目标图像。
  13. 如权利要求12所述的装置,其特征在于,所述装置还包括:
    获取单元,用于所述利用SVM模型提取所述外轮廓图像的轮廓向量之前,获取训练图像,所述训练图像中包括正样本图像和负样本图像;
    训练单元,用于根据所述训练图像,训练并保存SVM模型。
  14. 如权利要求8所述的装置,其特征在于,所述装置还包括:
    获取模块,用于所述在待测图像中标记所述外轮廓图像的外轮廓像素点之后,根据所述外轮廓图像像素点,获取所述待测图像中外轮廓内的有效图像;
    第二提取模块,用于提取所述有效图像的图像特征;
    第三生成模块,用于如果所述图像特征记录在预置特征识别库中,则生成所述待测图像识别成功的提示信息;
    第三生成模块,还用于如果所述图像特征未记录在所述预置特征识别库中,则生成所述待测图像识别失败的提示信息。
  15. 一种计算机可读存储介质,所述计算机可读存储介质中存储有至少一种计算机可读执行指令,所述计算机可读执行指令使处理器执行实现图像边界的检测方法,包括:
    根据预置基准颜色,对待测图像进行均值化处理,生成均值化图像;将所述均值化图像进行二 值化处理,生成边界图像;按照边缘检测算法,提取所述边界图像中物体的外轮廓图像;按照支持向量机SVM算法,判断所述外轮廓图像是否为目标图像;如果判断结果为是,则在所述待测图像中标记所述外轮廓图像的外轮廓像素点。
  16. 根据权利要求15所述的计算机可读存储介质,其特征在于,所述计算机可读执行指令被处理器执行实现所述根据预置基准颜色,对待测图像进行均值化处理,生成均值化图像,包括:
    根据预置基准颜色,建立单色计算机通道,所述单色通道包括红色通道、绿色通道和蓝色通道;分别获取所述待测图像经过所述红色通道、所述绿色通道和所述蓝色通道的单色图像;将所述单色图像进行均值化处理,生成单色均值化图像;合并所述单色均值化图像,生成所述均值化图像。
  17. 根据权利要求16所述的计算机可读存储介质,其特征在于,所述计算机可读执行指令被处理器执行实现所述将所述单色图像进行均值化处理,生成单色均值化图像,包括:
    计算所述单色图像的像素在各灰度级中的分布概率p(i),p(i)=n i/n,i∈(0,1,…L-1),其中i为图像的灰度级个数,p(i)为第i个灰度级的分布概率,n i为所述待测图像中属于第i个灰度级的像素点个数,n为所述待测图像的像素点的总数,L为正整数且最大值为256;计算所述分布概率的累计概率c(j),所述计算累计概率的累计概率函数为
    Figure PCTCN2019118348-appb-100003
    将预置像素范围值与所述累计概率c(j)做乘积运算,生成所述单色均值图像。
  18. 一种计算机设备,包括:处理器、存储器、通信接口和通信总线,所述处理器、所述存储器和所述通信接口通过所述通信总线完成相互间的通信;
    所述存储器用于存放至少一种计算机可读执行指令,所述计算机可读执行指令使所述处理器执行实现图像边界的检测方法,包括:
    根据预置基准颜色,对待测图像进行均值化处理,生成均值化图像;将所述均值化图像进行二值化处理,生成边界图像;按照边缘检测算法,提取所述边界图像中物体的外轮廓图像;按照支持向量机SVM算法,判断所述外轮廓图像是否为目标图像;如果判断结果为是,则在所述待测图像中标记所述外轮廓图像的外轮廓像素点。
  19. 如权利要求18所述的计算机设备,其特征在于,所述计算机可读执行指令使所述处理器执行实现所述根据预置基准颜色,对待测图像进行均值化处理,生成均值化图像,包括:
    根据预置基准颜色,建立单色通道,所述单色通道包括红色通道、绿色通道和蓝色通道;分别获取所述待测图像经过所述红色通道、所述绿色通道和所述蓝色通道的单色图像;将所述单色图像进行均值化处理,生成单色均值化图像;合并所述单色均值化图像,生成所述均值化图像。
  20. 如权利要求19所述的计算机设备,其特征在于,所述计算机可读执行指令使所述处理器执行实现所述将所述单色图像进行均值化处理,生成单色均值化图像,包括:
    计算所述单色图像的像素在各灰度级中的分布概率p(i),p(i)=n i/n,i∈(0,1,…L-1),其中i 为图像的灰度级个数,p(i)为第i个灰度级的分布概率,n i为所述待测图像中属于第i个灰度级的像素点个数,n为所述待测图像的像素点的总数,L为正整数且最大值为256;计算所述分布概率的累计概率c(j),所述计算累计概率的累计概率函数为
    Figure PCTCN2019118348-appb-100004
    将预置像素范围值与所述累计概率c(j)做乘积运算,生成所述单色均值图像。
PCT/CN2019/118348 2019-06-20 2019-11-14 一种图像边界的检测方法及装置 WO2020253062A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910534900.7A CN110414333A (zh) 2019-06-20 2019-06-20 一种图像边界的检测方法及装置
CN201910534900.7 2019-06-20

Publications (1)

Publication Number Publication Date
WO2020253062A1 true WO2020253062A1 (zh) 2020-12-24

Family

ID=68359390

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/118348 WO2020253062A1 (zh) 2019-06-20 2019-11-14 一种图像边界的检测方法及装置

Country Status (2)

Country Link
CN (1) CN110414333A (zh)
WO (1) WO2020253062A1 (zh)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113197571A (zh) * 2021-05-07 2021-08-03 广州晓康医疗科技有限公司 一种基于雷达的步态训练评估方法及其装置
CN113518182A (zh) * 2021-06-30 2021-10-19 天津市农业科学院 一种基于树莓派的黄瓜表型特征测量方法
CN113781510A (zh) * 2021-09-15 2021-12-10 上海金仕达软件科技有限公司 边缘检测方法、装置及电子设备
CN116433700A (zh) * 2023-06-13 2023-07-14 山东金润源法兰机械有限公司 一种法兰零件轮廓视觉定位方法
CN116433701A (zh) * 2023-06-15 2023-07-14 武汉中观自动化科技有限公司 一种工件孔洞轮廓的提取方法、装置、设备及存储介质

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110414333A (zh) * 2019-06-20 2019-11-05 平安科技(深圳)有限公司 一种图像边界的检测方法及装置
CN110992355B (zh) * 2019-12-17 2023-03-14 华南农业大学 一种柔性作物过敏图像边界界定方法及系统
CN111192314B (zh) * 2019-12-25 2024-02-20 新绎健康科技有限公司 一种确定gdv能量图像中手指的内外轮廓比率的方法及系统
CN112465850A (zh) * 2020-12-08 2021-03-09 中国科学院计算技术研究所数字经济产业研究院 外围边界建模方法、智能监控方法及装置
CN113126132B (zh) * 2021-04-09 2022-11-25 内蒙古科电数据服务有限公司 一种移动巡检中轨迹校准与分析方法及系统
CN114529545B (zh) * 2022-04-22 2022-07-12 天津理工大学 一种基于无人机的道路缺陷自动检测方法及系统

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103177259A (zh) * 2013-04-11 2013-06-26 中国科学院深圳先进技术研究院 色块识别方法及装置
EP2709063A1 (en) * 2012-09-13 2014-03-19 Omron Corporation Image processing device, computer-readable recording medium, and image processing method
CN106407909A (zh) * 2016-08-31 2017-02-15 北京云图微动科技有限公司 人脸识别方法、装置及系统
CN108288024A (zh) * 2017-12-20 2018-07-17 深圳和而泰数据资源与云技术有限公司 人脸识别方法及装置
CN108647634A (zh) * 2018-05-09 2018-10-12 深圳壹账通智能科技有限公司 图像边框查找方法、装置、计算机设备及存储介质
CN110414333A (zh) * 2019-06-20 2019-11-05 平安科技(深圳)有限公司 一种图像边界的检测方法及装置

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102903089B (zh) * 2012-09-07 2014-12-17 山东大学 一种Linux环境下生成遥感图像快视图的方法
CN108564124A (zh) * 2018-04-13 2018-09-21 山东农业大学 一种基于支持向量机的稻瘟病菌孢子显微图像检测识别方法

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2709063A1 (en) * 2012-09-13 2014-03-19 Omron Corporation Image processing device, computer-readable recording medium, and image processing method
CN103177259A (zh) * 2013-04-11 2013-06-26 中国科学院深圳先进技术研究院 色块识别方法及装置
CN106407909A (zh) * 2016-08-31 2017-02-15 北京云图微动科技有限公司 人脸识别方法、装置及系统
CN108288024A (zh) * 2017-12-20 2018-07-17 深圳和而泰数据资源与云技术有限公司 人脸识别方法及装置
CN108647634A (zh) * 2018-05-09 2018-10-12 深圳壹账通智能科技有限公司 图像边框查找方法、装置、计算机设备及存储介质
CN110414333A (zh) * 2019-06-20 2019-11-05 平安科技(深圳)有限公司 一种图像边界的检测方法及装置

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113197571A (zh) * 2021-05-07 2021-08-03 广州晓康医疗科技有限公司 一种基于雷达的步态训练评估方法及其装置
CN113518182A (zh) * 2021-06-30 2021-10-19 天津市农业科学院 一种基于树莓派的黄瓜表型特征测量方法
CN113518182B (zh) * 2021-06-30 2022-11-25 天津市农业科学院 一种基于树莓派的黄瓜表型特征测量方法
CN113781510A (zh) * 2021-09-15 2021-12-10 上海金仕达软件科技有限公司 边缘检测方法、装置及电子设备
CN116433700A (zh) * 2023-06-13 2023-07-14 山东金润源法兰机械有限公司 一种法兰零件轮廓视觉定位方法
CN116433700B (zh) * 2023-06-13 2023-08-18 山东金润源法兰机械有限公司 一种法兰零件轮廓视觉定位方法
CN116433701A (zh) * 2023-06-15 2023-07-14 武汉中观自动化科技有限公司 一种工件孔洞轮廓的提取方法、装置、设备及存储介质
CN116433701B (zh) * 2023-06-15 2023-10-10 武汉中观自动化科技有限公司 一种工件孔洞轮廓的提取方法、装置、设备及存储介质

Also Published As

Publication number Publication date
CN110414333A (zh) 2019-11-05

Similar Documents

Publication Publication Date Title
WO2020253062A1 (zh) 一种图像边界的检测方法及装置
US11188734B2 (en) Systems and methods for performing fingerprint based user authentication using imagery captured using mobile devices
Liu et al. Learning deep models for face anti-spoofing: Binary or auxiliary supervision
US11263432B2 (en) Systems and methods for performing fingerprint based user authentication using imagery captured using mobile devices
AU2017370720B2 (en) Systems and methods for performing fingerprint based user authentication using imagery captured using mobile devices
US20180165508A1 (en) Systems and methods for performing fingerprint based user authentication using imagery captured using mobile devices
CN110084135A (zh) 人脸识别方法、装置、计算机设备及存储介质
KR20170006355A (ko) 모션벡터 및 특징벡터 기반 위조 얼굴 검출 방법 및 장치
US10922399B2 (en) Authentication verification using soft biometric traits
CN110414330B (zh) 一种手掌图像的检测方法及装置
CN104091163A (zh) 一种消除遮挡影响的lbp人脸识别方法
Mantecon et al. Depth-based face recognition using local quantized patterns adapted for range data
JPWO2018078857A1 (ja) 視線推定装置、視線推定方法及びプログラム記録媒体
CN110008825A (zh) 掌纹识别方法、装置、计算机设备和存储介质
Memane et al. Red algorithm based iris recognition
CN116798077B (zh) 一种手掌照片检测方法
Pandey et al. Survey of different segmentation method for low quality fingerprint image
CN117576050A (zh) 图像检测方法和装置
Gupta et al. Face Detection by Skin Color and Feature Extractions
Shu et al. Gloved Finger Recognition by Curve Matching
CN110991345A (zh) 一种用于家庭看护系统的人脸识别方法及装置
Jiang et al. Accurate Human eye Positioning Based on the Geometrical Characteristics of eye and Brow

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19934294

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19934294

Country of ref document: EP

Kind code of ref document: A1