WO2024251010A1 - 图像处理方法、装置及电子设备 - Google Patents

图像处理方法、装置及电子设备 Download PDF

Info

Publication number
WO2024251010A1
WO2024251010A1 PCT/CN2024/096185 CN2024096185W WO2024251010A1 WO 2024251010 A1 WO2024251010 A1 WO 2024251010A1 CN 2024096185 W CN2024096185 W CN 2024096185W WO 2024251010 A1 WO2024251010 A1 WO 2024251010A1
Authority
WO
WIPO (PCT)
Prior art keywords
target image
key points
position classification
electronic device
classification vectors
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.)
Ceased
Application number
PCT/CN2024/096185
Other languages
English (en)
French (fr)
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 Zitiao Network Technology Co Ltd
Original Assignee
Beijing Zitiao Network 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 Zitiao Network Technology Co Ltd filed Critical Beijing Zitiao Network Technology Co Ltd
Publication of WO2024251010A1 publication Critical patent/WO2024251010A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • G06T7/73Determining position or orientation of objects or cameras using feature-based methods
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/0464Convolutional networks [CNN, ConvNet]
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/46Descriptors for shape, contour or point-related descriptors, e.g. scale invariant feature transform [SIFT] or bags of words [BoW]; Salient regional features
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/46Descriptors for shape, contour or point-related descriptors, e.g. scale invariant feature transform [SIFT] or bags of words [BoW]; Salient regional features
    • G06V10/462Salient features, e.g. scale invariant feature transforms [SIFT]
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/764Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/82Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20084Artificial neural networks [ANN]

Definitions

  • the embodiments of the present disclosure relate to the field of image processing technology, and in particular to an image processing method, device and electronic device.
  • Image key point detection technology is particularly important in the field of image recognition technology. Objects in an image can be identified based on the key points in the image.
  • the present disclosure provides an image processing method, the method comprising: acquiring a target image; performing feature extraction processing on the target image to obtain M feature images, the M feature images being feature images corresponding to M key points in the target image, and M being an integer greater than 0; determining, based on the M feature images, M first position classification vectors of the M key points in the horizontal coordinate of the target image, and M second position classification vectors in the vertical coordinate; determining the positions of the M key points in the target image based on the M first position classification vectors and the M second position classification vectors.
  • the present disclosure provides an image processing device, the image processing device comprising an acquisition module, a processing module, a first determination module and a second determination module, wherein: the acquisition module is used to acquire a target image; the processing module is used to perform feature extraction processing on the target image to obtain M feature images, the M feature images are feature images corresponding to M key points in the target image, and M is an integer greater than 0; The first determination module is used to determine, based on the M feature images, M first position classification vectors of the M key points in the horizontal coordinate and M second position classification vectors in the vertical coordinate of the target image; the second determination module is used to determine the positions of the M key points in the target image based on the M first position classification vectors and the M second position classification vectors.
  • an embodiment of the present disclosure provides an electronic device comprising: a processor and a memory; the memory stores computer execution instructions; the processor executes the computer execution instructions stored in the memory, so that the at least one processor executes the image processing method as described in the first aspect above and various possible aspects involved in the first aspect.
  • an embodiment of the present disclosure provides a computer-readable storage medium, in which computer execution instructions are stored.
  • a processor executes the computer execution instructions, the image processing method as described in the first aspect and various possible aspects of the first aspect are implemented.
  • the present disclosure provides an image processing method, device and electronic device.
  • the electronic device can obtain a target image and perform feature extraction processing on the target image to obtain M feature images, wherein the M feature images are feature images corresponding to M key points in the target image, and M is an integer greater than 0.
  • M feature images are feature images corresponding to M key points in the target image, and M is an integer greater than 0.
  • M first position classification vectors in the horizontal coordinates of the M key points in the target image and M second position classification vectors in the vertical coordinates are determined.
  • the electronic device can determine the positions of the M key points in the target image according to the M first position classification vectors and the M second position classification vectors.
  • the electronic device can obtain the position classification vector of the horizontal coordinate of the key point in the target image and the position classification vector of the vertical coordinate of the key point in the target image based on the feature images corresponding to the key point, the electronic device can accurately determine the position of the key point in the target image, improve the accuracy of determining the position of the key point, and the electronic device does not need to generate a high-definition thermal map, reduce the calculation amount of the electronic device, and thus improve the efficiency of determining the key points in the target image.
  • FIG1 is a schematic diagram of determining key points in a related technology provided by an embodiment of the present disclosure
  • FIG2 is a schematic diagram of an application scenario provided by an embodiment of the present disclosure.
  • FIG3 is a schematic diagram of a flow chart of an image processing method provided by an embodiment of the present disclosure.
  • FIG4 is a schematic diagram of a process for determining M feature images provided by an embodiment of the present disclosure.
  • FIG5 is a schematic diagram of determining a position classification vector provided by an embodiment of the present disclosure.
  • FIG6 is a schematic diagram of determining a location distribution probability provided by an embodiment of the present disclosure.
  • FIG7 is a schematic diagram of a method for determining positions of M key points provided by an embodiment of the present disclosure
  • FIG8 is a schematic diagram of a process for determining a scale conversion vector provided by an embodiment of the present disclosure
  • FIG9 is a schematic diagram of a process of an image processing method provided by an embodiment of the present disclosure.
  • FIG10 is a schematic diagram of the structure of an image processing device provided by an embodiment of the present disclosure.
  • FIG. 11 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure.
  • the present disclosure provides an image processing method, device and electronic device for solving one or more technical problems in related technologies.
  • Electronic device a device with wireless transceiver function.
  • Electronic devices can be deployed on land, including indoors or outdoors, handheld, wearable or vehicle-mounted.
  • the electronic device can be a mobile phone, a tablet computer, a computer with wireless transceiver function, a virtual reality (VR) electronic device, an augmented reality (AR) electronic device, a wireless terminal in industrial control, a vehicle-mounted electronic device, a wireless terminal in self-driving, a wireless electronic device in remote medical, a wireless electronic device in smart grid, a wireless electronic device in transportation safety, a wireless electronic device in smart city, a wireless electronic device in smart home, a wearable electronic device, etc.
  • VR virtual reality
  • AR augmented reality
  • the electronic device involved in the embodiments of the present disclosure may also be referred to as a terminal, user equipment (UE), access electronic device, vehicle-mounted terminal, industrial control terminal, UE unit, UE station, mobile station, mobile station, remote station, remote electronic device, mobile device, UE electronic device, wireless communication device, UE agent or UE device, etc.
  • the electronic device may also be fixed or mobile.
  • FIG1 is a schematic diagram of determining key points in a related technology provided by an embodiment of the present disclosure.
  • the display page of the electronic device may include an image. If the electronic device performs key point extraction processing on the image, the electronic device can generate a thermal map corresponding to the image.
  • the thermal map may include multiple points with high thermal values, and the electronic device may determine the above multiple points with high thermal values as the key points corresponding to the image. In this way, the key points corresponding to the image can be intuitively obtained by means of a thermal map.
  • the electronic device can only locate the key point at a pixel at most based on the thermal map, resulting in low accuracy of the key points determined by the electronic device.
  • the electronic device needs to determine the key points based on the thermal values on the thermal map, if the resolution of the thermal map is low, the accuracy of multiple points with higher thermal values in the thermal map is poor. As a result, the electronic device cannot accurately locate the position of the key point based on the thermal values in the thermal map. If the resolution of the thermal map is high, the electronic device generates the thermal map slowly, which not only takes up more computing resources, but also results in low efficiency in determining the key points.
  • the scheme includes that an electronic device acquires a target image and performs feature extraction processing on the target image to obtain M feature images.
  • the M feature images are feature images corresponding to M key points in the target image.
  • the electronic device can process the M feature images according to the first fully connected layer to obtain M first position classification vectors of the M key points in the horizontal coordinate of the target image.
  • the M feature images are processed according to the second fully connected layer to obtain M second position classification vectors of the M key points in the vertical coordinate of the target image.
  • the M position distribution probabilities of the M key points in the target image are determined.
  • the electronic device can determine the positions of the M key points in the target image according to the M position distribution probabilities.
  • the electronic device since the electronic device can obtain the position of the key point in the target image based on the position classification vector of the key point, the electronic device does not need to render a high-resolution thermal map. Save the computing resources of the electronic device and improve the efficiency of determining the key point.
  • the electronic device can accurately calculate the specific position of the key point in the target image based on the position classification vector of the horizontal coordinate and the position classification vector of the vertical coordinate of the key point. This will improve the accuracy of determining the location of key points and improve the precision of key points.
  • FIG2 is a schematic diagram of an application scenario provided by an embodiment of the present disclosure.
  • the display screen of the electronic device may include image A, and image A may include an object. If the electronic device performs key point extraction processing on image A, the electronic device may generate the coordinates of 14 key points corresponding to image A. The electronic device may mark each key point in image A according to the coordinates of the 14 key points, and then obtain image B. Image B may include the object in image A, and image B also includes 14 key points. In this way, the electronic device can accurately determine information such as the object and the outline of the object in image B through 14 key points.
  • FIG. 2 is only an illustrative illustration of the application scenario of the embodiment of the present disclosure, and is not a limitation on the application scenario of the embodiment of the present disclosure.
  • FIG3 is a flow chart of an image processing method provided by an embodiment of the present disclosure. Referring to FIG3 , the method may include:
  • the execution subject of the embodiments of the present disclosure may be an electronic device, or an image processing device provided in the electronic device.
  • the image processing device may be implemented based on software, or may be implemented based on a combination of software and hardware, which is not limited in the embodiments of the present disclosure.
  • the electronic device may be any device with terminal computing capability, which is not limited in the embodiments of the present disclosure.
  • the target image may include an object.
  • the target image may include any object such as a limb, a face, a landscape, or a fruit, which is not limited in the embodiments of the present disclosure.
  • the target image may include a plurality of key points to be detected.
  • the key points may be feature points, corner points, or other points in the target image that can describe image features, which is not limited in the embodiments of the present disclosure.
  • the key points to be detected included in the target image are also different.
  • the electronic device can detect 30 key points related to the face image in the target image.
  • the electronic device can detect 63 key points related to the human body image in the target image.
  • the key points to be detected included in each type of target image can be predetermined key points.
  • the electronic device can predetermine that the face image can include 30 key points, and the electronic device can pre-set the face position indicated by each key point (such as the first key point can be located at the top of the head, the 30th key point can be located at the chin, etc.). In this way, when the electronic device detects the key points in the target image including the face image, the electronic device can obtain the 30 key points corresponding to the target image.
  • the electronic device can predetermine that the human body image can include 63 key points, and pre-set the human body position indicated by each key point (such as the 20th key point can be located at the left hand, the 40th key point can be located at the right hand, etc.).
  • the electronic device detects the key points in the target image including the human body image, the electronic device can obtain the 63 key points corresponding to the target image.
  • the electronic device can obtain the 63 key points corresponding to the target image.
  • 63 key points can get the outline of the human body in the target image.
  • the electronic device may receive a target image sent by another device.
  • the electronic device may receive a key point detection request sent by a server.
  • the electronic device may receive an image of at least one key point to be detected associated with the key point detection request sent by the server.
  • the electronic device may determine the image of at least one key point to be detected as the target image.
  • the electronic device may obtain a target image in a database.
  • a plurality of images of key points to be detected may be pre-stored in the database, and the electronic device may obtain the plurality of images of key points to be detected (i.e., target images) in the database.
  • a plurality of images of key points to be detected may be stored in the database, and each image of the key points to be detected may have a unique identifier.
  • the electronic device may receive a key point detection request, wherein the key point detection request may include identifiers of the plurality of images of key points to be detected.
  • the electronic device may obtain the image of the key points to be detected (i.e., target images) in the database based on the identifiers of the plurality of images of key points to be detected.
  • the electronic device may also acquire the target image based on any feasible implementation method, which is not limited in the embodiments of the present disclosure.
  • S302 Perform feature extraction processing on the target image to obtain M feature images.
  • the M feature images are feature images corresponding to the M key points in the target image, and M is an integer greater than 0. For example, if 30 key points can be detected in the target image, 30 feature images can be obtained by convolution processing the target image, and if 63 key points can be detected in the target image, 63 feature images can be obtained by convolution processing the target image.
  • the M feature images correspond to the M key points one by one.
  • the first key point to be detected in the target image can correspond to the first feature image
  • the second key point to be detected in the target image can correspond to the second feature image
  • each key point to be detected in the target image can be associated with a feature image, and the electronic device can determine the position of the key point to be detected in the target image based on the feature image.
  • the electronic device performs convolution processing on different types of target images (such as a target image including a face image and a target image including a limb image), the number of feature images obtained is also different.
  • the electronic device may process the target image based on a convolutional neural network to obtain M feature images.
  • the electronic device may perform convolution processing on the target image based on a convolutional neural network to obtain M feature images corresponding to the target image.
  • the electronic device may also obtain M feature images corresponding to the target image according to any feasible implementation method, which is not limited in the embodiments of the present disclosure.
  • FIG4 is a schematic diagram of a process for determining M feature images provided by an embodiment of the present disclosure.
  • the target image may include a human body image.
  • the convolutional neural network After the convolutional neural network receives the target image, it can extract the features in the target image, and then obtain feature image 1, feature image 2, ..., feature image 63. In this way, the electronic device can obtain 63 feature images corresponding to 63 key points in the target image based on the convolutional neural network.
  • the convolutional neural network may be a pre-trained neural network, and when the convolutional neural network is trained, the image types in the training samples are the same.
  • the training samples of the convolutional neural network may be sample images including human images, and the labels may be 63 key points of the human image.
  • the convolutional neural network may output 63 feature images, wherein the 63 feature images correspond one-to-one to the 63 key points of the human image.
  • the electronic device may determine the 63 key points of the human image based on the 63 feature images.
  • the first position classification vector may be a classification vector corresponding to the position of the horizontal coordinate of the key point on the width of the target image
  • the second position classification vector may be a classification vector corresponding to the position of the vertical coordinate of the key point on the height of the target image.
  • the first position classification vector and the second position classification vector may be one-dimensional vectors
  • the electronic device may classify the positions of the key points on the X-axis based on the one-dimensional first position classification vector
  • the electronic device may classify the positions of the key points on the Y-axis based on the one-dimensional second position classification vector.
  • the electronic device can determine the M key points according to the following feasible implementation method:
  • the M feature images are processed according to the second fully connected layer to obtain the M second position classification vectors. In this way, the image information included in the feature image can be integrated through the fully connected layer, thereby improving the accuracy of the first position classification vector and the second position classification vector.
  • the first fully connected layer is a fully connected layer for determining the first position classification vector of the key point in the horizontal and vertical coordinates of the target image
  • the second fully connected layer is a fully connected layer for determining the second position classification vector of the key point in the vertical coordinate of the target image. It should be noted that the first fully connected layer and the second fully connected layer are pre-trained fully connected layers, which is not limited in the embodiments of the present disclosure.
  • FIG5 is a schematic diagram of a vector for determining position classification provided by an embodiment of the present disclosure.
  • the electronic device (not shown in FIG5) can input the feature image corresponding to the key point to the first fully connected layer, and the first fully connected layer can output the first position classification vector of the key point in the horizontal coordinate of the target image.
  • the electronic device can input the feature image corresponding to the key point to the second fully connected layer, and the second fully connected layer can output the vector of the second position classification of the key point in the vertical coordinate of the target image.
  • the first position classification vector and the second position classification vector corresponding to the key point are one-dimensional vectors, and the length of the vector is related to the size of the target image. For example, if the width of the target image is W and the height is H, the length of the first position classification vector of the key point is W, and the length of the second position classification vector of the key point is H.
  • the electronic device can also scale the first position classification vector and the second position classification vector based on a preset scaling factor, thereby improving the accuracy of position classification. For example, if the first position classification vector corresponding to the key point is W and the second position classification vector is H, the electronic device can multiply W by the scaling factor to obtain a new first position classification vector. Multiply H by the scaling factor to obtain a new second position classification vector. If the scaling factor amplifies W and H, the accuracy of position classification of the key point is higher.
  • S304 Determine the positions of M key points in the target image according to the M first position classification vectors and the M second position classification vectors.
  • the electronic device may determine the positions of the M key points in the target image according to the following feasible implementation method: determine the M position distribution probabilities of the M key points in the target image according to the M first position classification vectors and the M second position classification vectors. Determine the positions of the M key points in the target image according to the M position distribution probabilities.
  • the position distribution probability may be the distribution probability of the position of the key point in the target image.
  • the position distribution probability may include the distribution probability of the key point in the horizontal coordinate and the distribution probability of the key point in the vertical coordinate.
  • the electronic device may determine the M position distribution probabilities of the M key points in the target image according to the following feasible implementation method: normalize the M first position classification vectors to obtain the M first distribution probabilities of the M key points in the horizontal coordinate of the target image. Normalize the M second position classification vectors to obtain the M second distribution probabilities of the M key points in the vertical coordinate of the target image.
  • the position distribution probability corresponding to the key point may include a first distribution probability and a second distribution probability of the key point.
  • the first distribution probability may be the distribution probability of the position of the horizontal coordinate of the key point in the target image
  • the second distribution probability may be the distribution probability of the position of the vertical coordinate of the key point in the target image.
  • the first distribution probability may include the probability of the key point appearing at each position in the horizontal axis of the target image
  • the second distribution probability may include the probability of the key point appearing at each position in the vertical axis of the target image.
  • the width of the target image is 200 pixels
  • the first distribution probability corresponding to the key point may include the probability of the key point appearing at the position of 200 pixels.
  • the second distribution probability corresponding to the key point may include the probability of the key point appearing at the position of 400 pixels.
  • the electronic device can normalize the first position classification vector corresponding to the key point based on the softmax method, and then obtain the first distribution probability corresponding to the key point.
  • the electronic device can normalize the second position classification vector corresponding to the key point based on the softmax method, and then obtain the second distribution probability corresponding to the key point.
  • the first distribution probability obtained after the first position classification vector is normalized can be (0, 0.2, 0.6, 0.2). That is, the probability of the horizontal coordinate of the key point at the position of the first pixel of the horizontal axis is 0, the probability of the position of the second pixel of the horizontal axis is 0.2, the probability of the position of the third pixel of the horizontal axis is 0.6, and the probability of the position of the fourth pixel of the horizontal axis is 0.2.
  • the second distribution probability obtained after the second position classification vector is normalized is similar to the first distribution probability, and the embodiments of the present disclosure will not be repeated here. In this way, the electronic device can convert the vector into a distribution probability by normalizing the first position classification vector and the second position classification vector. And all possible positions of the key point are determined by the distribution probability, thereby improving the accuracy of determining the position of the key point.
  • FIG6 is only an exemplary illustration of the size of the target image, and is not a limitation on the target image. Moreover, in the embodiment shown in FIG6, after the first position classification vector is normalized, a one-dimensional vector is obtained, and the sum of the values of the one-dimensional vector is 1. Similarly, after the second position classification vector is normalized, a one-dimensional vector is also obtained, and the sum of the values of the one-dimensional vector is 1.
  • the electronic device can determine the M coordinates of the M key points in the target image based on the M position distribution probabilities. Then, the positions of the M key points in the target image are determined by the M coordinates. For example, optionally, the electronic device can perform numerical coordinate regression processing on the positions of the M key points according to the M position distribution probabilities, and then the positions of the M key points in the target image can be obtained.
  • the present disclosure provides an image processing method, wherein an electronic device acquires a target image and The target image is subjected to feature extraction processing to obtain M feature images.
  • the electronic device can process the M feature images according to the first fully connected layer to obtain M first position classification vectors of the M key points in the horizontal coordinate of the target image.
  • the M feature images are processed according to the second fully connected layer to obtain M second position classification vectors of the M key points in the vertical coordinate of the target image.
  • the M position distribution probabilities are determined, and the electronic device can determine the positions of the M key points in the target image according to the M position distribution probabilities.
  • the electronic device can calculate the position coordinates of the key points in the target image based on the position distribution vectors of the key points in the target image, the accuracy of determining the position of the key points can be improved.
  • the electronic device does not need to generate a high-resolution thermal map, which reduces the amount of calculation of the electronic device, thereby improving the efficiency of determining the key points in the target image.
  • FIG7 is a schematic diagram of a method for determining the positions of M key points provided by an embodiment of the present disclosure. Referring to FIG7 , the method flow includes:
  • the value of the horizontal coordinate of each pixel after the scale conversion is within a preset range.
  • the preset range may be between (-1, 1)
  • the horizontal coordinate of each pixel after the scale conversion may be between (-1, 1)
  • the vertical coordinate of each pixel may also be between (-1, 1).
  • the electronic device may perform scale conversion on the horizontal coordinate of each pixel in the target image according to the following formula:
  • i is the horizontal coordinate of the pixel of the target image
  • n is the length of the first position classification vector
  • Xi is the first scale conversion vector
  • the range of i is 1, 2, ..., n.
  • the horizontal coordinates of the pixels of the target image are scaled based on the above formula, and the 5 scale-converted horizontal coordinates (i.e., the first scale-converted vector) can be -0.8, -0.4, 0, 0.4, and 0.8.
  • the computational complexity of determining the key point positions can be reduced and the efficiency of determining the key point positions can be improved.
  • the electronic device may also perform scale conversion on the horizontal coordinate of the target image based on any other feasible implementation manner, and the embodiments of the present disclosure are not limited to this.
  • S702 Perform a scale conversion on the ordinate of each pixel in the target image to obtain a second scale conversion vector.
  • the electronic device may perform scale conversion on the ordinate of each pixel in the target image according to the following formula:
  • j is the vertical coordinate of the pixel of the target image
  • m is the length of the second position classification vector
  • Y j is the second scale conversion vector
  • the range of j is 1, 2, ..., m.
  • the ordinates of the pixels of the target image are scaled based on the above formula, and the five scale-converted ordinates (i.e., the second scale-converted vectors) obtained can be -0.8, -0.4, 0, 0.4, and 0.8. This can reduce the computational complexity of determining the key point positions and improve the efficiency of determining the key point positions.
  • the electronic device may also perform scale conversion processing on the vertical coordinate of the target image based on any feasible implementation method, and the embodiments of the present disclosure are not limited to this.
  • FIG8 is a schematic diagram of a process for determining a scale conversion vector provided by an embodiment of the present disclosure.
  • a target image The width of the target image is 5 pixels, and the height of the target image is 5 pixels.
  • An electronic device (not shown in FIG8 ) can perform scale conversion on the target image to obtain a first scale conversion vector and a second scale conversion vector.
  • the range of the first scale conversion vector is [-0.8, 0.8] (i.e., the value range of the X coordinate after scale conversion)
  • the range of the second scale conversion vector is [-0.8, 0.8] (i.e., the value range of the Y coordinate after scale conversion).
  • S703 Determine positions of M key points in the target image according to the M position distribution probabilities, the first scale conversion vector, and the second scale conversion vector.
  • the electronic device can determine the positions of the M key points in the target image according to the following feasible implementation method:
  • the first scale conversion vector is multiplied by the first scale conversion vector to obtain M groups of first values.
  • the M second distribution probabilities among the M position distribution probabilities are multiplied by the second scale conversion vector to obtain M groups of second values.
  • the positions of the M key points in the target image are determined based on the M groups of first values and the M groups of second values.
  • the first numerical value may be a plurality of numerical values obtained by multiplying the first distribution probability by the first scale conversion vector. For example, since the first distribution probability and the first scale conversion vector have the same length (for example, both are 5 parameters), the number of numerical values included in a set of first numerical values corresponding to the key point may be the same as the length. For example, if the first distribution probability corresponding to the key point is 0, 0, 0.1, 0.7, 0.2, and the first scale conversion vector is -0.8, -0.4, 0, 0.4, 0.8, then the set of first numerical values may be 0 (0 ⁇ -0.8), 0 (0. ⁇ -0.4), 0 (0.1 ⁇ 0), 0.28 (0.7 ⁇ 0.4), 0.16 (0.2 ⁇ 0.8).
  • the second value may be a plurality of values obtained by multiplying the second distribution probability by the second scale conversion vector.
  • the second distribution probability and the second scale conversion vector have the same length (for example, both are 5 parameters)
  • the number of values included in a set of second values corresponding to the key point may be the same as the length.
  • the set of first values may be 0 (0 ⁇ -0.8), 0 (0. ⁇ -0.4), 0 (0.2 ⁇ 0), 0.24 (0.6 ⁇ 0.4), 0.16 (0.2 ⁇ 0.8).
  • the electronic device can determine the position of the key point in the target image not only based on the position with the highest probability in the position distribution probability, but also based on other positions where the key point may appear in the position distribution probability, thereby improving the accuracy and precision of determining the position of the key point.
  • the electronic device determines the positions of the M key points in the target image according to the M groups of first values and the M groups of second values. Specifically, for any key point, the sum of a group of first values corresponding to the key point and the sum of a group of second values corresponding to the key point are obtained. The horizontal coordinate of the key point in the target image is determined according to the sum of the group of first values. The vertical coordinate of the key point in the target image is determined according to the sum of the group of second values.
  • the electronic device can add multiple values in the set of first values and add multiple values in the set of second values, and then determine the position of the key point in the target image according to the sum of the set of first values and the sum of the set of second values.
  • the multiple values in the set of first values can be 0, 0, 0, 0.28, 0.16
  • the multiple values in the set of second values can be 0, 0, 0, 0.24, 0.16.
  • the sum of the set of first values is 0.44
  • the sum of the set of second values is 0.4. That is, the electronic device can determine that the horizontal coordinate corresponding to the key point is 0.44, and the vertical coordinate is 0.4. Then, based on the horizontal coordinate and the vertical coordinate, the position of the key point in the target image can be obtained.
  • the method can be implemented based on a key point detection model.
  • the electronic device can input a target image into a trained key point detection model, and the key point detection model can output the coordinates of the key points corresponding to the target image.
  • the electronic device may obtain a training data set of a key point detection model, wherein the training data set may include multiple sample images and M real position coordinates corresponding to the M key points included in each sample image.
  • the electronic device can process the sample image based on the key point detection model to obtain M sample feature images corresponding to the sample image. And according to the M sample feature images, determine the M sample first position classification vectors in the horizontal coordinate of the target image and the M sample second position classification vectors in the vertical coordinate of the M key points in the sample image;
  • the electronic device may determine the KL divergence loss based on the M sample first position classification vectors, the M sample second position classification vectors, and the M real position coordinates corresponding to the M key points of the sample image;
  • the electronic device may determine M predicted position coordinates corresponding to the M key points of the sample image based on the M sample first position classification vectors and the M sample second position classification vectors;
  • the electronic device can determine the numerical regression loss based on the M predicted position coordinates and the M real position coordinates corresponding to the M key points of the sample image (that is, the loss is determined based on the difference between the predicted position coordinates and the real position coordinates. For example, the square of the difference is used as the loss, etc., which is not limited to the embodiments of the present disclosure).
  • the electronic device may iteratively update the key point detection model based on the KL divergence loss and the numerical regression loss. For example, the electronic device may construct a loss function based on the weighted sum of the KL divergence loss and the numerical regression loss. And based on the loss function, the model parameters in the key point detection model are updated.
  • the above embodiment is only an exemplary loss function used in training the key point detection model, and is not a limitation on the type of loss function.
  • the electronic device can train the key point detection model based on any type of loss function, and the embodiments of the present disclosure do not limit this.
  • the disclosed embodiment provides a method for determining the positions of M key points.
  • the electronic device can scale the horizontal coordinate of each pixel in the target image to obtain a first scale conversion vector.
  • the vertical coordinate of each pixel in the target image is scaled to obtain a second scale conversion vector.
  • the positions of the M key points in the target image are determined based on the M position distribution probabilities, the first scale conversion vector and the second scale conversion vector.
  • the electronic device can not only combine the position probability distribution of the key points, but also determine the position of the key points in the target image based on the method of numerical coordinate regression, combined with all possible positions of the key points in the target image, thereby improving the accuracy of determining the position of the key points.
  • the electronic device does not need to render a high-definition thermal map, saving computing resources and improving the efficiency of determining the position of the key points.
  • FIG9 is a process diagram of an image processing method provided by an embodiment of the present disclosure. Please refer to FIG9, which includes: a target image, a convolutional neural network, a first fully connected layer, and a second fully connected layer.
  • An electronic device (not shown in FIG9) can input a target image into a convolutional neural network, and the target image can include a human body image.
  • the convolutional neural network can extract features of the target image to obtain feature image 1, feature image 2, ..., feature image 63.
  • the 63 feature images correspond one-to-one to the 63 key points to be detected in the target image.
  • the electronic device can process the 63 feature images based on the first fully connected layer, and can process the 63 feature images based on the second fully connected layer, to obtain the first position classification vector and the second position classification vector corresponding to each feature image.
  • the electronic device can normalize the first position classification vector and the second position classification vector corresponding to each feature image, and then obtain the position distribution probability corresponding to each feature image. That is, the electronic device can obtain position distribution probability 1, position distribution probability 2, ..., position distribution probability 63 based on feature image 1, feature image 2, ..., feature image 63.
  • the electronic device can distribute the position of the key point based on 63 position probabilities.
  • the electronic device can perform numerical coordinate regression processing on the target image.
  • the electronic device can scale the target image to obtain a first scale transformation vector and a second scale transformation vector. And multiply the first scale transformation vector based on the first distribution probability in the position distribution probability. Multiply the second scale transformation vector based on the second distribution probability in the position distribution probability, and then obtain the positions corresponding to the 63 key points.
  • the electronic device can accurately obtain the positions of the 63 key points in the target image, and there is no need to render a high-definition thermal map. Improve the efficiency of determining the positions of key points, and improve the accuracy and precision of determining the positions of key points.
  • FIG10 is a schematic diagram of the structure of an image processing device provided by an embodiment of the present disclosure.
  • the image processing device 100 may include an acquisition module 101, a processing module 102, a first determination module 103, and a second determination module 104, wherein:
  • the acquisition module 101 is used to acquire a target image
  • the processing module 102 is used to perform feature extraction processing on the target image to obtain M feature images, where the M feature images are feature images corresponding to M key points in the target image, and M is an integer greater than 0;
  • the first determination module 103 is used to determine, according to the M feature images, M first position classification vectors of the M key points in the horizontal coordinates of the target image and M second position classification vectors in the vertical coordinates;
  • the second determination module 104 is used to determine the positions of the M key points in the target image according to the M first position classification vectors and the M second position classification vectors.
  • the second determining module 104 is specifically configured to:
  • positions of the M key points are determined in the target image.
  • the second determining module 104 is specifically configured to:
  • the M second position classification vectors are normalized to obtain the M key M second distribution probabilities of a point in the ordinate of the target image; the position distribution probability corresponding to the key point includes the first distribution probability and the second distribution probability of the key point.
  • the second determining module 104 is specifically configured to:
  • the positions of the M key points in the target image are determined according to the M position distribution probabilities, the first scale conversion vector, and the second scale conversion vector.
  • the second determining module 104 is specifically configured to:
  • the positions of the M key points in the target image are determined according to the M groups of first values and the M groups of second values.
  • the second determining module 104 is specifically configured to:
  • the vertical coordinate of the key point in the target image is determined according to the sum of the group of second values.
  • the first determining module 103 is specifically configured to:
  • the M feature images are processed according to the second fully connected layer to obtain the M second position classification vectors.
  • the image processing device provided in the embodiment of the present disclosure may be used to execute the technical solution of the above method embodiment, and its implementation principle and technical effect are similar, which will not be described in detail in this embodiment.
  • FIG11 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure.
  • the electronic device 1100 may be an electronic device or a server.
  • the electronic device may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, personal digital assistants (PDAs), tablet computers (Portable Android Devices, PADs), portable multimedia players (Portable Media Players, PMPs), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc.
  • PDAs personal digital assistants
  • PMPs portable multimedia players
  • vehicle-mounted terminals such as vehicle-mounted navigation terminals
  • fixed terminals such as digital TVs, desktop computers, etc.
  • the electronic device shown in FIG11 is only an example and should not bring any limitations to the functions and scope of use of the embodiments of the present disclosure.
  • the electronic device 1100 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 1101, which may perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1102 or a program loaded from a storage device 1108 to a random access memory (RAM) 1103.
  • a processing device 1101 e.g., a central processing unit, a graphics processing unit, etc.
  • RAM random access memory
  • Various programs and data required for the operation of the electronic device 1100 are also stored in the RAM 1103.
  • the processing device 1101, the ROM 1102, and the RAM 1103 are connected to each other via a bus 1104.
  • An input/output (I/O) interface 1105 is also connected to the bus 1104.
  • the following devices may be connected to the I/O interface 1105: input devices 1106 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 1107 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 1108 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 1109.
  • the communication device 1109 may allow the electronic device 1100 to communicate wirelessly or wired with other devices to exchange data.
  • FIG. 11 shows an electronic device 1100 having various devices, it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or have alternatively.
  • an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer readable medium, the computer program including Program code for executing the method shown in the flowchart.
  • the computer program can be downloaded and installed from the network through the communication device 1109, or installed from the storage device 1108, or installed from the ROM 1102.
  • the processing device 1101 the above functions defined in the method of the embodiment of the present disclosure are executed.
  • the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two.
  • the computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above.
  • Computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
  • a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device.
  • a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried.
  • This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above.
  • the computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device.
  • the program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
  • the computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
  • the computer-readable medium carries one or more programs.
  • the electronic device executes the method shown in the above embodiment.
  • the present disclosure provides a computer-readable storage medium.
  • the medium stores computer-executable instructions.
  • the processor executes the computer-executable instructions, the image processing methods that may be involved in the above embodiments are implemented.
  • the embodiments of the present disclosure provide a computer program product, including a computer program.
  • the computer program is executed by a processor, the image processing method that may be involved in the above embodiments is implemented.
  • Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages.
  • the program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server.
  • the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
  • LAN Local Area Network
  • WAN Wide Area Network
  • each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function.
  • the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved.
  • each square box in the block diagram and/or flow chart, and the combination of the square boxes in the block diagram and/or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
  • the units involved in the embodiments described in the present disclosure may be implemented by software or hardware.
  • the name of a unit does not limit the unit itself in some cases.
  • the first acquisition unit may also be described as "acquiring at least Unit of two Internet Protocol addresses".
  • exemplary types of hardware logic components include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
  • FPGAs field programmable gate arrays
  • ASICs application specific integrated circuits
  • ASSPs application specific standard products
  • SOCs systems on chips
  • CPLDs complex programmable logic devices
  • a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment.
  • a machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium.
  • a machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing.
  • a more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
  • RAM random access memory
  • ROM read-only memory
  • EPROM or flash memory erasable programmable read-only memory
  • CD-ROM portable compact disk read-only memory
  • CD-ROM compact disk read-only memory
  • magnetic storage device or any suitable combination of the foregoing.
  • a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information.
  • the user can independently choose whether to provide personal information to the electronic device, application, server, storage medium or other software or hardware that performs the operation of the technical solution of the present disclosure based on the prompt message.
  • a prompt message is sent to the user in the form of a pop-up window, for example. In the pop-up window, the prompt information can be presented in text form.
  • the pop-up window can also carry a selection control for the user to choose "agree” or “disagree” to provide personal information to the electronic device. It can be understood that the above notification and the process of obtaining user authorization are only illustrative and do not limit the implementation of the present disclosure. Other methods that meet relevant laws and regulations can also be applied to the implementation of the present disclosure.
  • the data involved in this technical solution shall comply with the requirements of the relevant laws and regulations.
  • the data may include information, parameters and messages, such as flow switching indication information.
  • an image processing method comprising:
  • M feature images are feature images corresponding to M key points in the target image, and M is an integer greater than 0;
  • the positions of the M key points are determined in the target image according to the M first position classification vectors and the M second position classification vectors.
  • determining the positions of the M key points in the target image according to the M first position classification vectors and the M second position classification vectors includes:
  • positions of the M key points in the target image are determined.
  • determining the positions of the M key points in the target image according to the M first position classification vectors and the M second position classification vectors includes:
  • the M second position classification vectors are normalized to obtain M second distribution probabilities of the M key points in the vertical coordinates of the target image; the position distribution probabilities corresponding to the key points include the first distribution probabilities and the second distribution probabilities of the key points.
  • determining the positions of the M key points in the target image according to the M position distribution probabilities includes:
  • the positions of the M key points in the target image are determined according to the M position distribution probabilities, the first scale conversion vector, and the second scale conversion vector.
  • determining the positions of the M key points in the target image according to the M position distribution probabilities, the first scale conversion vector, and the second scale conversion vector includes:
  • the positions of the M key points in the target image are determined according to the M groups of first values and the M groups of second values.
  • determining the positions of the M key points in the target image according to the M groups of first values and the M groups of second values includes:
  • the vertical coordinate of the key point in the target image is determined according to the sum of the group of second values.
  • determining, based on the M feature images, M first position classification vectors of the M key points in the abscissa of the target image and M second position classification vectors in the ordinate includes:
  • the M feature images are processed according to the second fully connected layer to obtain the M second position classification vectors.
  • an embodiment of the present disclosure provides an image processing device, which may include an acquisition module, a processing module, a first determination module, and a second determination module, wherein:
  • the acquisition module is used to acquire a target image
  • the processing module is used to perform feature extraction processing on the target image to obtain M feature images, where the M feature images are feature images corresponding to M key points in the target image, and M is an integer greater than 0;
  • the first determination module is used to determine, according to the M feature images, M first position classification vectors of the M key points in the horizontal coordinates of the target image and M second position classification vectors in the vertical coordinates;
  • the second determination module is used to determine the positions of the M key points in the target image according to the M first position classification vectors and the M second position classification vectors.
  • the second determining module is specifically configured to:
  • positions of the M key points are determined in the target image.
  • the second determining module is specifically configured to:
  • the M second position classification vectors are normalized to obtain the M key M second distribution probabilities of a point in the ordinate of the target image; the position distribution probability corresponding to the key point includes the first distribution probability and the second distribution probability of the key point.
  • the second determining module is specifically configured to:
  • the positions of the M key points in the target image are determined according to the M position distribution probabilities, the first scale conversion vector, and the second scale conversion vector.
  • the second determining module is specifically configured to:
  • the positions of the M key points in the target image are determined according to the M groups of first values and the M groups of second values.
  • the second determining module is specifically configured to:
  • the vertical coordinate of the key point in the target image is determined according to the sum of the group of second values.
  • the first determining module is specifically configured to:
  • the M feature images are processed according to the second fully connected layer to obtain the M second position classification vectors.
  • an embodiment of the present disclosure provides an electronic device, comprising: a processor, and a memory and a transceiver communicatively connected to the processor;
  • the memory stores computer-executable instructions; the transceiver is used to send and receive data;
  • the processor executes the computer-executable instructions stored in the memory to implement the image processing method as described in the first aspect above.
  • an embodiment of the present disclosure provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer execution instructions, and when the computer execution instructions are executed by a processor, they are used to implement the image processing method described in the first aspect above.
  • an embodiment of the present disclosure provides a computer program product, including a computer program, which, when executed by a processor, implements the image processing method described in the first aspect above.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Evolutionary Computation (AREA)
  • Computing Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Software Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Multimedia (AREA)
  • Biomedical Technology (AREA)
  • General Engineering & Computer Science (AREA)
  • Molecular Biology (AREA)
  • Mathematical Physics (AREA)
  • Data Mining & Analysis (AREA)
  • Computational Linguistics (AREA)
  • Biophysics (AREA)
  • Databases & Information Systems (AREA)
  • Medical Informatics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Image Analysis (AREA)

Abstract

本公开提供一种图像处理方法、装置及电子设备,该方法包括:获取目标图像;对所述目标图像进行特征提取处理,得到M个特征图像,所述M个特征图像为所述目标图像中的M个关键点所对应的特征图像,所述M为大于0的整数;根据所述M个特征图像,确定所述M个关键点在所述目标图像的横坐标中的M个第一位置分类向量、以及纵坐标中的M个第二位置分类向量;根据所述M个第一位置分类向量和所述M个第二位置分类向量,在所述目标图像中确定所述M个关键点的位置。

Description

图像处理方法、装置及电子设备
本申请要求2023年6月5日递交的、标题为“图像处理方法、装置及电子设备”、申请号为2023106594534的中国发明专利申请的优先权,该申请的全部内容通过引用结合在本申请中。
技术领域
本公开实施例涉及图像处理技术领域,尤其涉及一种图像处理方法、装置及电子设备。
背景技术
图像关键点检测技术在图像识别技术领域中尤为重要,基于图像中的关键点可以对图像中的对象进行识别。
发明内容
第一方面,本公开提供一种图像处理方法,该方法包括:获取目标图像;对所述目标图像进行特征提取处理,得到M个特征图像,所述M个特征图像为所述目标图像中的M个关键点所对应的特征图像,所述M为大于0的整数;根据所述M个特征图像,确定所述M个关键点在所述目标图像的横坐标中的M个第一位置分类向量、以及纵坐标中的M个第二位置分类向量;根据所述M个第一位置分类向量和所述M个第二位置分类向量,在所述目标图像中确定所述M个关键点的位置。
第二方面,本公开提供一种图像处理装置,该图像处理装置包括获取模块、处理模块、第一确定模块和第二确定模块,其中:所述获取模块用于,获取目标图像;所述处理模块用于,对所述目标图像进行特征提取处理,得到M个特征图像,所述M个特征图像为所述目标图像中的M个关键点所对应的特征图像,所述M为大于0的整数; 所述第一确定模块用于,根据所述M个特征图像,确定所述M个关键点在所述目标图像的横坐标中的M个第一位置分类向量、以及纵坐标中的M个第二位置分类向量;所述第二确定模块用于,根据所述M个第一位置分类向量和所述M个第二位置分类向量,在所述目标图像中确定所述M个关键点的位置。
第三方面,本公开实施例提供一种电子设备包括:处理器和存储器;所述存储器存储计算机执行指令;所述处理器执行所述存储器存储的计算机执行指令,使得所述至少一个处理器执行如上第一方面以及第一方面各种可能涉及的所述图像处理方法。
第四方面,本公开实施例提供一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机执行指令,当处理器执行所述计算机执行指令时,实现如上第一方面以及第一方面各种可能涉及的所述图像处理方法。
本公开提供一种图像处理方法、装置及电子设备,电子设备可以获取目标图像,并对目标图像进行特征提取处理,得到M个特征图像,其中,M个特征图像为目标图像中的M个关键点所对应的特征图像,M为大于0的整数,根据M个特征图像,确定M个关键点在目标图像的横坐标中的M个第一位置分类向量、以及纵坐标中的M个第二位置分类向量,电子设备可以根据M个第一位置分类向量和M个第二位置分类向量,在目标图像中确定M个关键点的位置。在上述方法中,由于电子设备可以基于关键点对应的特征图像,得到关键点的横坐标在目标图像的位置分类向量、以及关键点的纵坐标在目标图像的位置分类向量,因此,电子设备可以准确的确定关键点在目标图像的位置,提高确定关键点位置的精度,并且,电子设备无需生成高清晰度的热力图,降低电子设备的计算量,进而提高确定目标图像中的关键点的效率。
附图说明
为了更清楚地说明本公开实施例或相关技术中的技术方案,下面 将对实施例或相关技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本公开的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1为本公开实施例提供的一种相关技术中的确定关键点的示意图;
图2为本公开实施例提供的一种应用场景示意图;
图3为本公开实施例提供的一种图像处理方法的流程示意图;
图4为本公开实施例提供的一种确定M个特征图像的过程示意图;
图5为本公开实施例提供的一种确定位置分类向量的示意图;
图6为本公开实施例提供的一种确定位置分布概率的示意图;
图7为本公开实施例提供的一种确定M个关键点位置的方法示意图;
图8为本公开实施例提供的一种确定尺度转换向量的过程示意图;
图9为本公开实施例提供的一种图像处理方法的过程示意图;
图10为本公开实施例提供的一种图像处理装置的结构示意图;
图11为本公开实施例提供的一种电子设备的结构示意图。
具体实施方式
本公开提供一种图像处理方法、装置及电子设备,用于解决相关技术中的一个或多个技术问题。
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本公开相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本公开的一些方面相一致的装置和方法的例子。
为了便于理解,下面,对本公开实施例涉及的概念进行说明。
电子设备:是一种具有无线收发功能的设备。电子设备可以部署在陆地上,包括室内或室外、手持、穿戴或车载。所述电子设备可以是手机(mobile phone)、平板电脑(Pad)、带无线收发功能的电脑、虚拟现实(virtual reality,VR)电子设备、增强现实(augmented reality,AR)电子设备、工业控制(industrial control)中的无线终端、车载电子设备、无人驾驶(self driving)中的无线终端、远程医疗(remote medical)中的无线电子设备、智能电网(smart grid)中的无线电子设备、运输安全(transportation safety)中的无线电子设备、智慧城市(smart city)中的无线电子设备、智慧家庭(smart home)中的无线电子设备、可穿戴电子设备等。本公开实施例所涉及的电子设备还可以称为终端、用户设备(user equipment,UE)、接入电子设备、车载终端、工业控制终端、UE单元、UE站、移动站、移动台、远方站、远程电子设备、移动设备、UE电子设备、无线通信设备、UE代理或UE装置等。电子设备也可以是固定的或者移动的。
下面结合图1对相关技术中确定关键点的方法进行说明。
图1为本公开实施例提供的一种相关技术中的确定关键点的示意图。请参见图1,包括电子设备。其中,电子设备的显示页面中可以包括图像。若电子设备对该图像进行关键点提取处理,则电子设备可以生成该图像对应的热力图。其中,热力图可以包括多个热力值较高的点,电子设备可以将上述多个热力值较高的点,确定为该图像对应的关键点。这样,可以通过热力图的方式直观的获取到图像对应的关键点。
但是,在图1所示的实施例中,电子设备基于热力图最高只能将关键点定位在一个像素的位置,导致电子设备确定的关键点的精度较低。并且,由于电子设备需要基于热力图上的热力值确定关键点,因此,若热力图的分辨率较低,则热力图中热力值较高的多个点的精度较差。导致电子设备基于热力图中的热力值无法准确的定位关键点的位置。若热力图的分辨率较高,则电子设备生成热力图的速度较慢,不仅占用较多的计算资源,还导致确定关键点的效率较低。
为了解决上述技术问题,本公开实施例提供一种图像处理方案。该 方案包括,电子设备获取目标图像,并对目标图像进行特征提取处理,得到M个特征图像。其中,M个特征图像为目标图像中的M个关键点所对应的特征图像。电子设备可以根据第一全连接层对M个特征图像进行处理,得到M个关键点在目标图像的横坐标中的M个第一位置分类向量。根据第二全连接层对M个特征图像进行处理,得到M个关键点在目标图像的纵坐标中的M个第二位置分类向量。根据M个第一位置分类向量和M个第二位置分类向量,确定M个关键点在目标图像中的M个位置分布概率。电子设备可以根据M个位置分布概率,在目标图像中确定M个关键点的位置。在上述方法中,由于电子设备可以基于关键点的位置分类向量,得到关键点在目标图像中的位置,因此,电子设备无需渲染分辨率较高的热力图。节约电子设备的计算资源,提高确定关键点的效率。并且,电子设备基于关键点的横坐标的位置分类向量和纵坐标的位置分类向量,可以精确的计算关键点在目标图像的具体位置。进而提高确定关键点位置的准确度,提高关键点的精度。
下面结合图2对本公开实施例的应用场景进行说明。
图2为本公开实施例提供的一种应用场景示意图。请参见图2,包括:电子设备。其中,电子设备的显示屏幕中可以包括图像A,图像A中可以包括对象。若电子设备对该图像A进行关键点提取处理,则电子设备可以生成该图像A对应的14个关键点的坐标。电子设备可以根据14个关键点的坐标在图像A中标记每个关键点,进而可以得到图像B。其中,图像B中可以包括图像A中的对象,并且,图像B中还包括14个关键点。这样,电子设备通过14个关键点,可以准确的确定图像B中的对象、对象的轮廓等信息。
需要说明的是,图2只是示例性的示意本公开实施例的应用场景,并非对本公开实施例的应用场景的限定。
下面以具体地实施例对本公开的技术方案以及本公开的技术方案如何解决上述技术问题进行详细说明。下面这几个具体的实施例可以相互结合,对于相同或相似的概念或过程可能在某些实施例中不再赘述。下面将结合附图,对本公开的实施例进行描述。
图3为本公开实施例提供的一种图像处理方法的流程示意图。请参见图3,该方法可以包括:
S301、获取目标图像。
本公开实施例的执行主体可以为电子设备,也可以为设置在电子设备中的图像处理装置。其中,图像处理装置可以基于软件实现,图像处理装置也可以基于软件和硬件的结合实现,本公开实施例对此不作限定。可选的,电子设备可以为任意具备端上计算能力的设备,本公开实施例对此不作限定。
其中,目标图像中可以包括对象。例如,目标图像中可以包括肢体、人脸、风景、水果等任意对象,本公开实施例对此不作限定。其中,目标图像中可以包括多个待检测的关键点。例如,关键点可以为目标图像中的特征点、角点等可以描述图像特征的点,本公开实施例对此不作限定。
可选的,目标图像的图像内容不同时,目标图像包括的待检测的关键点也不同。例如,若目标图像中包括人脸图像,则电子设备在该目标图像中可以检测到与人脸图像相关的30个关键点。若目标图像中包括人体图像,则电子设备在该目标图像中可以检测到与人体图像相关的63个关键点。
需要说明的是,每类目标图像中包括的待检测的关键点可以为预先确定的关键点。例如,在目标图像中包括人脸图像时,电子设备可以预先确定人脸图像中可以包括30个关键点,并且,电子设备可以预先设定每个关键点指示的人脸位置(如,第1个关键点可以位于头顶,第30个关键点可以位于下巴等)。这样,在电子设备对包括人脸图像的目标图像中的关键点进行检测时,电子设备可以得到目标图像对应的30个关键点。例如,在目标图像中包括人体图像时,电子设备可以预先确定人体图像可以包括63个关键点,并且,预先设置每个关键点指示的人体位置(如,第20个关键点可以位于左手,第40个关键点可以位于右手等)。这样,在电子设备对包括人体图像的目标图像中的关键点进行检测时,电子设备可以得到目标图像对应的63个关键点。并且,电子设备基于该 63个关键点可以得到目标图像中的人体的轮廓。
可选的,电子设备可以接收其它设备发送的目标图像。例如,电子设备可以接收服务器发送的关键点检测请求。并且,可以接收服务器发送的关键点检测请求相关联的至少一个待检测关键点的图像。电子设备可以将至少一个待检测关键点的图像确定为目标图像。
可选的,电子设备可以在数据库中获取目标图像。例如,数据库中可以预先存储多个待检测关键点的图像,电子设备可以在数据库中获取多个待检测关键点的图像(即,目标图像)。例如,数据库中可以存储多个待检测关键点的图像,并且每个待检测关键点的图像都具备唯一的标识。电子设备可以接收到关键点检测请求,其中,关键点检测请求中可以包括多个待检测关键点的图像的标识。电子设备可以基于多个待检测关键点的图像的标识,在数据库中获取待检测关键点的图像(即,目标图像)。
可选的,电子设备也可以基于任意可行的实现方式,获取目标图像,本公开实施例对此不作限定。
S302、对目标图像进行特征提取处理,得到M个特征图像。
其中,M个特征图像为目标图像中的M个关键点所对应的特征图像,M为大于0的整数。例如,若目标图像中可以检测到30个关键点,则对目标图像进行卷积处理可以得到30个特征图像,若目标图像中可以检测到63个关键点,则对目标图像进行卷积处理可以得到63个特征图像。
其中,M个特征图像与M个关键点一一对应。例如,目标图像中的第1个待检测的关键点可以与第1个特征图像对应,目标图像中的第2个待检测的关键点可以与第2个特征图像对应等。例如,目标图像中的每个待检测的关键点都可以与一个特征图像相关联,电子设备可以基于该特征图像,确定该待检测的关键点在目标图像中的位置。
需要说明的是,由于目标图像中包括的对象不同时,目标图像中的待检测的关键点的数量也不一样,因此,电子设备对不同类型的目标图像(如,包括人脸图像的目标图像和包括肢体图像的目标图像)进行卷积处理时,得到的特征图像的数量也不同。
可选的,电子设备可以基于卷积神经网络对目标图像进行处理,得到M个特征图像。例如,电子设备可以基于卷积神经网络对目标图像进行卷积处理,进而可以得到目标图像对应的M个特征图像。
可选的,电子设备也可以根据任意可行的实现方式,得到目标图像对应的M个特征图像,本公开实施例对此不作限定。
下面,结合图4,对确定M个特征图像的过程进行说明。
图4为本公开实施例提供的一种确定M个特征图像的过程示意图。请参见图4,包括:目标图像和卷积神经网络CNN。其中,目标图像中可以包括人体图像。卷积神经网络接收到目标图像之后,可以提取目标图像中的特征,进而可以得到特征图像1、特征图像2、......、特征图像63。这样,电子设备基于卷积神经网络可以得到与目标图像中的63个关键点相对应的63个特征图像。
需要说明的是,在图4所示的实施例中,卷积神经网络可以为预先训练好的神经网络,并且,在对卷积神经网络进行训练时,训练样本中的图像类型相同。例如,卷积神经网络的训练样本可以为包括人体图像的样本图像,并且标签可以为人体图像的63个关键点,这样,在卷积神经网络训练结束时,若卷积神经网络接收到的图像为包括人体的图像,则该卷积神经网络可以输出63个特征图像,其中,63个特征图像与人体图像的63个关键点一一对应。电子设备可以基于63个特征图像,确定该人体图像的63个关键点。
S303、根据M个特征图像,确定M个关键点在目标图像的横坐标中的M个第一位置分类向量、以及纵坐标中的M个第二位置分类向量。
其中,第一位置分类向量可以为关键点的横坐标的位置在目标图像的宽上对应的分类向量,第二位置分类向量可以为关键点的纵坐标的位置在目标图像的高上对应的分类向量。例如,第一位置分类向量和第二位置分类向量可以为一维的向量,电子设备基于该一维的第一位置分类向量可以对关键点在X轴上进行位置分类,电子设备基于该一维的第二位置分类向量可以对关键点在Y轴上进行位置分类。
其中,电子设备可以根据如下可行的实现方式,确定M个关键点在 目标图像的横坐标中的M个第一位置分类向量、以及纵坐标中的M个第二位置分类向量:根据第一全连接层对M个特征图像进行处理,得到M个第一位置分类向量。根据第二全连接层对M个特征图像进行处理,得到M个第二位置分类向量。这样,通过全连接层可以对特征图像中包括的图像信息进行整合,进而可以提高第一位置分类向量和第二位置分类向量的准确度。
其中,第一全连接层为确定关键点在目标图像的横纵标中的第一位置分类向量的全连接层,第二全连接层为确定关键点在目标图像的纵坐标中的第二位置分类向量的全连接层。需要说明的是,第一全连接层和第二全连接层为预先训练的全连接层,本公开实施例对此不作限定。
下面结合图5对确定关键点的位置分类向量的过程进行说明。
图5为本公开实施例提供的一种确定位置分类的向量的示意图。请参见图5,包括关键点对应的特征图像、第一全连接层和第二全连接层。其中,电子设备(图5未示出)可以向第一全连接层输入关键点对应的特征图像,第一全连接层可以输出关键点在目标图像的横坐标中的第一位置分类向量。电子设备可以向第二全连接层输入关键点对应的特征图像,第二全连接层可以输出关键点在目标图像的纵坐标中的第二位置分类的向量。
在图5所示的实施例中,关键点对应的第一位置分类向量和第二位置分类向量为一维的向量,并且向量的长度与目标图像的尺寸相关。例如,若目标图像的宽为W,高为H,则关键点的第一位置分类向量的长度为W,关键点的第二位置分类向量的长度为H。
可选的,在电子设备得到关键点对应的第一位置分类向量和第二位置分类向量之后,还可以基于预设的缩放因子,对第一位置分类向量和第二位置分类向量进行缩放处理,进而可以提高位置分类的准确度。例如,若关键点对应的第一位置分类向量为W,第二位置分类向量为H,则电子设备可以将W与缩放因子相乘,得到新的第一位置分类向量。将H与缩放因子相乘,得到新的第二位置分类向量。若缩放因子对W和H进行放大,则关键点进行位置分类的准确度较高。
S304、根据M个第一位置分类向量和M个第二位置分类向量,在目标图像中确定M个关键点的位置。
其中,电子设备可以根据如下可行的实现方式,确定M个关键点在目标图像中的位置:根据M个第一位置分类向量和M个第二位置分类向量,确定M个关键点在目标图像中的M个位置分布概率。根据M个位置分布概在目标图像中率,确定M个关键点的位置。
其中,位置分布概率可以为关键点的位置在目标图像中的分布概率。例如,位置分布概率可以包括关键点在横坐标的分布概率和关键点在纵坐标的分布概率。
其中,电子设备可以根据如下可行的实现方式,确定M个关键点在目标图像中的M个位置分布概率:对M个第一位置分类向量进行归一化处理,得到M个关键点在目标图像的横坐标中的M个第一分布概率。对M个第二位置分类向量进行归一化处理,得到M个关键点在目标图像的纵坐标中的M个第二分布概率。
其中,关键点对应的位置分布概率可以包括关键点的第一分布概率和第二分布概率。第一分布概率可以为关键点的横坐标的位置在目标图像中的分布概率,第二分布概率可以为关键点的纵坐标的位置在目标图像中的分布概率。例如,第一分布概率可以包括关键点在目标图像的横轴中的每个位置出现的概率,第二分布概率可以包括关键点在目标图像的纵轴中的每个位置出现的概率。例如,若目标图像的宽为200个像素,则关键点对应的第一分布概率可以包括该关键点在200个像素的位置出现的概率。若目标图像的宽为400个像素,则关键点对应的第二分布概率可以包括该关键点在400个像素的位置出现的概率。
例如,针对于任意一个关键点,电子设备可以基于softmax的方法对该关键点对应的第一位置分类向量进行归一化处理,进而可以得到关键点对应的第一分布概率。电子设备可以基于softmax的方法对该关键点对应的第二位置分类向量进行归一化处理,进而可以得到该关键点对应的第二分布概率。
下面结合图6对确定关键点对应的位置分布概率的过程进行说明。
图6为本公开实施例提供的一种确定位置分布概率的示意图。请参见图6,包括:关键点对应的特征图像、第一全连接层和第二全连接层。电子设备(图6未示出)可以向第一全连接层和第二全连接层输入关键点对应的特征图像。第一全连接层可以输出关键点对应的第一位置分类向量,第二全连接层可以输出关键点对应的第二位置分类向量。电子设备对第一位置分类向量进行归一化处理,可以得到关键点的横坐标在目标图像的第一分布概率。对第一位置分类向量进行归一化处理,可以得到关键点的纵坐标在目标图像的第二分布概率。
请参见图6,若目标图像的宽为4个像素,高为4个像素,则第一位置分类向量进行归一化处理之后,得到的第一分布概率可以为(0,0.2,0.6,0.2)。即,该关键点的横坐标在横轴的第1个像素所在的位置的概率为0,在横轴的第2个像素所在的位置的概率为0.2,在横轴的第3个像素所在的位置的概率为0.6,在横轴的第4个像素所在的概率为0.2。第二位置分类向量进行归一化处理之后得到的第二分布概率与第一分布概率相似,本公开实施例在此不再进行赘述。这样,电子设备通过对第一位置分类向量和第二位置分类向量进行归一化处理,可以将向量转换为分布概率。并通过分布概率确定关键点所有可能出现的位置,进而可以提高确定关键点位置的准确度。
需要说明的是,图6所示的实施例只是示例性的示意目标图像的尺寸,并非对目标图像的限定。并且,在图6所示的实施例中,对第一位置分类向量进行归一化之后,得到的是一维的向量,该一维的向量的数值和为1。同理,对第二位置分类向量进行归一化之后,得到的也是一维的向量,该一维的向量的数值和为1。
可选的,电子设备确定M个关键点对应的M个位置分布概率之后,可以基于M个位置分布概率,确定M个关键点在目标图像中的M个坐标。进而通过M个坐标,确定M个关键点在目标图像中的位置。例如,可选的,电子设备可以根据M个位置分布概率,对M个关键点的位置进行数值坐标回归处理,进而可以得到M个关键点在目标图像中的位置。
本公开实施例提供一种图像处理方法,电子设备获取目标图像,并 对目标图像进行特征提取处理,得到M个特征图像。电子设备可以根据第一全连接层对M个特征图像进行处理,得到M个关键点在目标图像的横坐标中的M个第一位置分类向量。根据第二全连接层对M个特征图像进行处理,得到M个关键点在目标图像的纵坐标中的M个第二位置分类向量。根据M个第一位置分类向量和M个第二位置分类向量,确定M个位置分布概率,电子设备可以根据M个位置分布概率,在目标图像中确定M个关键点的位置。在上述方法中,由于电子设备可以基于关键点在目标图像中的位置分布向量,计算关键点在目标图像中的位置坐标,进而可以提高确定关键点的位置的精度。并且,电子设备无需生成高分辨率的热力图,降低电子设备的计算量,进而提高确定目标图像中的关键点的效率。
在图2所示的实施例的基础上,下面,结合图7,对上述图像处理方法中,根据M个位置分布概率,在目标图像中确定M个关键点的位置的方法进行说明。
图7为本公开实施例提供的一种确定M个关键点位置的方法示意图。请参见图7,该方法流程包括:
S701、对目标图像中的每个像素的横坐标进行尺度转换,得到第一尺度转换向量。
可选的,其中,尺度转换后每个像素的横坐标的取值在预设范围内。例如,预设范围可以为(-1,1)之间,尺度转换后的每个像素的横坐标可以在(-1,1)之间,每个像素的纵坐标也可以在(-1,1)之间。
其中,电子设备可以根据如下公式,对目标图像中的每个像素的横坐标进行尺度转换:
其中,i为目标图像的像素的横坐标,n为第一位置分类向量的长度,Xi为第一尺度转换向量,i的范围为1、2、......、n。
这样,若第一位置分类向量的长度为5(n为5),基于上述公式对目标图像的像素的横坐标进行尺度转换处理,得到的5个尺度转换后的横坐标(即,第一尺度转换向量)可以为-0.8、-0.4、0、0.4、0.8。这样 可以降低确定关键点位置的计算复杂度,提高确定关键点位置的效率。
需要说明的是,电子设备也可以基于其它任意可行的实现方式,目标图像的横坐标进行尺度转换,本公开实施例对此不作限定。
S702、对目标图像中的每个像素的纵坐标进行尺度转换,得到第二尺度转换向量。
其中,电子设备可以根据如下公式,对目标图像中的每个像素的纵坐标进行尺度转换:
其中,j为目标图像的像素的纵坐标,m为第二位置分类向量的长度,Yj为第二尺度转换向量,j的范围为1、2、......、m。
这样,若第二位置分类向量的长度为5(n为5),基于上述公式对目标图像的像素的纵坐标进行尺度转换处理,得到的5个尺度转换后的纵坐标(即,第二尺度转换向量)可以为-0.8、-0.4、0、0.4、0.8。这样可以降低确定关键点位置的计算复杂度,提高确定关键点位置的效率。
需要说明的是,电子设备也可以基于任意可行的实现方式,对目标图像的纵坐标进行尺度转换处理,本公开实施例对此不作限定。
下面,结合图8,对电子设备得到第一尺度转换向量和第二尺度转换向量的过程进行说明。
图8为本公开实施例提供的一种确定尺度转换向量的过程示意图。请参见图8,包括:目标图像。其中,目标图像的宽为5个像素,目标图像的高为5个像素。电子设备(图8未示出)可以对目标图像进行尺度转换,得到第一尺度转换向量和第二尺度转换向量。其中,第一尺度转换向量的范围为[-0.8,0.8](即,尺度转换之后的X坐标的取值范围),第二尺度转换向量的取值范围为[-0.8,0.8](即,尺度转换之后的Y坐标的取值范围)。
S703、根据M个位置分布概率、第一尺度转换向量和第二尺度转换向量,确定M个关键点在所述目标图像中的位置。
其中,电子设备可以根据如下可行的实现方式,确定M个关键点在目标图像中的位置:将M个位置分布概率中的M个第一分布概率,与第 一尺度转换向量相乘,得到M组第一数值。将M个位置分布概率中的M个第二分布概率,与第二尺度转换向量相乘,得到M组第二数值。根据M组第一数值和M组第二数值,确定M个关键点在目标图像中的位置。
其中,第一数值可以为第一分布概率与第一尺度转换向量相乘之后,得到的多个数值。例如,由于第一分布概率和第一尺度转换向量的长度相同(例如,都为5个参数),因此,关键点对应的一组第一数值中包括的数值的数量可以与该长度相同。例如,若关键点对应的第一分布概率为0,0,0.1,0.7,0.2,第一尺度转换向量为-0.8、-0.4、0、0.4、0.8,则该组第一数值可以为0(0×-0.8),0(0.×-0.4),0(0.1×0),0.28(0.7×0.4),0.16(0.2×0.8)。
其中,第二数值可以为第二分布概率与第二尺度转换向量相乘之后,得到的多个数值。例如,由于第二分布概率和第二尺度转换向量的长度相同(例如,都为5个参数),因此,关键点对应的一组第二数值中包括的数值的数量可以与该长度相同。例如,若关键点对应的第二分布概率为0,0,0.2,0.6,0.2,第二尺度转换向量为-0.8、-0.4、0、0.4、0.8,则该组第一数值可以为0(0×-0.8),0(0.×-0.4),0(0.2×0),0.24(0.6×0.4),0.16(0.2×0.8)。
这样,电子设备不仅可以基于位置分布概率中的概率最大的位置、还可以基于位置分布概率中的其它可能出现关键点的位置,确定关键点在目标图像中的位置,进而可以提高确定关键点位置的准确度和精度。
可选的,电子设备根据M组第一数值和M组第二数值,确定M个关键点在目标图像中的位置,具体可以为:针对于任意一个关键点,获取关键点对应的一组第一数值的和、以及关键点对应的一组第二数值的和。根据一组第一数值的和,确定关键点在目标图像中的横坐标。根据一组第二数值的和,确定关键点在目标图像中的纵坐标。
其中,电子设备得到关键点对应的一组第一数值和一组第二数值之后,可以将一组第一数值中的多个数值相加,以及将一组第二数值中的多个数值相加,进而根据一组第一数值的和、以及一组第二数值的和,确定关键点在目标图像中的位置。例如,若关键点对应的一组第一数值 中的多个数值可以为0,0,0,0.28,0.16,一组第二数值中的多个数值可以为0,0,0,0.24,0.16。则一组第一数值的和为0.44,一组第二数值的和为0.4。即电子设备可以确定该关键点对应的横坐标为0.44,纵坐标为0.4。进而可以基于该横坐标和纵坐标,得到该关键点在目标图像中的位置。
可选的,在上述实施例中,该方法可以基于关键点检测模型实现,例如,电子设备可以向已训练好的关键点检测模型输入目标图像,关键点检测模型可以输出该目标图像对应的关键点的坐标。
下面,对关键点检测模型的训练过程进行说明。
电子设备可以获取关键点检测模型的训练数据集合,其中,训练数据集合中可以包括多个样本图像、以及每个样本图像中包括的M个关键点对应的M个真实位置坐标。
电子设备可以基于关键点检测模型对样本图像进行处理,得到样本图像对应的M个样本特征图像。并根据M个样本特征图像,确定样本图像中的M个关键点在目标图像的横坐标中的M个样本第一位置分类向量、以及纵坐标中的M个样本第二位置分类向量;
电子设备可以基于M个样本第一位置分类向量、M个样本第二位置分类向量、以及该样本图像的M个关键点对应的M个真实位置坐标,确定KL散度损失;
电子设备可以基于M个样本第一位置分类向量、M个样本第二位置分类向量,确定该样本图像的M个关键点对应的M个预测位置坐标;
电子设备可以基于M个预测位置坐标和该样本图像的M个关键点对应的M个真实位置坐标,确定数值回归损失(即,基于预测的位置坐标与真实位置坐标之间的差值,确定该损失。如,差值的平方作为该损失等,本公开实施例对此不作限定)。
电子设备可以基于KL散度损失和数值回归损失,对关键点检测模型进行迭代更新。例如,电子设备可以基于KL散度损失和数值回归损失的加权和,构造损失函数。并基于该损失函数,对关键点检测模型中的模型参数进行更新。
需要说明的是,上述实施例只是示例性的示意关键点检测模型训练时所使用的损失函数,并非对损失函数的类型的限定。在实际应用过程中,电子设备可以基于任意类别的损失函数,对关键点检测模型进行训练,本公开实施例对此不作限定。
本公开实施例提供一种确定M个关键点位置的方法,电子设备可以对目标图像中的每个像素的横坐标进行尺度转换,得到第一尺度转换向量。对目标图像中的每个像素的纵坐标进行尺度转换,得到第二尺度转换向量。对根据M个位置分布概率、第一尺度转换向量和第二尺度转换向量,确定M个关键点在目标图像中的位置。这样,电子设备不仅可以结合关键点的位置概率分布,还可以基于数值坐标回归的方法,结合关键点在目标图像中所有可能出现的位置,确定关键点在目标图像中的位置,进而可以提高确定关键点的位置的准确度。并且,电子设备无需渲染清晰度较高的热力图,节约计算资源,提高确定关键点的位置的效率。
在上述任意一个实施例的基础上,下面,结合图9,对上述图像处理方法的过程进行说明。
图9为本公开实施例提供的一种图像处理方法的过程示意图。请参见图9,包括:目标图像、卷积神经网络、第一全连接层和第二全连接层。电子设备(图9未示出)可以向卷积神经网络中输入目标图像,目标图像中可以包括人体图像。卷积神经网络可以提取目标图像的特征,得到特征图像1、特征图像2、......、特征图像63。其中,63个特征图像分别与目标图像中待检测的63个关键点一一对应。
请参见图9,电子设备可以基于第一全连接层分别对63个特征图像进行处理,以及基于第二全连接层分别对63个特征图像进行处理,得到每个特征图像对应的第一位置分类向量和第二位置分类向量。电子设备可以对每个特征图像对应的第一位置分类向量和第二位置分类向量分别进行归一化处理,进而可以得到每个特征图像对应的位置分布概率。即,电子设备基于特征图像1、特征图像2、......、特征图像63,可以得到位置分布概率1、位置分布概率2、......、位置分布概率63。
请参见图9,电子设备可以基于63个位置分布概率,对关键点的位 置进行数值坐标回归处理。其中,数据坐标回归处理的过程中,电子设备可以对目标图像进行尺度变换,得到第一尺度变换向量和第二尺度变换向量。并基于位置分布概率中的第一分布概率与第一尺度变换向量相乘。基于位置分布概率中的第二分布概率与第二尺度变换向量相乘,进而可以得到63个关键点对应的位置。这样,电子设备可以准确的得到目标图像中的63个关键点的位置,并且,无需渲染清晰度较高的热力图。提高确定关键点位置的效率,提高确定关键点位置的准确度和精度。
图10为本公开实施例提供的一种图像处理装置的结构示意图。请参见图10,该图像处理装置100可以包括获取模块101、处理模块102、第一确定模块103和第二确定模块104,其中:
所述获取模块101用于,获取目标图像;
所述处理模块102用于,对所述目标图像进行特征提取处理,得到M个特征图像,所述M个特征图像为所述目标图像中的M个关键点所对应的特征图像,所述M为大于0的整数;
所述第一确定模块103用于,根据所述M个特征图像,确定所述M个关键点在所述目标图像的横坐标中的M个第一位置分类向量、以及纵坐标中的M个第二位置分类向量;
所述第二确定模块104用于,根据所述M个第一位置分类向量和所述M个第二位置分类向量,在所述目标图像中确定所述M个关键点的位置。
根据本公开一个或多个实施例,所述第二确定模块104具体用于:
根据所述M个第一位置分类向量和所述M个第二位置分类向量,确定所述M个关键点在所述目标图像中的M个位置分布概率;
根据所述M个位置分布概率,在所述目标图像中确定所述M个关键点的位置。
根据本公开一个或多个实施例,所述第二确定模块104具体用于:
对所述M个第一位置分类向量进行归一化处理,得到所述M个关键点在所述目标图像的横坐标中的M个第一分布概率;
对所述M个第二位置分类向量进行归一化处理,得到所述M个关键 点在所述目标图像的纵坐标中的M个第二分布概率;所述关键点对应的位置分布概率包括所述关键点的第一分布概率和所述第二分布概率。
根据本公开一个或多个实施例,所述第二确定模块104具体用于:
对所述目标图像中的每个像素的横坐标进行尺度转换,得到第一尺度转换向量;
对所述目标图像中的每个像素的纵坐标进行尺度转换,得到第二尺度转换向量;
根据所述M个位置分布概率、所述第一尺度转换向量和所述第二尺度转换向量,确定所述M个关键点在所述目标图像中的位置。
根据本公开一个或多个实施例,所述第二确定模块104具体用于:
将所述M个位置分布概率中的M个第一分布概率,与所述第一尺度转换向量相乘,得到M组第一数值;
将所述M个位置分布概率中的M个第二分布概率,与所述第二尺度转换向量相乘,得到M组第二数值;
根据所述M组第一数值和所述M组第二数值,确定所述M个关键点在目标图像中的位置。
根据本公开一个或多个实施例,所述第二确定模块104具体用于:
针对于任意一个关键点;
获取所述关键点对应的一组第一数值的和、以及所述关键点对应的一组第二数值的和;
根据所述一组第一数值的和,确定所述关键点在所述目标图像中的横坐标;
根据所述一组第二数值的和,确定所述关键点在所述目标图像中的纵坐标。
根据本公开一个或多个实施例,所述第一确定模块103具体用于:
根据第一全连接层对所述M个特征图像进行处理,得到所述M个第一位置分类的向量;
根据第二全连接层对所述M个特征图像进行处理,得到所述M个第二位置分类的向量。
本公开实施例提供的图像处理装置,可用于执行上述方法实施例的技术方案,其实现原理和技术效果类似,本实施例此处不再赘述。
图11为本公开实施例提供的一种电子设备的结构示意图。请参见图11,其示出了适于用来实现本公开实施例的电子设备1100的结构示意图,该电子设备1100可以为电子设备或服务器。其中,电子设备可以包括但不限于诸如移动电话、笔记本电脑、数字广播接收器、个人数字助理(Personal Digital Assistant,简称PDA)、平板电脑(Portable Android Device,简称PAD)、便携式多媒体播放器(Portable Media Player,简称PMP)、车载终端(例如车载导航终端)等等的移动终端以及诸如数字TV、台式计算机等等的固定终端。图11示出的电子设备仅仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。
如图11所示,电子设备1100可以包括处理装置(例如中央处理器、图形处理器等)1101,其可以根据存储在只读存储器(Read Only Memory,简称ROM)1102中的程序或者从存储装置1108加载到随机访问存储器(Random Access Memory,简称RAM)1103中的程序而执行各种适当的动作和处理。在RAM 1103中,还存储有电子设备1100操作所需的各种程序和数据。处理装置1101、ROM 1102以及RAM 1103通过总线1104彼此相连。输入/输出(I/O)接口1105也连接至总线1104。
通常,以下装置可以连接至I/O接口1105:包括例如触摸屏、触摸板、键盘、鼠标、摄像头、麦克风、加速度计、陀螺仪等的输入装置1106;包括例如液晶显示器(Liquid Crystal Display,简称LCD)、扬声器、振动器等的输出装置1107;包括例如磁带、硬盘等的存储装置1108;以及通信装置1109。通信装置1109可以允许电子设备1100与其他设备进行无线或有线通信以交换数据。虽然图11示出了具有各种装置的电子设备1100,但是应理解的是,并不要求实施或具备所有示出的装置。可以替代地实施或具备更多或更少的装置。
特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在计算机可读介质上的计算机程序,该计算机程序包含 用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信装置1109从网络上被下载和安装,或者从存储装置1108被安装,或者从ROM 1102被安装。在该计算机程序被处理装置1101执行时,执行本公开实施例的方法中限定的上述功能。
需要说明的是,本公开上述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、RF(射频)等等,或者上述的任意合适的组合。
上述计算机可读介质可以是上述电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。
上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该电子设备执行时,使得该电子设备执行上述实施例所示的方法。
本公开实施例提供一种计算机可读存储介质,所述计算机可读存储 介质中存储有计算机执行指令,当处理器执行所述计算机执行指令时,实现如上述实施例中各种可能涉及的所述图像处理方法。
本公开实施例提供一种计算机程序产品,包括计算机程序,所述计算机程序被处理器执行时实现如上述实施例中各种可能涉及的所述图像处理方法。
可以以一种或多种程序设计语言或其组合来编写用于执行本公开的操作的计算机程序代码,上述程序设计语言包括面向对象的程序设计语言-诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言-诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(Local Area Network,简称LAN)或广域网(Wide Area Network,简称WAN)-连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。
附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
描述于本公开实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现。其中,单元的名称在某种情况下并不构成对该单元本身的限定,例如,第一获取单元还可以被描述为“获取至少 两个网际协议地址的单元”。
本文中以上描述的功能可以至少部分地由一个或多个硬件逻辑部件来执行。例如,非限制性地,可以使用的示范类型的硬件逻辑部件包括:现场可编程门阵列(FPGA)、专用集成电路(ASIC)、专用标准产品(ASSP)、片上系统(SOC)、复杂可编程逻辑设备(CPLD)等等。
在本公开的上下文中,机器可读介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。机器可读介质可以是机器可读信号介质或机器可读储存介质。机器可读介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。机器可读存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或快闪存储器)、光纤、便捷式紧凑盘只读存储器(CD-ROM)、光学储存设备、磁储存设备、或上述内容的任何合适组合。
需要注意,本公开中提及的“一个”、“多个”的修饰是示意性而非限制性的,本领域技术人员应当理解,除非在上下文另有明确指出,否则应该理解为“一个或多个”。
本公开实施方式中的多个装置之间所交互的消息或者信息的名称仅用于说明性的目的,而并不是用于对这些消息或信息的范围进行限制。
可以理解的是,在使用本公开各实施例公开的技术方案之前,均应当依据相关法律法规通过恰当的方式对本公开所涉及个人信息的类型、使用范围、使用场景等告知用户并获得用户的授权。
例如,在响应于接收到用户的主动请求时,向用户发送提示信息,以明确地提示用户,其请求执行的操作将需要获取和使用到用户的个人信息。从而,使得用户可以根据提示信息来自主地选择是否向执行本公开技术方案的操作的电子设备、应用程序、服务器或存储介质等软件或硬件提供个人信息。作为一种可选的但非限定性的实现方式,响应于接收到用户的主动请求,向用户发送提示信息的方式例如可以是弹窗的方 式,弹窗中可以以文字的方式呈现提示信息。此外,弹窗中还可以承载供用户选择“同意”或者“不同意”向电子设备提供个人信息的选择控件。可以理解的是,上述通知和获取用户授权过程仅是示意性的,不对本公开的实现方式构成限定,其它满足相关法律法规的方式也可应用于本公开的实现方式中。
可以理解的是,本技术方案所涉及的数据(包括但不限于数据本身、数据的获取或使用)应当遵循相应法律法规及相关规定的要求。数据可以包括信息、参数和消息等,如切流指示信息。
第一方面,根据本公开的一个或多个实施例,提供了一种图像处理方法,该方法包括:
获取目标图像;
对所述目标图像进行特征提取处理,得到M个特征图像,所述M个特征图像为所述目标图像中的M个关键点所对应的特征图像,所述M为大于0的整数;
根据所述M个特征图像,确定所述M个关键点在所述目标图像的横坐标中的M个第一位置分类向量、以及纵坐标中的M个第二位置分类向量;
根据所述M个第一位置分类向量和所述M个第二位置分类向量,在所述目标图像中确定所述M个关键点的位置。
根据本公开的一个或多个实施例,所述根据所述M个第一位置分类向量和所述M个第二位置分类向量,在所述目标图像中确定所述M个关键点的位置,包括:
根据所述M个第一位置分类向量和所述M个第二位置分类向量,确定所述M个关键点在所述目标图像中的M个位置分布概率;
根据所述M个位置分布概率,确定所述M个关键点在所述目标图像中的位置。
根据本公开的一个或多个实施例,所述根据所述M个第一位置分类向量和所述M个第二位置分类向量,在所述目标图像中确定所述M个关键点的位置,包括:
对所述M个第一位置分类向量进行归一化处理,得到所述M个关键点在所述目标图像的横坐标中的M个第一分布概率;
对所述M个第二位置分类向量进行归一化处理,得到所述M个关键点在所述目标图像的纵坐标中的M个第二分布概率;所述关键点对应的位置分布概率包括所述关键点的第一分布概率和所述第二分布概率。
根据本公开的一个或多个实施例,所述根据所述M个位置分布概率,在所述目标图像中确定所述M个关键点的位置,包括:
对所述目标图像中的每个像素的横坐标进行尺度转换,得到第一尺度转换向量;
对所述目标图像中的每个像素的纵坐标进行尺度转换,得到第二尺度转换向量;
根据所述M个位置分布概率、所述第一尺度转换向量和所述第二尺度转换向量,确定所述M个关键点在所述目标图像中的位置。
根据本公开的一个或多个实施例,所述根据所述M个位置分布概率、所述第一尺度转换向量和所述第二尺度转换向量,确定所述M个关键点在所述目标图像中的位置,包括:
将所述M个位置分布概率中的M个第一分布概率,与所述第一尺度转换向量相乘,得到M组第一数值;
将所述M个位置分布概率中的M个第二分布概率,与所述第二尺度转换向量相乘,得到M组第二数值;
根据所述M组第一数值和所述M组第二数值,确定所述M个关键点在目标图像中的位置。
根据本公开的一个或多个实施例,所述根据所述M组第一数值和所述M组第二数值,确定所述M个关键点在目标图像中的位置,包括:
针对于任意一个关键点;
获取所述关键点对应的一组第一数值的和、以及所述关键点对应的一组第二数值的和;
根据所述一组第一数值的和,确定所述关键点在所述目标图像中的横坐标;
根据所述一组第二数值的和,确定所述关键点在所述目标图像中的纵坐标。
根据本公开的一个或多个实施例,所述根据所述M个特征图像,确定所述M个关键点在所述目标图像的横坐标中的M个第一位置分类向量、以及纵坐标中的M个第二位置分类向量,包括:
根据第一全连接层对所述M个特征图像进行处理,得到所述M个第一位置分类的向量;
根据第二全连接层对所述M个特征图像进行处理,得到所述M个第二位置分类的向量。
第二方面,本公开实施例提供一种图像处理装置,该图像处理装置可以包括获取模块、处理模块、第一确定模块和第二确定模块,其中:
所述获取模块用于,获取目标图像;
所述处理模块用于,对所述目标图像进行特征提取处理,得到M个特征图像,所述M个特征图像为所述目标图像中的M个关键点所对应的特征图像,所述M为大于0的整数;
所述第一确定模块用于,根据所述M个特征图像,确定所述M个关键点在所述目标图像的横坐标中的M个第一位置分类向量、以及纵坐标中的M个第二位置分类向量;
所述第二确定模块用于,根据所述M个第一位置分类向量和所述M个第二位置分类向量,在所述目标图像中确定所述M个关键点的位置。
根据本公开一个或多个实施例,所述第二确定模块具体用于:
根据所述M个第一位置分类向量和所述M个第二位置分类向量,确定所述M个关键点在所述目标图像中的M个位置分布概率;
根据所述M个位置分布概率,在所述目标图像中确定所述M个关键点的位置。
根据本公开一个或多个实施例,所述第二确定模块具体用于:
对所述M个第一位置分类向量进行归一化处理,得到所述M个关键点在所述目标图像的横坐标中的M个第一分布概率;
对所述M个第二位置分类向量进行归一化处理,得到所述M个关键 点在所述目标图像的纵坐标中的M个第二分布概率;所述关键点对应的位置分布概率包括所述关键点的第一分布概率和所述第二分布概率。
根据本公开一个或多个实施例,所述第二确定模块具体用于:
对所述目标图像中的每个像素的横坐标进行尺度转换,得到第一尺度转换向量;
对所述目标图像中的每个像素的纵坐标进行尺度转换,得到第二尺度转换向量;
根据所述M个位置分布概率、所述第一尺度转换向量和所述第二尺度转换向量,确定所述M个关键点在所述目标图像中的位置。
根据本公开一个或多个实施例,所述第二确定模块具体用于:
将所述M个位置分布概率中的M个第一分布概率,与所述第一尺度转换向量相乘,得到M组第一数值;
将所述M个位置分布概率中的M个第二分布概率,与所述第二尺度转换向量相乘,得到M组第二数值;
根据所述M组第一数值和所述M组第二数值,确定所述M个关键点在目标图像中的位置。
根据本公开一个或多个实施例,所述第二确定模块具体用于:
针对于任意一个关键点;
获取所述关键点对应的一组第一数值的和、以及所述关键点对应的一组第二数值的和;
根据所述一组第一数值的和,确定所述关键点在所述目标图像中的横坐标;
根据所述一组第二数值的和,确定所述关键点在所述目标图像中的纵坐标。
根据本公开一个或多个实施例,所述第一确定模块具体用于:
根据第一全连接层对所述M个特征图像进行处理,得到所述M个第一位置分类的向量;
根据第二全连接层对所述M个特征图像进行处理,得到所述M个第二位置分类的向量。
第三方面,本公开实施例提供一种电子设备,包括:处理器,以及与所述处理器通信连接的存储器和收发器;
所述存储器存储计算机执行指令;所述收发器,用于收发数据;
所述处理器执行所述存储器存储的计算机执行指令,以实现如上述第一方面所述的图像处理方法。
第四方面,本公开实施例提供一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机执行指令,所述计算机执行指令被处理器执行时用于实现上述第一方面所述的图像处理方法。
第五方面,本公开实施例提供一种计算机程序产品,包括计算机程序,所述计算机程序被处理器执行时实现如上第一方面所述的图像处理方法。
以上描述仅为本公开的较佳实施例以及对所运用技术原理的说明。本领域技术人员应当理解,本公开中所涉及的公开范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离上述公开构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本公开中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。
此外,虽然采用特定次序描绘了各操作,但是这不应当理解为要求这些操作以所示出的特定次序或以顺序次序执行来执行。在一定环境下,多任务和并行处理可能是有利的。同样地,虽然在上面论述中包含了若干具体实现细节,但是这些不应当被解释为对本公开的范围的限制。在单独的实施例的上下文中描述的某些特征还可以组合地实现在单个实施例中。相反地,在单个实施例的上下文中描述的各种特征也可以单独地或以任何合适的子组合的方式实现在多个实施例中。
尽管已经采用特定于结构特征和/或方法逻辑动作的语言描述了本主题,但是应当理解所附权利要求书中所限定的主题未必局限于上面描述的特定特征或动作。相反,上面所描述的特定特征和动作仅仅是实现权利要求书的示例形式。

Claims (10)

  1. 一种图像处理方法,包括:
    获取目标图像;
    对所述目标图像进行特征提取处理,得到M个特征图像,所述M个特征图像为所述目标图像中的M个关键点所对应的特征图像,所述M为大于0的整数;
    根据所述M个特征图像,确定所述M个关键点在所述目标图像的横坐标中的M个第一位置分类向量、以及纵坐标中的M个第二位置分类向量;
    根据所述M个第一位置分类向量和所述M个第二位置分类向量,在所述目标图像中确定所述M个关键点的位置。
  2. 根据权利要求1所述的方法,其中所述根据所述M个第一位置分类向量和所述M个第二位置分类向量,在所述目标图像中确定所述M个关键点的位置,包括:
    根据所述M个第一位置分类向量和所述M个第二位置分类向量,确定所述M个关键点在所述目标图像中的M个位置分布概率;
    根据所述M个位置分布概率,在所述目标图像中确定所述M个关键点的位置。
  3. 根据权利要求2所述的方法,其中所述根据所述M个第一位置分类向量和所述M个第二位置分类向量,确定所述M个关键点在所述目标图像中的M个位置分布概率,包括:
    对所述M个第一位置分类向量进行归一化处理,得到所述M个关键点在所述目标图像的横坐标中的M个第一分布概率;
    对所述M个第二位置分类向量进行归一化处理,得到所述M个关键点在所述目标图像的纵坐标中的M个第二分布概率;所述关键点对应的位置分布概率包括所述关键点的第一分布概率和所述第二分布概率。
  4. 根据权利要求2或3所述的方法,其中所述根据所述M个位置分布概率,在所述目标图像中确定所述M个关键点的位置,包括:
    对所述目标图像中的每个像素的横坐标进行尺度转换,得到第一尺度转换向量;
    对所述目标图像中的每个像素的纵坐标进行尺度转换,得到第二尺度转换向量;
    根据所述M个位置分布概率、所述第一尺度转换向量和所述第二尺度转换向量,确定所述M个关键点在所述目标图像中的位置。
  5. 根据权利要求4所述的方法,其中所述根据所述M个位置分布概率、所述第一尺度转换向量和所述第二尺度转换向量,确定所述M个关键点在所述目标图像中的位置,包括:
    将所述M个位置分布概率中的M个第一分布概率,与所述第一尺度转换向量相乘,得到M组第一数值;
    将所述M个位置分布概率中的M个第二分布概率,与所述第二尺度转换向量相乘,得到M组第二数值;
    根据所述M组第一数值和所述M组第二数值,确定所述M个关键点在目标图像中的位置。
  6. 根据权利要求5所述的方法,其中所述根据所述M组第一数值和所述M组第二数值,确定所述M个关键点在目标图像中的位置,包括:
    针对于任意一个关键点;
    获取所述关键点对应的一组第一数值的和、以及所述关键点对应的一组第二数值的和;
    根据所述一组第一数值的和,确定所述关键点在所述目标图像中的横坐标;
    根据所述一组第二数值的和,确定所述关键点在所述目标图像中的纵坐标。
  7. 根据权利要求1-3任一项所述的方法,其中所述根据所述M个特征图像,确定所述M个关键点在所述目标图像的横坐标中的M个 第一位置分类向量、以及纵坐标中的M个第二位置分类向量,包括:
    根据第一全连接层对所述M个特征图像进行处理,得到所述M个第一位置分类的向量;
    根据第二全连接层对所述M个特征图像进行处理,得到所述M个第二位置分类的向量。
  8. 一种图像处理装置,包括获取模块、处理模块、第一确定模块和第二确定模块,其中:
    所述获取模块用于,获取目标图像;
    所述处理模块用于,对所述目标图像进行特征提取处理,得到M个特征图像,所述M个特征图像为所述目标图像中的M个关键点所对应的特征图像,所述M为大于0的整数;
    所述第一确定模块用于,根据所述M个特征图像,确定所述M个关键点在所述目标图像的横坐标中的M个第一位置分类向量、以及纵坐标中的M个第二位置分类向量;
    所述第二确定模块用于,根据所述M个第一位置分类向量和所述M个第二位置分类向量,在所述目标图像中确定所述M个关键点的位置。
  9. 一种电子设备,包括:处理器和存储器;
    所述存储器存储计算机执行指令;
    所述处理器执行所述存储器存储的计算机执行指令,使得所述处理器执行如权利要求1-7任一项所述的图像处理方法。
  10. 一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机执行指令,当处理器执行所述计算机执行指令时,实现如权利要求1-7任一项所述的图像处理方法。
PCT/CN2024/096185 2023-06-05 2024-05-29 图像处理方法、装置及电子设备 Ceased WO2024251010A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202310659453.4 2023-06-05
CN202310659453.4A CN119090953A (zh) 2023-06-05 2023-06-05 图像处理方法、装置及电子设备

Publications (1)

Publication Number Publication Date
WO2024251010A1 true WO2024251010A1 (zh) 2024-12-12

Family

ID=93699977

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2024/096185 Ceased WO2024251010A1 (zh) 2023-06-05 2024-05-29 图像处理方法、装置及电子设备

Country Status (2)

Country Link
CN (1) CN119090953A (zh)
WO (1) WO2024251010A1 (zh)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020114236A1 (zh) * 2018-12-05 2020-06-11 北京达佳互联信息技术有限公司 关键点检测方法、装置、电子设备及存储介质
CN112464809A (zh) * 2020-11-26 2021-03-09 北京奇艺世纪科技有限公司 一种人脸关键点检测方法、装置、电子设备及存储介质
CN113838134A (zh) * 2021-09-26 2021-12-24 广州博冠信息科技有限公司 图像关键点检测方法、装置、终端和存储介质
CN113920328A (zh) * 2021-07-06 2022-01-11 北京旷视科技有限公司 一种关键点检测方法、装置、设备及介质

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020114236A1 (zh) * 2018-12-05 2020-06-11 北京达佳互联信息技术有限公司 关键点检测方法、装置、电子设备及存储介质
CN112464809A (zh) * 2020-11-26 2021-03-09 北京奇艺世纪科技有限公司 一种人脸关键点检测方法、装置、电子设备及存储介质
CN113920328A (zh) * 2021-07-06 2022-01-11 北京旷视科技有限公司 一种关键点检测方法、装置、设备及介质
CN113838134A (zh) * 2021-09-26 2021-12-24 广州博冠信息科技有限公司 图像关键点检测方法、装置、终端和存储介质

Also Published As

Publication number Publication date
CN119090953A (zh) 2024-12-06

Similar Documents

Publication Publication Date Title
CN111860300B (zh) 一种关键点检测方法、装置、终端设备及存储介质
CN112418232B (zh) 图像分割方法、装置、可读介质及电子设备
CN114742934B (zh) 图像渲染方法、装置、可读介质及电子设备
US12367564B2 (en) Image processing method, device, and medium
US20250095314A1 (en) Virtual object generation method and apparatus, device, and storage medium
CN112712036A (zh) 交通标志识别方法、装置、电子设备及计算机存储介质
CN112270242B (zh) 轨迹的显示方法、装置、可读介质和电子设备
CN114118079A (zh) 文本识别方法、装置、可读介质及电子设备
EP4538965A1 (en) Loop closure detection method and apparatus, and electronic device and medium
WO2024051639A1 (zh) 图像处理方法、装置、设备及存储介质和产品
CN113253874B (zh) 显示装置的控制方法、装置、终端和存储介质
WO2025152660A1 (zh) 一种媒体数据处理方法、装置、电子设备及存储介质
WO2025139826A1 (zh) 视频处理方法、装置、电子设备及存储介质
WO2025021169A1 (zh) 图像处理方法、设备、存储介质及程序产品
WO2024251010A1 (zh) 图像处理方法、装置及电子设备
WO2024149078A1 (zh) 一种支持多相机动态输入的感知方法、系统及车辆
US20240153110A1 (en) Target tracking method, apparatus, device and medium
CN110189279B (zh) 模型训练方法、装置、电子设备及存储介质
CN113808050B (zh) 3d点云的去噪方法、装置、设备及存储介质
CN110781888B (zh) 回归视频画面中屏幕的方法、装置、可读介质及电子设备
WO2024251089A1 (zh) 图像处理方法、装置及电子设备
WO2025020894A1 (zh) 图像处理方法、装置及终端设备
CN117906634A (zh) 一种设备检测方法、装置、设备及介质
WO2025139755A1 (zh) 视频处理方法、装置、介质和电子设备
CN118279403A (zh) 空间标定方法、装置和电子设备

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: 24818543

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: 24818543

Country of ref document: EP

Kind code of ref document: A1