WO2022156178A1 - 图像目标对比方法、装置、计算机设备及可读存储介质 - Google Patents

图像目标对比方法、装置、计算机设备及可读存储介质 Download PDF

Info

Publication number
WO2022156178A1
WO2022156178A1 PCT/CN2021/109284 CN2021109284W WO2022156178A1 WO 2022156178 A1 WO2022156178 A1 WO 2022156178A1 CN 2021109284 W CN2021109284 W CN 2021109284W WO 2022156178 A1 WO2022156178 A1 WO 2022156178A1
Authority
WO
WIPO (PCT)
Prior art keywords
standard
target
contrast
operation image
image
Prior art date
Application number
PCT/CN2021/109284
Other languages
English (en)
French (fr)
Inventor
王家桢
Original Assignee
深圳壹账通智能科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳壹账通智能科技有限公司 filed Critical 深圳壹账通智能科技有限公司
Publication of WO2022156178A1 publication Critical patent/WO2022156178A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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/74Image or video pattern matching; Proximity measures in feature spaces
    • G06V10/75Organisation of the matching processes, e.g. simultaneous or sequential comparisons of image or video features; Coarse-fine approaches, e.g. multi-scale approaches; using context analysis; Selection of dictionaries
    • G06V10/752Contour matching
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/44Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/56Extraction of image or video features relating to colour

Definitions

  • the present application relates to the technical field of artificial intelligence, and in particular, to an image target comparison method, device, computer equipment and readable storage medium, which are applied in the field of computer vision technology of artificial intelligence.
  • the financial leasing company needs to verify the business situation of its customers, and the official seal needs to be verified for the information provided by the customer;
  • the purpose of this application is to provide an image target comparison method, device, computer equipment and readable storage medium, which are used to solve the task of comparing and identifying targets in manually processed images in the prior art, which makes it difficult to accurately compare the targets.
  • the efficiency of comparison and comparison identification is very low.
  • the present application provides a kind of image target comparison method, including:
  • the difference between the standard contour and the comparison contour is compared, and whether the standard target and the comparison target are the same is determined according to the difference.
  • an image target comparison device comprising:
  • Input module for obtaining standard images and comparison images
  • a cropping module used for cropping the area where the standard target is displayed in the standard image to form a standard operation image, and cropping the area where the comparison target is displayed in the comparison image to obtain a comparison operation image
  • a target extraction module for extracting the standard target in the standard operation image, and extracting the contrast target in the contrast operation image
  • a contour extraction module for obtaining the standard contour of the standard target and the contrast contour of the contrast target
  • a target comparison module configured to compare the difference between the standard profile and the comparison profile, and determine whether the standard target and the comparison target are the same according to the difference.
  • the present application also provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and running on the processor, which is implemented when the processor of the computer device executes the computer program.
  • a computer device which includes a memory, a processor, and a computer program stored in the memory and running on the processor, which is implemented when the processor of the computer device executes the computer program.
  • the present application also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program stored in the readable storage medium is executed by a processor, the above-mentioned image target is realized Contrast method steps.
  • the image target comparison method, device, computer equipment and readable storage medium provided by the present application, by comparing the standard contour of the standard target in the standard image and the difference between the contrast contour of the contrast target in the contrast image, to determine whether the standard target and the contrast target are In the same way, it can accurately and efficiently identify whether the standard target and the comparison target are consistent, which not only improves the accuracy of the comparison between the standard target and the comparison target, such as the comparison between the standard official seal and the comparison official seal, but also improves the standard The efficiency of the alignment between the target and the comparison target.
  • Fig. 1 is the flow chart of the first embodiment of the image target comparison method of the present application
  • FIG. 2 is a schematic diagram of the environmental application of the image target comparison method in Embodiment 2 of the image target comparison method of the present application;
  • Fig. 3 is the specific method flow chart of the image target comparison method in the second embodiment of the image target comparison method of the present application;
  • FIG. 4 is a schematic diagram of a program module of Embodiment 3 of the image target comparison apparatus of the present application.
  • FIG. 5 is a schematic diagram of a hardware structure of a computer device in Embodiment 4 of the computer device of the present application.
  • the image target comparison method, device, computer equipment and readable storage medium provided by this application are suitable for the field of artificial intelligence image detection technology, and provide a method based on input module, cropping module, target extraction module, contour extraction module, target comparison The module's image target comparison method.
  • a standard operation image is formed by cropping the area in which the standard target is displayed in the standard image
  • a contrast operation image is obtained by cropping the area in which the contrast target is displayed in the contrast image
  • the standard target in the standard operation image is extracted, and the Compare the target; obtain the standard contour of the standard target, and the contrast contour of the contrast target; compare the difference between the standard contour and the contrast contour, and judge whether the standard target and the contrast target are the same according to the difference.
  • an image target comparison method of the present embodiment includes:
  • S101 Acquire a standard image and a comparison image.
  • S102 Crop a region in the standard image where the standard target is displayed to form a standard operation image, and crop an area in the comparison image where the comparison target is displayed to obtain a comparison operation image.
  • S105 Extract the standard target in the standard operation image, and extract the contrast target in the contrast operation image.
  • S107 Compare the difference between the standard profile and the comparison profile, and determine whether the standard target and the comparison target are the same according to the difference.
  • the standard image is picture information showing a standard target, for example: a legal scanned version of the contract with a certified official seal, wherein the official seal is the standard target, and the legal scanned version of the contract is The standard image;
  • the comparison image is the image information showing the comparison target, for example: a pending scanned version of the contract with an uncertified official seal, wherein the official seal is the comparison target, and the pending scanned version of the contract does not describe Compare images.
  • the standard anchor frame delineating the standard target is generated on the image
  • the standard anchor frame is the standard area
  • the comparison anchor frame of the comparison target is the comparison area.
  • the HSV color space intuitively expresses the hue, vividness and brightness of the color, including: H(Hue hue, Hue), S (Saturation: saturation, color purity), V (Value: lightness); adjust the pixels belonging to the preset color threshold in the standard operation image and the contrast operation image to a very low value, which does not belong to all
  • the pixel of the color threshold is adjusted to a very high value to highlight the color and brightness difference between the standard target and other pixels in the standard operation image except the standard target, and the contrast target and the The difference in color and brightness between other pixels in the comparison operation image except the comparison target.
  • Respectively summarize the pixels belonging to extremely low values in the standard operation image and the contrast operation image to obtain the standard target and the contrast target respectively, so as to achieve accurate and complete extraction of the standard target from the standard operation image and the contrast operation image and the technical effect of the contrast target.
  • the standard contour is the pixel point located at the edge position in the standard target
  • the contrast contour is the Compare the pixels at the edge of the target.
  • the spatial distance is obtained by obtaining the standard vector of each pixel in the standard contour and the contrast vector of each pixel in the contrast contour; calculating the Euclidean distance between the standard vectors of any two adjacent pixels in the standard contour And summarize to form a standard distance vector, calculate the Euclidean distance between the contrast vectors of any two adjacent pixels in the contrast contour to obtain a spatial distance and summarize to form a contrast distance vector; compare the standard distance vector and the contrast distance Euclidean distance or cosine similarity between vectors to obtain the difference between the standard contour and the contrast contour, and judge whether the standard target and the contrast target are the same according to the difference, so as to achieve accurate and efficient identification of the The technical effect of whether the standard target and the comparison target are consistent.
  • the present application not only improves the accuracy of the comparison between the standard target and the comparison target, such as the comparison between the standard official seal and the comparison official seal, but also improves the efficiency of the comparison between the standard target and the comparison target.
  • Embodiment 2 is a diagrammatic representation of Embodiment 1:
  • This embodiment is a specific application scenario of the above-mentioned Embodiment 1. Through this embodiment, the method provided in this application can be described more clearly and specifically.
  • FIG. 2 schematically shows a schematic diagram of an environmental application of the image target comparison method according to Embodiment 2 of the present application.
  • the server 2 where the image target comparison method is located is connected to the client 4 through a network 3 respectively; the server 2 may provide services through one or more networks 3, and the network 3 may include various network devices, such as Routers, switches, multiplexers, hubs, modems, bridges, repeaters, firewalls, proxy devices and/or etc.
  • the network 3 may include physical links such as coaxial cable links, twisted pair cable links, fiber optic links, combinations thereof, and/or the like.
  • the network 3 may include wireless links, such as cellular links, satellite links, Wi-Fi links and/or the like; the clients 4 may be computer devices such as smartphones, tablets, laptops, desktops, and the like.
  • FIG. 3 is a flowchart of a specific method of an image target comparison method provided by an embodiment of the present application, and the method specifically includes steps S201 to S207.
  • S201 Acquire a standard image and a comparison image.
  • the standard image and the comparison image are obtained by establishing a connection with the client, where the standard image is the picture information showing the standard target, for example: a legal scanned version of the contract with a certified official seal, wherein, The official seal is the standard target, and the legal scanned version of the contract is the standard image; the comparison image is the image information showing the comparison target, for example: a pending scanned version contract with an unauthenticated official seal, wherein the The official seal is the comparison target, and the comparison image is not described in the pending scanned version of the contract.
  • the standard image is the picture information showing the standard target, for example: a legal scanned version of the contract with a certified official seal, wherein, The official seal is the standard target, and the legal scanned version of the contract is the standard image
  • the comparison image is the image information showing the comparison target, for example: a pending scanned version contract with an unauthenticated official seal, wherein the The official seal is the comparison target, and the comparison image is not described in the pending scanned version of the contract
  • S202 Crop an area in the standard image where the standard target is displayed to form a standard operation image, and crop the area in the comparison image where the comparison target is displayed to obtain a comparison operation image.
  • the standard target and the comparison target can be compared separately, so as to avoid the standard image and the comparison image from interfering with subsequent comparison operations; this The step is to identify the standard area in which the standard target is displayed in the standard image, and the contrast area in which the contrast target is displayed in the comparison image by the image target recognition module.
  • the image target recognition module is The image recognition is realized by comparing the stored information with the current information, wherein a neural network model such as Faster R-CNN, Mask R-CNN, or RFCN can be used as the image target recognition module; the image target recognition When the module recognizes the standard target in the standard image, it will generate a standard anchor frame delineating the standard target on the standard image, and the standard anchor frame is the standard area; When the comparison target in the comparison image is selected, a comparison anchor frame delimiting the comparison target will be generated on the comparison image, and the comparison anchor frame is the comparison area.
  • a neural network model such as Faster R-CNN, Mask R-CNN, or RFCN
  • a standard operation image is obtained by cutting the standard area from the standard image by a cropping module
  • a contrast operation image is obtained by cutting the comparison area from the contrast image.
  • image cropping software such as Jpegcrop
  • Jpegcrop realizes the lossless cutting of the image, thereby ensuring that the standard target and the operation target in the standard operation image and the comparison operation image will not be distorted, and the accuracy of the comparison is improved.
  • S203 Adjust the size of the standard operation image and the comparison operation image, so that the standard operation image and the comparison operation image have the same size.
  • the standard operation image and the The size of the comparison operation image is adjusted to a preset standard size, so that the size of the standard operation image and the comparison operation image are consistent.
  • S204 Improve the definition of the standard operation image and the contrast operation image to highlight the contour boundaries of the standard target and the contrast target.
  • this step converts the RGB color space of the standard operation image and the contrast operation image to the l ⁇ color space, and compares the standard operation image and the contrast operation image.
  • the spatial components of the l ⁇ color space of the computed image are adjusted to improve the sharpness of the detail shadows and their outline boundaries of the standard and contrasting targets. Because the l ⁇ color space not only basically eliminates the strong correlation between color components, but also effectively separates the grayscale information and color information of the image, which is conducive to improving the standard target and the contrast target. and the technical effect of the clarity of its boundaries.
  • the step of improving the definition of the standard operation image and the contrast operation image includes:
  • S41 Acquire a preset reference image, respectively convert the RGB color space of the standard operation image, the contrast operation image and the reference image to the 1 ⁇ color space to form the standard conversion image, the contrast conversion image and the reference conversion image respectively;
  • the reference image is image information capable of highlighting the reference object therein.
  • the RGB color space of the standard operation image is converted to the l ⁇ color space to form a standard conversion image
  • the RGB color space of the contrast operation image is converted to the l ⁇ color space to form a contrast conversion image
  • the RGB color space of the standard operation image and the contrast operation image is converted to the l ⁇ color space through image drawing software or open source image processing software (for example: phtoshope, matlab, etc.).
  • the obtaining a preset reference image includes:
  • the reference image generated by the reference device can clearly delineate the detailed shadows and outline boundaries of the reference target in the reference image, for example: scanner.
  • S42 Calculate the first mean and the first standard deviation of the l ⁇ color space coordinates of each pixel in the standard transformed image, and the second mean and second standard deviation of the l ⁇ color space coordinates of each pixel in the contrast transformed image, and the reference mean and reference standard deviation of the l ⁇ color space coordinates of each pixel in the reference converted image.
  • S43 Adjust the pixels of the standard operation image according to the reference mean value, the reference standard deviation, the first mean value and the first standard deviation, so as to improve the definition of the standard operation image;
  • the step of adjusting the pixels of the standard operation image according to the reference mean, the reference standard deviation, the first mean and the first standard deviation includes:
  • S43-01 Set any pixel in the standard operation image as the first target pixel, and extract the l ⁇ color space coordinates of the first target pixel;
  • the first standard score measures how many standard deviations above or below the first mean value of the standard operation image the l ⁇ color space coordinate of the first target pixel is in units of standard deviation.
  • the larger the standard score the larger the distance between the l ⁇ color space coordinates of the first target pixel and the first mean value.
  • S43-03 standard reference coordinates obtained by multiplying the first standard score and the reference mean value, and adding the standard reference coordinates and the reference standard deviation to obtain standard adjustment coordinates;
  • the standard reference coordinate is to adjust the l ⁇ color space coordinate of the first target pixel according to the reference image to reflect that when the first target pixel is mapped to the reference image, the first target pixel
  • the initial position of the l ⁇ color space; the standard adjustment coordinates are to adjust the standard reference coordinates to reflect that when the first target pixel is mapped to the reference image, the l ⁇ color space of the first target pixel. exact location.
  • S43-04 Set the l ⁇ color space coordinates of the first target pixel as the standard adjustment coordinates, so as to adjust the first target pixel of the standard operation image.
  • the step of adjusting the pixels of the comparison operation image according to the reference mean, the reference standard deviation, the second mean and the second standard deviation includes:
  • the second standard score measures how many standard deviations above or below the second mean of the comparison operation image the l ⁇ color space coordinate of the second target pixel is in units of standard deviation.
  • the larger the standard score the larger the distance between the l ⁇ color space coordinates of the second target pixel and the second mean.
  • the comparison reference coordinate is to adjust the l ⁇ color space coordinate of the second target pixel according to the reference image to reflect that when the second target pixel is mapped to the reference image, the second target pixel
  • the initial position of the l ⁇ color space; the contrast adjustment coordinates are to adjust the contrast reference coordinates to reflect the second target pixel when the second target pixel is mapped to the reference image, the l ⁇ color space of the second target pixel. exact location.
  • S43-14 Set the l ⁇ color space coordinate of the second target pixel as the contrast adjustment coordinate, so as to adjust the second target pixel of the contrast operation image.
  • the l ⁇ color space coordinates of each pixel in the standard conversion image and the contrast conversion image are adjusted respectively, and the comparison target in the standard operation image and the standard target and the contrast operation image are improved. sharpness to highlight the contour boundaries of the standard target and the contrast target.
  • S205 Extract the standard target in the standard operation image, and extract the contrast target in the contrast operation image.
  • the standard operation image and the contrast operation image are respectively converted from the RGB color space to the HSV color space, wherein the HSV color space Intuitively express the hue, vividness and lightness of the color, including: H (Hue, hue), S (Saturation: saturation, color purity), V (Value: lightness);
  • H Hue, hue
  • S saturated, saturation, color purity
  • V Value: lightness
  • the pixels belonging to the preset color threshold in the contrast operation image are adjusted to extremely low values, and the pixels that do not belong to the color threshold value are adjusted to extremely high values, so as to highlight the standard target and the standard target in the standard operation image.
  • the difference in color and brightness between other pixels except the contrast target, and the difference in color and brightness between the contrast target and other pixels other than the contrast target in the contrast operation image Respectively summarize the pixels belonging to extremely low values in the standard operation image and the contrast operation image to obtain the standard target and the contrast target respectively, so as to achieve accurate and complete extraction of the standard target from the standard operation image and the contrast operation image and the technical effect of the contrast target.
  • the steps of extracting the standard target in the standard operation image and extracting the contrast target in the contrast operation image include:
  • S52 Set any pixel in the standard operation image as a third target pixel, and determine whether the HSV color space of the third target pixel belongs to a color threshold; if yes, adjust the HSV color space to a preset value Very low value; for example: [0,0,0]; if not, adjust the HSV color space to a preset very high value; for example: [255,255,255];
  • S55 Set any pixel in the comparison operation image as the fourth target pixel, and determine whether the HSV color space of the fourth target pixel belongs to a preset color threshold; if so, adjust the HSV color space to a preset color threshold the preset extremely low value; for example: [0,0,0]; if not, adjust the HSV color space to the preset extremely high value; for example: [255,255,255].
  • the standard contour of the standard target and the contrast contour of the contrast target are obtained using the cv2.findContours function in Python, and the standard contour is the pixel point located at the edge position in the standard target, so The contrast contour is the pixel point located at the edge position in the contrast target.
  • the pixel points located at the edge of the standard target and the contrast target can be extracted respectively by the following codes, so as to obtain the standard contour and the contrast contour respectively:
  • S207 Compare the difference between the standard profile and the comparison profile, and determine whether the standard target and the comparison target are the same according to the difference.
  • this step obtains the standard vector of each pixel in the standard contour and the contrast vector of each pixel in the contrast contour; calculates the standard contour.
  • the Euclidean distance between the standard vectors of any two adjacent pixels obtains the spatial distance and sums it up to form a standard distance vector, and calculates the Euclidean distance between the contrast vectors of any two adjacent pixels in the contrast contour to obtain space distance and sum up to form a contrast distance vector; compare the Euclidean distance or cosine similarity between the standard distance vector and the contrast distance vector to obtain the difference between the standard contour and the contrast contour, and according to the difference It is judged whether the standard target and the comparison target are the same.
  • the step of comparing the difference between the standard profile and the comparison profile, and judging whether the standard target and the comparison target are the same according to the difference includes:
  • S71 Obtain the standard vector of each pixel in the standard contour and the contrast vector of each pixel in the contrast contour, and enter the standard vector and the contrast vector into the recognition neural network, wherein the standard vector represents the the position coordinates of the pixels in the standard contour, and the contrast vector represents the position coordinates of the pixels in the contrast contour;
  • S72 Call the recognition neural network to obtain the space between the two adjacent pixels by extracting standard vectors of two adjacent pixels in the standard contour, and calculating the Euclidean distance between the two standard vectors distance, calculate the spatial distance between each of the adjacent two pixels in the standard contour, and summarize to form a standard distance vector; and by extracting the contrast vector of the two adjacent pixels in the contrast contour, Calculate the Euclidean distance between the two contrast vectors to obtain the spatial distance between the two adjacent pixels, and calculate the spatial distance between the two adjacent pixels in the contrast contour, And sum up to form a contrast distance vector;
  • S73 Calculate the Euclidean distance or cosine similarity between the standard distance vector and the contrast distance vector to obtain a contrast similarity value, where the contrast similarity value represents the difference between the standard contour and the contrast contour; determine the It is compared whether the similarity value exceeds a preset similarity threshold; if so, it is determined that the standard target and the comparison target are different; if not, it is determined that the standard target and the comparison target are the same.
  • the method includes:
  • the comparative similarity value is uploaded to the blockchain.
  • the corresponding summary information is obtained based on the comparison similarity value.
  • the summary information is obtained by hashing the comparison similarity value, for example, by using the sha256s algorithm.
  • Uploading summary information to the blockchain ensures its security and fairness and transparency to users.
  • the user equipment can download the summary information from the blockchain in order to verify whether the comparison similarity value has been tampered with.
  • the blockchain referred to in this example is a new application mode of computer technology such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm.
  • Blockchain essentially a decentralized database, is a series of data blocks associated with cryptographic methods. Each data block contains a batch of network transaction information to verify its Validity of information (anti-counterfeiting) and generation of the next block.
  • the blockchain can include the underlying platform of the blockchain, the platform product service layer, and the application service layer.
  • training the recognition neural network specifically includes:
  • M1 obtain training samples, the training samples include similar image pairs and dissimilar image pairs;
  • M2 Process the first standard image and the first comparison image in the similar image pair according to the steps S201-S206 to obtain a first standard outline and a first contrast outline; create a first standard outline with the first standard outline Using the first contrast profile as the first input information, and using the similar label as a similar sample of the first output information;
  • M3 Process the second standard image and the second contrast image in the dissimilar image pair according to the steps S201-S206 to obtain a second standard contour and a second contrast contour; create a second standard contour based on the second standard The contour and the second contrast contour are used as the second input information, and the dissimilar label is used as the dissimilar sample of the second output information;
  • M4 Train the initial neural network by using the similar samples and the dissimilar samples to obtain a comparison neural network.
  • the initial neural network is a Siamese network
  • the initial neural network is trained by using the gradient descent method through the similar samples and the dissimilar samples to train the initial neural network, and according to Using the first distance obtained from the first input information and the second vector obtained according to the second input information, a similarity threshold for dividing the critical point of similarity between the standard operation image and the comparison operation image is found.
  • the Siamese network is a similarity measurement method. When the number of categories is large, but the number of samples in each category is small, it can be used for category identification, classification, etc. It learns a similarity measurement from the data, Use this learned metric to compare and match samples of new unknown classes.
  • the gradient descent method is an optimization algorithm, also commonly known as the steepest descent method, which is used in machine learning and artificial intelligence to recursively approximate the minimum deviation model.
  • an image target comparison apparatus 1 of the present embodiment includes:
  • Input module 11 used for obtaining standard image and contrast image
  • the cropping module 12 is used for cropping the area where the standard target is displayed in the standard image to form a standard operation image, and for cropping the area where the comparison target is displayed in the comparison image to obtain a comparison operation image;
  • the target extraction module 15 is used for extracting the standard target in the standard operation image, and extracting the contrast target in the contrast operation image;
  • the contour extraction module 16 is used for obtaining the standard contour of the standard target and the contrast contour of the contrast target;
  • the target comparison module 17 is configured to compare the difference between the standard profile and the comparison profile, and judge whether the standard target and the comparison target are the same according to the difference.
  • the image target comparison device 1 further includes:
  • the size adjustment module 13 is configured to adjust the size of the standard operation image and the comparison operation image, so that the size of the standard operation image and the comparison operation image are consistent.
  • the image target comparison device 1 further includes:
  • the sharpness adjustment module 14 is configured to improve the sharpness of the standard operation image and the contrast operation image, so as to highlight the outline boundary of the standard target and the contrast target.
  • the technical solution is applied to the technical field of image detection of artificial intelligence, extracts the standard target in the standard operation image, and extracts the contrast target in the contrast operation image; obtains the standard contour of the standard target, and the contrast target By comparing the difference between the standard contour and the contrast contour by measuring the distance between the standard contour and the contrast contour, judging whether the standard target and the contrast target are the same according to the difference, To achieve the technical effect of image matching between the standard target and the contrast target.
  • Embodiment 4 is a diagrammatic representation of Embodiment 4:
  • the present application also provides a computer equipment 5.
  • the components of the image target comparison device of the third embodiment can be dispersed in different computer equipment.
  • the computer device in this embodiment at least includes but is not limited to: a memory 51 and a processor 52 that can be communicatively connected to each other through a system bus, as shown in FIG. 5 .
  • FIG. 5 only shows a computer device having a component -, but it should be understood that it is not required to implement all the shown components, and more or less components may be implemented instead.
  • the memory 51 (that is, a readable storage medium) includes a flash memory, a hard disk, a multimedia card, a card-type memory (eg, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), Programmable Read Only Memory (PROM), Magnetic Memory, Magnetic Disk, Optical Disk, etc.
  • the memory 51 may be an internal storage unit of a computer device, such as a hard disk or a memory of the computer device.
  • the memory 51 may also be an external storage device of a computer device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) equipped on the computer device card, Flash Card, etc.
  • the memory 51 may also include both the internal storage unit of the computer device and its external storage device.
  • the memory 51 is generally used to store the operating system and various application software installed on the computer equipment, such as the program code of the image target comparison apparatus of the third embodiment.
  • the memory 51 can also be used to temporarily store various types of data that have been output or will be output.
  • the processor 52 may be a central processing unit (Central Processing Unit, CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments.
  • the processor 52 is typically used to control the overall operation of the computer device.
  • the processor 52 is used for running the program code or processing data stored in the memory 51, for example, running the image object comparison apparatus, so as to realize the image object comparison methods of the first embodiment and the second embodiment.
  • Embodiment 5 is a diagrammatic representation of Embodiment 5:
  • the present application also provides a computer-readable storage medium, which can be non-volatile or volatile, such as flash memory, hard disk, multimedia card, card-type memory (for example, , SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read only memory (ROM), electrically erasable programmable read only memory (EEPROM), programmable read only memory (PROM) ), magnetic storage, magnetic disk, optical disk, server, App application mall, etc., on which computer programs are stored, and when the programs are executed by the processor 52, corresponding functions are realized.
  • the computer-readable storage medium of this embodiment is used to store the image target comparison apparatus, and when executed by the processor 52, implements the image target comparison methods of the first embodiment and the second embodiment.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Multimedia (AREA)
  • Data Mining & Analysis (AREA)
  • Artificial Intelligence (AREA)
  • Evolutionary Computation (AREA)
  • General Engineering & Computer Science (AREA)
  • Evolutionary Biology (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • Databases & Information Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Software Systems (AREA)
  • Image Analysis (AREA)
  • Apparatus For Radiation Diagnosis (AREA)

Abstract

提供了一种图像目标对比方法、装置、计算机设备及可读存储介质,包括:获取标准图像和对比图像(S101);裁剪标准图像中展示有标准目标的区域形成标准运算图像,及裁剪对比图像中展示有对比目标的区域得到对比运算图像(S102);提取标准运算图像中的标准目标,及提取对比运算图像中的对比目标(S105);获取标准目标的标准轮廓,及对比目标的对比轮廓(S106);对比标准轮廓和对比轮廓的差异,根据差异判断标准目标和对比目标是否相同(S107)。还涉及区块链技术,信息可存储于区块链节点中。不仅提高了标准目标和对比目标之间比对的准确度,如标准公章和对比公章之间的对比,而且提高了标准目标和对比目标之间比对的效率。

Description

图像目标对比方法、装置、计算机设备及可读存储介质
本申请要求于2021年1月22日递交的申请号为CN 202110086294.4、名称为“图像目标对比方法、装置、计算机设备及可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及人工智能技术领域,尤其涉及一种图像目标对比方法、装置、计算机设备及可读存储介质,其应用在人工智能的计算机视觉技术领域。
背景技术
对于图像中的某些目标,例如:公章、签字等,通常需要对其进行比对方可鉴定获得的文件的真伪;尤其在金融业务中,鉴定文件中的公章需求更为迫切,例如:
在银行的对公业务中,需要临柜进行印章验真、银企对账印章验真、银行事后监督系统需进行批量验真;
在融资租赁的业务场景中,融资租赁公司需要对其客户的企业情况进行核实,针对客户提供的资料需要进行公章的验真;
在各类贷款场景中,无论是针对企业还是个人的贷款,在贷款进件的时候,均需要提供各类财产证明,里面不乏涉及对于公章的验真需要。
但是,发明人发现,当前的图像中的目标比对鉴定的工作通常交由人工处理,不仅难以准确的对目标进行比对,而且比对鉴定的效率十分低下。
发明内容
本申请的目的是提供一种图像目标对比方法、装置、计算机设备及可读存储介质,用于解决现有技术存在的由人工处理图像中目标比对鉴定的工作,导致难以准确的对目标进行比对,及比对鉴定的效率十分低下的问题。
为实现上述目的,本申请提供一种图像目标对比方法,包括:
获取标准图像和对比图像;
裁剪所述标准图像中展示有标准目标的区域形成标准运算图像,及裁剪所述对比图像中展示有所述对比目标的区域得到对比运算图像;
提取所述标准运算图像中的标准目标,及提取所述对比运算图像中的对比目标;
获取所述标准目标的标准轮廓,及所述对比目标的对比轮廓;
对比所述标准轮廓和所述对比轮廓的差异,根据所述差异判断所述标准目标和所述对比目标是否相同。
为实现上述目的,本申请还提供一种图像目标对比装置,包括:
输入模块,用于获取标准图像和对比图像;
裁剪模块,用于裁剪所述标准图像中展示有标准目标的区域形成标准运算图像,及裁剪所述对比图像中展示有所述对比目标的区域得到对比运算图像;
目标提取模块,用于提取所述标准运算图像中的标准目标,及提取所述对比运算图像中的对比目标;
轮廓提取模块,用于获取所述标准目标的标准轮廓,及所述对比目标的对比轮廓;
目标对比模块,用于对比所述标准轮廓和所述对比轮廓的差异,根据所述差异判断所述标准目标和所述对比目标是否相同。
为实现上述目的,本申请还提供一种计算机设备,其包括存储器、处理器 以及存储在存储器上并可在处理器上运行的计算机程序,所述计算机设备的处理器执行所述计算机程序时实现上述图像目标对比方法的步骤。
为实现上述目的,本申请还提供一种计算机可读存储介质,所述可读存储介质上存储有计算机程序,所述可读存储介质存储的所述计算机程序被处理器执行时实现上述图像目标对比方法的步骤。
本申请提供的图像目标对比方法、装置、计算机设备及可读存储介质,通过对比标准图像中标准目标的标准轮廓,与对比图像中对比目标的对比轮廓的差异,以判断标准目标和对比目标是否相同,实现精准高效的识别所述标准目标和所述对比目标是否一致,不仅提高了标准目标和对比目标之间比对的准确度,如标准公章和对比公章之间的对比,而且提高了标准目标和对比目标之间比对的效率。
附图说明
图1为本申请图像目标对比方法实施例一的流程图;
图2为本申请图像目标对比方法实施例二中图像目标对比方法的环境应用示意图;
图3是本申请图像目标对比方法实施例二中图像目标对比方法的具体方法流程图;
图4为本申请图像目标对比装置实施例三的程序模块示意图;
图5为本申请计算机设备实施例四中计算机设备的硬件结构示意图。
具体实施方式
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本申请,并不用于限定本申请。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
本申请提供的图像目标对比方法、装置、计算机设备及可读存储介质,适用于人工智能的图像检测技术领域,为提供一种基于输入模块、裁剪模块、目标提取模块、轮廓提取模块、目标对比模块的图像目标对比方法。本申请通过裁剪标准图像中展示有标准目标的区域形成标准运算图像,及裁剪对比图像中展示有对比目标的区域得到对比运算图像;提取标准运算图像中的标准目标,及提取对比运算图像中的对比目标;获取标准目标的标准轮廓,及对比目标的对比轮廓;对比标准轮廓和对比轮廓的差异,根据差异判断标准目标和对比目标是否相同。
实施例一:
请参阅图1,本实施例的一种图像目标对比方法,包括:
S101:获取标准图像和对比图像。
S102:裁剪所述标准图像中展示有标准目标的区域形成标准运算图像,及裁剪所述对比图像中展示有所述对比目标的区域得到对比运算图像。
S105:提取所述标准运算图像中的标准目标,及提取所述对比运算图像中的对比目标。
S106:获取所述标准目标的标准轮廓,及所述对比目标的对比轮廓。
S107:对比所述标准轮廓和所述对比轮廓的差异,根据所述差异判断所述标准目标和所述对比目标是否相同。
在示例性的实施例中,所述标准图像为展示有标准目标的图片信息,例如:具有经过认证的公章的合法扫描版合同,其中,所述公章为标准目标,所述合法 扫描版合同为所述标准图像;所述对比图像为展示有对比目标的图像信息,例如:具有未经过认证的公章的待定扫描版合同,其中,所述公章为对比目标,所述待定扫描版合同未所述对比图像。
对识别所述标准图像中展示所述标准目标的标准区域,及所述对比图像中展示所述对比目标的对比区域;在识别出所述标准图像中的标准目标时,将会在所述标准图像上生成圈定所述标准目标的标准锚框,所述标准锚框即为所述标准区域;同时,在识别所述对比图像中的对比目标时,将会在所述对比图像上生成圈定所述对比目标的对比锚框,所述对比锚框即为所述对比区域。进而实现识别出标准图像中具有标准目标的区域,及对比图像中具有对比目标的区域实现单独对比所述标准目标和所述对比目标,避免了标准图像和对比图像中除标准目标和对比目标外的其他像素对后续的对比作业产生干扰。
通过将所述标准运算图像和所述对比运算图像分别从RGB色彩空间转换到HSV色彩空间,其中,HSV色彩空间直观地表达颜色的色调、鲜艳程度和明暗程度,其包括:H(Hue色调、色相)、S(Saturation:饱和度、色彩纯净度)、V(Value:明度);将所述标准运算图像和对比运算图像中属于预置的色彩阈值的像素调整到极低值,不属于所述色彩阈值的像素调整到极高值,以突出所述标准目标与所述标准运算图像中除所述标准目标外的其他像素之间的色彩及明亮度差别,及所述对比目标与所述对比运算图像中除所述对比目标外的其他像素之间的色彩及明亮度差别。分别汇总所述标准运算图像和所述对比运算图像中属于极低值的像素,以分别获得所述标准目标和所述对比目标,实现准确完整的从标准运算图像和对比运算图像中提取标准目标和对比目标的技术效果。
使用Python中的cv2.findContours函数获取所述标准目标的标准轮廓,及所述对比目标的对比轮廓,所述标准轮廓是所述标准目标中位于边缘位置的像素点,所述对比轮廓是所述对比目标中位于边缘位置的像素点。
通过获取所述标准轮廓中各像素的标准向量,及所述对比轮廓中各像素的对比向量;计算所述标准轮廓中任一两个相邻的像素的标准向量之间的欧式距离得到空间距离并汇总形成标准距离向量,计算所述对比轮廓中任一两个相邻的像素的对比向量之间的欧式距离得到空间距离并汇总形成对比距离向量;对比所述标准距离向量和所述对比距离向量之间的欧式距离或余弦相似度,以获得所述标准轮廓和所述对比轮廓的差异,并根据所述差异判断所述标准目标和所述对比目标是否相同,实现精准高效的识别所述标准目标和所述对比目标是否一致的技术效果。
因此,本申请不仅提高了标准目标和对比目标之间比对的准确度,如标准公章和对比公章之间的对比,而且提高了标准目标和对比目标之间比对的效率。
实施例二:
本实施例为上述实施例一的一种具体应用场景,通过本实施例,能够更加清楚、具体地阐述本申请所提供的方法。
下面,以在运行有图像目标对比方法的服务器中,对比标准图像中标准目标的标准轮廓,与对比图像中对比目标的对比轮廓的差异,以判断标准目标和对比目标是否相同为例,来对本实施例提供的方法进行具体说明。需要说明的是,本实施例只是示例性的,并不限制本申请实施例所保护的范围。
图2示意性示出了根据本申请实施例二的图像目标对比方法的环境应用示意图。
在示例性的实施例中,图像目标对比方法所在的服务器2通过网络3分别 连接客户端4;所述服务器2可以通过一个或多个网络3提供服务,网络3可以包括各种网络设备,例如路由器,交换机,多路复用器,集线器,调制解调器,网桥,中继器,防火墙,代理设备和/或等等。网络3可以包括物理链路,例如同轴电缆链路,双绞线电缆链路,光纤链路,它们的组合和/或类似物。网络3可以包括无线链路,例如蜂窝链路,卫星链路,Wi-Fi链路和/或类似物;所述客户端4可为智能手机、平板电脑、笔记本电脑、台式电脑等计算机设备。
图3是本申请一个实施例提供的一种图像目标对比方法的具体方法流程图,该方法具体包括步骤S201至S207。
S201:获取标准图像和对比图像。
本步骤中,通过与客户端建立连接以获取所述标准图像和所述对比图像,所述标准图像为展示有标准目标的图片信息,例如:具有经过认证的公章的合法扫描版合同,其中,所述公章为标准目标,所述合法扫描版合同为所述标准图像;所述对比图像为展示有对比目标的图像信息,例如:具有未经过认证的公章的待定扫描版合同,其中,所述公章为对比目标,所述待定扫描版合同未所述对比图像。
S202:裁剪所述标准图像中展示有标准目标的区域形成标准运算图像,及裁剪所述对比图像中展示有所述对比目标的区域得到对比运算图像。
为识别出标准图像中具有标准目标的区域,及对比图像中具有对比目标的区域实现单独对比所述标准目标和所述对比目标,以避免标准图像和对比图像对后续的对比作业产生干扰;本步骤通过图像目标识别模块对识别所述标准图像中展示所述标准目标的标准区域,及所述对比图像中展示所述对比目标的对比区域,于本实施例中,所述图像目标识别模块是通过存储的信息与当前的信息进行比较实现对图像的识别,其中,可采用Faster R-CNN、或Mask R-CNN、或RFCN等神经网络模型作为所述图像目标识别模块;所述图像目标识别模块在识别出所述标准图像中的标准目标时,将会在所述标准图像上生成圈定所述标准目标的标准锚框,所述标准锚框即为所述标准区域;同时,在识别所述对比图像中的对比目标时,将会在所述对比图像上生成圈定所述对比目标的对比锚框,所述对比锚框即为所述对比区域。
进一步地,通过裁剪模块将所述标准区域从所述标准图像上裁切下来得到标准运算图像,及将所述对比区域从所述对比图像上裁切下来得到对比运算图像。于本实施例中,采用图像裁剪软件,如:Jpegcrop,对所述标准图像和所述对比图像进行裁剪,以获得标准运算图像和所述对比运算图像。其中,所述Jpegcrop实现了对图像的无损切割,进而保证标准运算图像和对比运算图像中的标准目标和运算目标不会失真,提高对比的准确度。
S203:调整所述标准运算图像和所述对比运算图像的尺寸,使所述标准运算图像和所述对比运算图像的尺寸一致。
为保证后续对标准目标和对比目标之间对比的准确度,本步骤在保证所述标准运算图像和所述对比运算图像的宽高比不变的前提下,将所述标准运算图像和所述对比运算图像的尺寸,调整至预置的规范尺寸,使所述标准运算图像和所述对比运算图像的尺寸一致。
S204:提升所述标准运算图像和所述对比运算图像的清晰度,以突出所述标准目标和所述对比目标的轮廓边界。
为分别划清所述标准目标与所述标准运算图像的其他像素之间的边界,及所述对比目标与所述对比运算图像的其他像素之间的边界,进而实现提升标准目 标和对比目标的细部影纹及其轮廓边界的清晰程度的技术效果,本步骤通过将所述标准运算图像和所述对比运算图像的RGB色彩空间转换到lαβ色彩空间,并对所述标准运算图像和所述对比运算图像的lαβ色彩空间的空间分量进行调整,以提升标准目标和对比目标的细部影纹及其轮廓边界的清晰度。由于lαβ色彩空间不仅基本消除了颜色分量之间的强相关性,而且有效地将图像的灰度信息和颜色信息分离开来,进而有利于提升所述标准目标和对比目标的,各细部影纹及其边界的清晰程度的技术效果。
在一个优选的实施例中,所述提升所述标准运算图像和所述对比运算图像的清晰度的步骤,包括:
S41:获取预置的参考图像,分别将所述标准运算图像、对比运算图像及所述参考图像的RGB色彩空间转换到lαβ色彩空间,以分别形成标准转换图像、对比转换图像和参考转换图像;其中,所述参考图像是能够将其中参考目标进行突出展示的图像信息。
本步骤中,将所述标准运算图像的RGB色彩空间转换到lαβ色彩空间形成标准转换图像,及将所述对比运算图像的RGB色彩空间转换到lαβ色彩空间形成对比转换图像;将所述参考图像的RGB色彩空间转换到lαβ色彩空间形成参考转换图像。其中,通过图像绘制软件或开源图像处理软件(例如:phtoshope、matlab等),将所述标准运算图像和所述对比运算图像的RGB色彩空间转到lαβ色彩空间。
具体地,所述获取预置的参考图像包括:
调用预置的参考设备生成参考图像并获取所述参考图像;所述参考设备所生成的参考图像,能够清晰的划分出所述参考图像中的参考目标的细部影纹及其轮廓边界,例如:扫描机。
S42:计算所述标准转换图像中各像素的lαβ色彩空间坐标的第一均值和第一标准差,及所述对比转换图像中各像素的lαβ色彩空间坐标的第二均值和第二标准差,及所述参考转换图像中各像素的lαβ色彩空间坐标的参考均值和参考标准差。
S43:根据所述参考均值、所述参考标准差、所述第一均值和所述第一标准差对所述标准运算图像的像素进行调整,以提升所述标准运算图像的清晰度;
根据所述参考均值、所述参考标准差、所述第二均值和所述第二标准差对所述对比运算图像进行调整,以提升所述对比运算图像的清晰度;
本步骤中,所述根据所述参考均值、所述参考标准差、所述第一均值和所述第一标准差对所述标准运算图像的像素进行调整的步骤,包括:
S43-01:将所述标准运算图像中任一像素设为第一目标像素,提取第一目标像素的lαβ色彩空间坐标;
S43-02:将所述lαβ色彩空间坐标与所述第一均值相减后,与所述第一标准差相除得到第一标准分数,所述第一标准分数反映了所述lαβ色彩空间坐标,在所述标准运算图像的所有像素的lαβ色彩空间坐标的正态分布中所处的相对位置;
本步骤中,所述第一标准分数是以标准差为单位度量第一目标像素的lαβ色彩空间坐标离所述标准运算图像的第一均值之上多少个标准差或之下多少个标准差。一般情况下,标准分数越大说明第一目标像素的lαβ色彩空间坐标和第一均值之间的距离越大。
S43-03:将所述第一标准分数与所述参考均值相乘得到的标准参考坐标, 将所述标准参考坐标与所述参考标准差相加得到标准调整坐标;
本步骤中,所述标准参考坐标是根据参考图像对所述第一目标像素的lαβ色彩空间坐标进行调节,以反映所述第一目标像素映射到所述参考图像时,所述第一目标像素的lαβ色彩空间的初步位置;所述标准调整坐标是对所述标准参考坐标进行调整,以反映所述第一目标像素映射到所述参考图像时,所述第一目标像素的lαβ色彩空间的准确位置。
S43-04:将所述第一目标像素的lαβ色彩空间坐标设为所述标准调整坐标,以对所述标准运算图像的第一目标像素进行调整。
所述根据所述参考均值、所述参考标准差、所述第二均值和所述第二标准差对所述对比运算图像的像素进行调整的步骤,包括:
S43-11:将所述对比运算图像中任一像素设为第二目标像素,提取第二目标像素的lαβ色彩空间坐标;
S43-12:将所述lαβ色彩空间坐标与所述第二均值相减后,与所述第二标准差相除得到第二标准分数,所述第二标准分数反映了所述lαβ色彩空间坐标,在所述对比运算图像的所有像素的lαβ色彩空间坐标的正态分布中所处的相对位置;
本步骤中,所述第二标准分数是以标准差为单位度量第二目标像素的lαβ色彩空间坐标离所述对比运算图像的第二均值之上多少个标准差或之下多少个标准差。一般情况下,标准分数越大说明第二目标像素的lαβ色彩空间坐标和第二均值之间的距离越大。
S43-13:将所述第二标准分数与所述参考均值相乘得到的对比参考坐标,将所述对比参考坐标与所述参考标准差相加得到对比调整坐标;
本步骤中,所述对比参考坐标是根据参考图像对所述第二目标像素的lαβ色彩空间坐标进行调节,以反映所述第二目标像素映射到所述参考图像时,所述第二目标像素的lαβ色彩空间的初步位置;所述对比调整坐标是对所述对比参考坐标进行调整,以反映所述第二目标像素映射到所述参考图像时,所述第二目标像素的lαβ色彩空间的准确位置。
S43-14:将所述第二目标像素的lαβ色彩空间坐标设为所述对比调整坐标,以对所述对比运算图像的第二目标像素进行调整。
综上,分别对所述标准转换图像和所述对比转换图像中各像素的lαβ色彩空间坐标进行调整,提升所述标准运算图像中的与所述标准目标及所述对比运算图像中的对比目标的清晰度,以突出所述标准目标和所述对比目标的轮廓边界。
示例性地,以下为通过Python代码对第一均值和第一标准差,以及对第二均值和第二标准差进行正态分布调整的举例说明:
Figure PCTCN2021109284-appb-000001
Figure PCTCN2021109284-appb-000002
S205:提取所述标准运算图像中的标准目标,及提取所述对比运算图像中的对比目标。
为完整的从标准运算图像和对比运算图像中提取标准目标和对比目标,本步骤通过将所述标准运算图像和所述对比运算图像分别从RGB色彩空间转换到HSV色彩空间,其中,HSV色彩空间直观地表达颜色的色调、鲜艳程度和明暗程度,其包括:H(Hue色调、色相)、S(Saturation:饱和度、色彩纯净度)、V(Value:明度);将所述标准运算图像和对比运算图像中属于预置的色彩阈值的像素调整到极低值,不属于所述色彩阈值的像素调整到极高值,以突出所述标准目标与所述标准运算图像中除所述标准目标外的其他像素之间的色彩及明亮度差别,及所述对比目标与所述对比运算图像中除所述对比目标外的其他像素之间的色彩及明亮度差别。分别汇总所述标准运算图像和所述对比运算图像中属于极低值的像素,以分别获得所述标准目标和所述对比目标,实现准确完整的从标准运算图像和对比运算图像中提取标准目标和对比目标的技术效果。
在一个优选的实施例中,所述提取所述标准运算图像中的标准目标,及提取所述对比运算图像中的对比目标的步骤,包括:
S51:将所述标准运算图像从RGB色彩空间转换到HSV色彩空间。
S52:将所述标准运算图像中任一像素设为第三目标像素,判断所述第三目标像素的HSV色彩空间是否属于的色彩阈值;若是,则将所述HSV色彩空间调整为预置的极低值;例如:[0,0,0];若否,则将所述HSV色彩空间调整为预置的极高值;例如:[255,255,255];
S53:从所述标准运算图像中获取HSV色彩空间为极低值的像素并汇总,得到所述标准目标;
S54:将所述对比运算图像从RGB色彩空间转换到HSV色彩空间。
S55:将所述对比运算图像中任一像素设为第四目标像素,判断所述第四目标像素的HSV色彩空间是否属于预置的色彩阈值;若是,则将所述HSV色彩空间调整为预置的极低值;例如:[0,0,0];若否,则将所述HSV色彩空间调整为预置的极高值;例如:[255,255,255]。
S56:从所述对比运算图像中获取HSV色彩空间为极低值的像素并汇总,得到所述对比目标。
示例性地,采用Python代码调整所述第三目标像素和第四目标像素的HSV色彩空间,如下:
Figure PCTCN2021109284-appb-000003
Figure PCTCN2021109284-appb-000004
S206:获取所述标准目标的标准轮廓,及所述对比目标的对比轮廓。
于本实施例中,使用Python中的cv2.findContours函数获取所述标准目标的标准轮廓,及所述对比目标的对比轮廓,所述标准轮廓是所述标准目标中位于边缘位置的像素点,所述对比轮廓是所述对比目标中位于边缘位置的像素点。
示例性地:可通过以下代码分别提取所述标准目标和所述对比目标中位于边缘的像素点,以分别获得所述标准轮廓和所述对比轮廓:
#kernel=np.ones((10,10),np.uint8)
#closing=cv2.morphologyEx(thresh,cv2.MORPH_CLOSE,kernel)
#contours,hierarchy=cv2.findContours(closing,cv2.RETR_TREE,cv2.CHAIN_APPROX_NONE)
S207:对比所述标准轮廓和所述对比轮廓的差异,根据所述差异判断所述标准目标和所述对比目标是否相同。
为实现精准高效的识别所述标准目标和所述对比目标是否一致,本步骤通过获取所述标准轮廓中各像素的标准向量,及所述对比轮廓中各像素的对比向量;计算所述标准轮廓中任一两个相邻的像素的标准向量之间的欧式距离得到空间距离并汇总形成标准距离向量,计算所述对比轮廓中任一两个相邻的像素的对比向量之间的欧式距离得到空间距离并汇总形成对比距离向量;对比所述标准距离向量和所述对比距离向量之间的欧式距离或余弦相似度,以获得所述标准轮廓和所述对比轮廓的差异,并根据所述差异判断所述标准目标和所述对比目标是否相同。
在一个优选的实施例中,所述对比所述标准轮廓和所述对比轮廓的差异,根据所述差异判断所述标准目标和所述对比目标是否相同的步骤,包括:
S71:获取所述标准轮廓中各像素的标准向量,及所述对比轮廓中各像素的对比向量,将所述标准向量和所述对比向量录入所述识别神经网络,其中,所述标准向量表征了所述标准轮廓中像素的位置坐标,所述对比向量表征了所述对比轮廓中像素的位置坐标;
S72:调用所述识别神经网络通过提取所述标准轮廓中相邻的两个像素的标准向量,计算两个所述标准向量之间的欧式距离得到所述相邻的两个像素之间的空间距离的方式,计算所述标准轮廓中各所述相邻的两个像素之间的空间距离,并汇总形成标准距离向量;及通过提取所述对比轮廓中相邻的两个像素的对比向量,计算两个所述对比向量之间的欧式距离得到所述相邻的两个像素之间的空间距离的方式,计算所述对比轮廓中各所述相邻的两个像素之间的空间距离,并汇总形成对比距离向量;
S73:计算所述标准距离向量和所述对比距离向量之间的欧式距离或余弦相似度获得对比相似值,所述对比相似值表征了所述标准轮廓和所述对比轮廓的差异;判断所述对比相似值是否超过预置的相似阈值;若是,则判定所述标准目标和所述对比目标不同;若否,则判定所述标准目标和所述对比目标相同。
优选的,所述计算所述标准距离向量和所述对比距离向量之间的欧式距离或余弦相似度获得对比相似值之后,所述方法包括:
将所述对比相似值上传至区块链中。
需要说明的是,基于对比相似值得到对应的摘要信息,具体来说,摘要信息由对比相似值进行散列处理得到,比如利用sha256s算法处理得到。将摘要信息上传至区块链可保证其安全性和对用户的公正透明性。用户设备可以从区块链 中下载得该摘要信息,以便查证对比相似值是否被篡改。本示例所指区块链是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。区块链(Blockchain),本质上是一个去中心化的数据库,是一串使用密码学方法相关联产生的数据块,每一个数据块中包含了一批次网络交易的信息,用于验证其信息的有效性(防伪)和生成下一个区块。区块链可以包括区块链底层平台、平台产品服务层以及应用服务层等。
进一步地,训练所述识别神经网络具体包括:
M1:获取训练样本,所述训练样本包括相似图像对和非相似图像对;
M2:将所述相似图像对中的第一标准图像和第一对比图像按照所述步骤S201-S206的步骤进行处理,获得第一标准轮廓和第一对比轮廓;创制以所述第一标准轮廓和所述第一对比轮廓作为第一输入信息,以相似标签为第一输出信息的相似样本;
M3:将所述非相似图像对中的第二标准图像和第二对比图像按照所述步骤S201-S206的步骤进行处理,获得第二标准轮廓和第二对比轮廓;创制以所述第二标准轮廓和所述第二对比轮廓作为第二输入信息,以非相似标签为第二输出信息的非相似样本;
M4:通过所述相似样本和所述非相似样本对所述初始神经网络进行训练,以得到对比神经网络。
于本实施例中,所述初始神经网络是Siamese网络,利用梯度下降法并通过所述相似样本和所述非相似样本对所述初始神经网络进行训练,以训练所述初始神经网络,并根据所述第一输入信息所获得的第一距离和根据所述第二输入信息所获得的第二向量,找到划分标准运算图像和对比运算图像之间相似度临界点的相似阈值。其中,所述Siamese网络是一种相似性度量方法,当类别数多,但每个类别的样本数量少的情况下可用于类别的识别、分类等,其从数据中去学习一个相似性度量,用这个学习出来的度量去比较和匹配新的未知类别的样本。所述梯度下降法(gradient decent)是一个最优化算法,通常也称为最速下降法,用于机器学习和人工智能当中用来递归性地逼近最小偏差模型。
实施例三:
请参阅图4,本实施例的一种图像目标对比装置1,包括:
输入模块11,用于获取标准图像和对比图像;
裁剪模块12,用于裁剪所述标准图像中展示有标准目标的区域形成标准运算图像,及裁剪所述对比图像中展示有所述对比目标的区域得到对比运算图像;
目标提取模块15,用于提取所述标准运算图像中的标准目标,及提取所述对比运算图像中的对比目标;
轮廓提取模块16,用于获取所述标准目标的标准轮廓,及所述对比目标的对比轮廓;
目标对比模块17,用于对比所述标准轮廓和所述对比轮廓的差异,根据所述差异判断所述标准目标和所述对比目标是否相同。
可选的,所述图像目标对比装置1还包括:
尺寸调整模块13,用于调整所述标准运算图像和所述对比运算图像的尺寸,使所述标准运算图像和所述对比运算图像的尺寸一致。
可选的,所述图像目标对比装置1还包括:
清晰度调整模块14,用于提升所述标准运算图像和所述对比运算图像的清晰度,以突出所述标准目标和所述对比目标的轮廓边界。
本技术方案应用于人工智能的图像检测技术领域,提取所述标准运算图像中的标准目标,及提取所述对比运算图像中的对比目标;获取所述标准目标的标准轮廓,及所述对比目标的对比轮廓;通过对所述标准轮廓和所述对比轮廓进行距离度量,以对比所述标准轮廓和所述对比轮廓的差异,根据所述差异判断所述标准目标和所述对比目标是否相同,以实现对标准目标和对比目标之间的图像匹配的技术效果。
实施例四:
为实现上述目的,本申请还提供一种计算机设备5,实施例三的图像目标对比装置的组成部分可分散于不同的计算机设备中,计算机设备5可以是执行程序的智能手机、平板电脑、笔记本电脑、台式计算机、机架式服务器、刀片式服务器、塔式服务器或机柜式服务器(包括独立的服务器,或者多个应用服务器所组成的服务器集群)等。本实施例的计算机设备至少包括但不限于:可通过系统总线相互通信连接的存储器51、处理器52,如图5所示。需要指出的是,图5仅示出了具有组件-的计算机设备,但是应理解的是,并不要求实施所有示出的组件,可以替代的实施更多或者更少的组件。
本实施例中,存储器51(即可读存储介质)包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、随机访问存储器(RAM)、静态随机访问存储器(SRAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、可编程只读存储器(PROM)、磁性存储器、磁盘、光盘等。在一些实施例中,存储器51可以是计算机设备的内部存储单元,例如该计算机设备的硬盘或内存。在另一些实施例中,存储器51也可以是计算机设备的外部存储设备,例如该计算机设备上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。当然,存储器51还可以既包括计算机设备的内部存储单元也包括其外部存储设备。本实施例中,存储器51通常用于存储安装于计算机设备的操作系统和各类应用软件,例如实施例三的图像目标对比装置的程序代码等。此外,存储器51还可以用于暂时地存储已经输出或者将要输出的各类数据。
处理器52在一些实施例中可以是中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器、或其他数据处理芯片。该处理器52通常用于控制计算机设备的总体操作。本实施例中,处理器52用于运行存储器51中存储的程序代码或者处理数据,例如运行图像目标对比装置,以实现实施例一和实施例二的图像目标对比方法。
实施例五:
为实现上述目的,本申请还提供一种计算机可读存储介质,所述计算机可读存储介质可以是非易失性,也可以是易失性,如闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、随机访问存储器(RAM)、静态随机访问存储器(SRAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、可编程只读存储器(PROM)、磁性存储器、磁盘、光盘、服务器、App应用商城等等,其上存储有计算机程序,程序被处理器52执行时实现相应功能。本实施例的计算机可读存储介质用于存储图像目标对比装置,被处理器52执行时实现实施例一和实施例二的图像目标对比方法。
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件, 但很多情况下前者是更佳的实施方式。
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。

Claims (20)

  1. 一种图像目标对比方法,其中,包括:
    获取标准图像和对比图像;
    裁剪所述标准图像中展示有标准目标的区域形成标准运算图像,及裁剪所述对比图像中展示有所述对比目标的区域得到对比运算图像;
    提取所述标准运算图像中的标准目标,及提取所述对比运算图像中的对比目标;
    获取所述标准目标的标准轮廓,及所述对比目标的对比轮廓;
    对比所述标准轮廓和所述对比轮廓的差异,根据所述差异判断所述标准目标和所述对比目标是否相同。
  2. 根据权利要求1所述的图像目标对比方法,其中,所述提取所述标准运算图像中的标准目标,及提取所述对比运算图像中的对比目标之前,所述方法还包括:
    调整所述标准运算图像和所述对比运算图像的尺寸,使所述标准运算图像和所述对比运算图像的尺寸一致。
  3. 根据权利要求1所述的图像目标对比方法,其中,所述提取所述标准运算图像中的标准目标,及提取所述对比运算图像中的对比目标之前,所述方法还包括:
    提升所述标准运算图像和所述对比运算图像的清晰度,以突出所述标准目标和所述对比目标的轮廓边界。
  4. 根据权利要求3所述的图像目标对比方法,其中,所述提升所述标准运算图像和所述对比运算图像的清晰度的步骤,包括:
    获取预置的参考图像,分别将所述标准运算图像、对比运算图像及所述参考图像的RGB色彩空间转换到lαβ色彩空间,以分别形成标准转换图像、对比转换图像和参考转换图像;其中,所述参考图像是能够将其中参考目标进行突出展示的图像信息;
    计算所述标准转换图像中各像素的lαβ色彩空间坐标的第一均值和第一标准差,及所述对比转换图像中各像素的lαβ色彩空间坐标的第二均值和第二标准差,及所述参考转换图像中各像素的lαβ色彩空间坐标的参考均值和参考标准差;
    根据所述参考均值、所述参考标准差、所述第一均值和所述第一标准差对所述标准运算图像的像素进行调整,以提升所述标准运算图像的清晰度;根据所述参考均值、所述参考标准差、所述第二均值和所述第二标准差对所述对比运算图像进行调整,以提升所述对比运算图像的清晰度。
  5. 根据权利要求4所述的图像目标对比方法,其中,所述根据所述参考均值、所述参考标准差、所述第一均值和所述第一标准差对所述标准运算图像的像素进行调整的步骤,包括:
    将所述标准运算图像中任一像素设为第一目标像素,提取第一目标像素的lαβ色彩空间坐标;
    将所述lαβ色彩空间坐标与所述第一均值相减后,与所述第一标准差相除得到第一标准分数,所述第一标准分数反映了所述lαβ色彩空间坐标,在所述标准运算图像的所有像素的lαβ色彩空间坐标的正态分布中所处的相对位置;
    将所述第一标准分数与所述参考均值相乘得到的标准参考坐标,将所述标 准参考坐标与所述参考标准差相加得到标准调整坐标;
    将所述第一目标像素的lαβ色彩空间坐标设为所述标准调整坐标,以对所述标准运算图像的第一目标像素进行调整;
    所述根据所述参考均值、所述参考标准差、所述第二均值和所述第二标准差对所述对比运算图像的像素进行调整的步骤,包括:
    将所述对比运算图像中任一像素设为第二目标像素,提取第二目标像素的lαβ色彩空间坐标;
    将所述lαβ色彩空间坐标与所述第二均值相减后,与所述第二标准差相除得到第二标准分数,所述第二标准分数反映了所述lαβ色彩空间坐标,在所述对比运算图像的所有像素的lαβ色彩空间坐标的正态分布中所处的相对位置;
    将所述第二标准分数与所述参考均值相乘得到的对比参考坐标,将所述对比参考坐标与所述参考标准差相加得到对比调整坐标;
    将所述第二目标像素的lαβ色彩空间坐标设为所述对比调整坐标,以对所述对比运算图像的第二目标像素进行调整。
  6. 根据权利要求1所述的图像目标对比方法,其中,所述提取所述标准运算图像中的标准目标,及提取所述对比运算图像中的对比目标的步骤,包括:
    将所述标准运算图像从RGB色彩空间转换到HSV色彩空间;
    将所述标准运算图像中任一像素设为第三目标像素,判断所述第三目标像素的HSV色彩空间是否属于预置的色彩阈值;若是,则将所述HSV色彩空间调整为预置的极低值;若否,则将所述HSV色彩空间调整为预置的极高值;
    从所述标准运算图像中获取HSV色彩空间为极低值的像素并汇总,得到所述标准目标;
    将所述对比运算图像从RGB色彩空间转换到HSV色彩空间;
    将所述对比运算图像中任一像素设为第四目标像素,判断所述第四目标像素的HSV色彩空间是否属于预置的色彩阈值;若是,则将所述HSV色彩空间调整为预置的极低值;若否,则将所述HSV色彩空间调整为预置的极高值;
    从所述对比运算图像中获取HSV色彩空间为极低值的像素并汇总,得到所述对比目标。
  7. 根据权利要求1所述的图像目标对比方法,其中,所述对比所述标准轮廓和所述对比轮廓的差异,根据所述差异判断所述标准目标和所述对比目标是否相同的步骤,包括:
    获取所述标准轮廓中各像素的标准向量,及所述对比轮廓中各像素的对比向量,将所述标准向量和所述对比向量录入所述识别神经网络,其中,所述标准向量表征了所述标准轮廓中像素的位置坐标,所述对比向量表征了所述对比轮廓中像素的位置坐标;
    调用所述识别神经网络通过提取所述标准轮廓中相邻的两个像素的标准向量,计算两个所述标准向量之间的欧式距离得到所述相邻的两个像素之间的空间距离的方式,计算所述标准轮廓中各所述相邻的两个像素之间的空间距离,并汇总形成标准距离向量;及通过提取所述对比轮廓中相邻的两个像素的对比向量,计算两个所述对比向量之间的欧式距离得到所述相邻的两个像素之间的空间距离的方式,计算所述对比轮廓中各所述相邻的两个像素之间的空间距离,并汇总形成对比距离向量;
    计算所述标准距离向量和所述对比距离向量之间的欧式距离或余弦相似度 获得对比相似值,所述对比相似值表征了所述标准轮廓和所述对比轮廓的差异;判断所述对比相似值是否超过预置的相似阈值;若是,则判定所述标准目标和所述对比目标不同;若否,则判定所述标准目标和所述对比目标相同;
    所述计算所述标准距离向量和所述对比距离向量之间的欧式距离或余弦相似度获得对比相似值之后,所述方法包括:
    将所述对比相似值上传至区块链中。
  8. 一种图像目标对比装置,其中,包括:
    输入模块,用于获取标准图像和对比图像;
    裁剪模块,用于裁剪所述标准图像中展示有标准目标的区域形成标准运算图像,及裁剪所述对比图像中展示有所述对比目标的区域得到对比运算图像;
    目标提取模块,用于提取所述标准运算图像中的标准目标,及提取所述对比运算图像中的对比目标;
    轮廓提取模块,用于获取所述标准目标的标准轮廓,及所述对比目标的对比轮廓;
    目标对比模块,用于对比所述标准轮廓和所述对比轮廓的差异,根据所述差异判断所述标准目标和所述对比目标是否相同。
  9. 一种计算机设备,其包括存储器、处理器以及存储在存储器上并可在处理器上运行的计算机程序,其中,所述计算机设备的处理器执行所述计算机程序时实现所述图像目标对比方法,所述图像目标对比方法的步骤,包括:
    获取标准图像和对比图像;
    裁剪所述标准图像中展示有标准目标的区域形成标准运算图像,及裁剪所述对比图像中展示有所述对比目标的区域得到对比运算图像;
    提取所述标准运算图像中的标准目标,及提取所述对比运算图像中的对比目标;
    获取所述标准目标的标准轮廓,及所述对比目标的对比轮廓;
    对比所述标准轮廓和所述对比轮廓的差异,根据所述差异判断所述标准目标和所述对比目标是否相同。
  10. 根据权利要求9所述的计算机设备,其中,所述提取所述标准运算图像中的标准目标,及提取所述对比运算图像中的对比目标之前,所述方法还包括:
    调整所述标准运算图像和所述对比运算图像的尺寸,使所述标准运算图像和所述对比运算图像的尺寸一致。
  11. 根据权利要求9所述的计算机设备,其中,所述提取所述标准运算图像中的标准目标,及提取所述对比运算图像中的对比目标之前,所述方法还包括:
    提升所述标准运算图像和所述对比运算图像的清晰度,以突出所述标准目标和所述对比目标的轮廓边界;
    所述提升所述标准运算图像和所述对比运算图像的清晰度的步骤,包括:
    获取预置的参考图像,分别将所述标准运算图像、对比运算图像及所述参考图像的RGB色彩空间转换到lαβ色彩空间,以分别形成标准转换图像、对比转换图像和参考转换图像;其中,所述参考图像是能够将其中参考目标进行突出展示的图像信息;
    计算所述标准转换图像中各像素的lαβ色彩空间坐标的第一均值和第一标准差,及所述对比转换图像中各像素的lαβ色彩空间坐标的第二均值和第二标准差,及所述参考转换图像中各像素的lαβ色彩空间坐标的参考均值和参考标准差;
    根据所述参考均值、所述参考标准差、所述第一均值和所述第一标准差对所述标准运算图像的像素进行调整,以提升所述标准运算图像的清晰度;根据所述参考均值、所述参考标准差、所述第二均值和所述第二标准差对所述对比运算图像进行调整,以提升所述对比运算图像的清晰度。
  12. 根据权利要求11所述的计算机设备,其中,所述根据所述参考均值、所述参考标准差、所述第一均值和所述第一标准差对所述标准运算图像的像素进行调整的步骤,包括:
    将所述标准运算图像中任一像素设为第一目标像素,提取第一目标像素的lαβ色彩空间坐标;
    将所述lαβ色彩空间坐标与所述第一均值相减后,与所述第一标准差相除得到第一标准分数,所述第一标准分数反映了所述lαβ色彩空间坐标,在所述标准运算图像的所有像素的lαβ色彩空间坐标的正态分布中所处的相对位置;
    将所述第一标准分数与所述参考均值相乘得到的标准参考坐标,将所述标准参考坐标与所述参考标准差相加得到标准调整坐标;
    将所述第一目标像素的lαβ色彩空间坐标设为所述标准调整坐标,以对所述标准运算图像的第一目标像素进行调整;
    所述根据所述参考均值、所述参考标准差、所述第二均值和所述第二标准差对所述对比运算图像的像素进行调整的步骤,包括:
    将所述对比运算图像中任一像素设为第二目标像素,提取第二目标像素的lαβ色彩空间坐标;
    将所述lαβ色彩空间坐标与所述第二均值相减后,与所述第二标准差相除得到第二标准分数,所述第二标准分数反映了所述lαβ色彩空间坐标,在所述对比运算图像的所有像素的lαβ色彩空间坐标的正态分布中所处的相对位置;
    将所述第二标准分数与所述参考均值相乘得到的对比参考坐标,将所述对比参考坐标与所述参考标准差相加得到对比调整坐标;
    将所述第二目标像素的lαβ色彩空间坐标设为所述对比调整坐标,以对所述对比运算图像的第二目标像素进行调整。
  13. 根据权利要求9所述的计算机设备,其中,所述提取所述标准运算图像中的标准目标,及提取所述对比运算图像中的对比目标的步骤,包括:
    将所述标准运算图像从RGB色彩空间转换到HSV色彩空间;
    将所述标准运算图像中任一像素设为第三目标像素,判断所述第三目标像素的HSV色彩空间是否属于预置的色彩阈值;若是,则将所述HSV色彩空间调整为预置的极低值;若否,则将所述HSV色彩空间调整为预置的极高值;
    从所述标准运算图像中获取HSV色彩空间为极低值的像素并汇总,得到所述标准目标;
    将所述对比运算图像从RGB色彩空间转换到HSV色彩空间;
    将所述对比运算图像中任一像素设为第四目标像素,判断所述第四目标像素的HSV色彩空间是否属于预置的色彩阈值;若是,则将所述HSV色彩空间调整为预置的极低值;若否,则将所述HSV色彩空间调整为预置的极高值;
    从所述对比运算图像中获取HSV色彩空间为极低值的像素并汇总,得到所述对比目标。
  14. 根据权利要求9所述的计算机设备,其中,所述对比所述标准轮廓和 所述对比轮廓的差异,根据所述差异判断所述标准目标和所述对比目标是否相同的步骤,包括:
    获取所述标准轮廓中各像素的标准向量,及所述对比轮廓中各像素的对比向量,将所述标准向量和所述对比向量录入所述识别神经网络,其中,所述标准向量表征了所述标准轮廓中像素的位置坐标,所述对比向量表征了所述对比轮廓中像素的位置坐标;
    调用所述识别神经网络通过提取所述标准轮廓中相邻的两个像素的标准向量,计算两个所述标准向量之间的欧式距离得到所述相邻的两个像素之间的空间距离的方式,计算所述标准轮廓中各所述相邻的两个像素之间的空间距离,并汇总形成标准距离向量;及通过提取所述对比轮廓中相邻的两个像素的对比向量,计算两个所述对比向量之间的欧式距离得到所述相邻的两个像素之间的空间距离的方式,计算所述对比轮廓中各所述相邻的两个像素之间的空间距离,并汇总形成对比距离向量;
    计算所述标准距离向量和所述对比距离向量之间的欧式距离或余弦相似度获得对比相似值,所述对比相似值表征了所述标准轮廓和所述对比轮廓的差异;判断所述对比相似值是否超过预置的相似阈值;若是,则判定所述标准目标和所述对比目标不同;若否,则判定所述标准目标和所述对比目标相同;
    所述计算所述标准距离向量和所述对比距离向量之间的欧式距离或余弦相似度获得对比相似值之后,所述方法包括:
    将所述对比相似值上传至区块链中。
  15. 一种计算机可读存储介质,所述可读存储介质上存储有计算机程序,其中,所述可读存储介质存储的所述计算机程序被处理器执行时实现所述图像目标对比方法,
    所述图像目标对比方法的步骤,包括:
    获取标准图像和对比图像;
    裁剪所述标准图像中展示有标准目标的区域形成标准运算图像,及裁剪所述对比图像中展示有所述对比目标的区域得到对比运算图像;
    提取所述标准运算图像中的标准目标,及提取所述对比运算图像中的对比目标;
    获取所述标准目标的标准轮廓,及所述对比目标的对比轮廓;
    对比所述标准轮廓和所述对比轮廓的差异,根据所述差异判断所述标准目标和所述对比目标是否相同。
  16. 根据权利要求15所述的可读存储介质,其中,所述提取所述标准运算图像中的标准目标,及提取所述对比运算图像中的对比目标之前,所述方法还包括:
    调整所述标准运算图像和所述对比运算图像的尺寸,使所述标准运算图像和所述对比运算图像的尺寸一致。
  17. 根据权利要求15所述的可读存储介质,其中,所述提取所述标准运算图像中的标准目标,及提取所述对比运算图像中的对比目标之前,所述方法还包括:
    提升所述标准运算图像和所述对比运算图像的清晰度,以突出所述标准目标和所述对比目标的轮廓边界;
    所述提升所述标准运算图像和所述对比运算图像的清晰度的步骤,包括:
    获取预置的参考图像,分别将所述标准运算图像、对比运算图像及所述参 考图像的RGB色彩空间转换到lαβ色彩空间,以分别形成标准转换图像、对比转换图像和参考转换图像;其中,所述参考图像是能够将其中参考目标进行突出展示的图像信息;
    计算所述标准转换图像中各像素的lαβ色彩空间坐标的第一均值和第一标准差,及所述对比转换图像中各像素的lαβ色彩空间坐标的第二均值和第二标准差,及所述参考转换图像中各像素的lαβ色彩空间坐标的参考均值和参考标准差;
    根据所述参考均值、所述参考标准差、所述第一均值和所述第一标准差对所述标准运算图像的像素进行调整,以提升所述标准运算图像的清晰度;根据所述参考均值、所述参考标准差、所述第二均值和所述第二标准差对所述对比运算图像进行调整,以提升所述对比运算图像的清晰度。
  18. 根据权利要求17所述的可读存储介质,其中,所述根据所述参考均值、所述参考标准差、所述第一均值和所述第一标准差对所述标准运算图像的像素进行调整的步骤,包括:
    将所述标准运算图像中任一像素设为第一目标像素,提取第一目标像素的lαβ色彩空间坐标;
    将所述lαβ色彩空间坐标与所述第一均值相减后,与所述第一标准差相除得到第一标准分数,所述第一标准分数反映了所述lαβ色彩空间坐标,在所述标准运算图像的所有像素的lαβ色彩空间坐标的正态分布中所处的相对位置;
    将所述第一标准分数与所述参考均值相乘得到的标准参考坐标,将所述标准参考坐标与所述参考标准差相加得到标准调整坐标;
    将所述第一目标像素的lαβ色彩空间坐标设为所述标准调整坐标,以对所述标准运算图像的第一目标像素进行调整;
    所述根据所述参考均值、所述参考标准差、所述第二均值和所述第二标准差对所述对比运算图像的像素进行调整的步骤,包括:
    将所述对比运算图像中任一像素设为第二目标像素,提取第二目标像素的lαβ色彩空间坐标;
    将所述lαβ色彩空间坐标与所述第二均值相减后,与所述第二标准差相除得到第二标准分数,所述第二标准分数反映了所述lαβ色彩空间坐标,在所述对比运算图像的所有像素的lαβ色彩空间坐标的正态分布中所处的相对位置;
    将所述第二标准分数与所述参考均值相乘得到的对比参考坐标,将所述对比参考坐标与所述参考标准差相加得到对比调整坐标;
    将所述第二目标像素的lαβ色彩空间坐标设为所述对比调整坐标,以对所述对比运算图像的第二目标像素进行调整。
  19. 根据权利要求15所述的可读存储介质,其中,所述提取所述标准运算图像中的标准目标,及提取所述对比运算图像中的对比目标的步骤,包括:
    将所述标准运算图像从RGB色彩空间转换到HSV色彩空间;
    将所述标准运算图像中任一像素设为第三目标像素,判断所述第三目标像素的HSV色彩空间是否属于预置的色彩阈值;若是,则将所述HSV色彩空间调整为预置的极低值;若否,则将所述HSV色彩空间调整为预置的极高值;
    从所述标准运算图像中获取HSV色彩空间为极低值的像素并汇总,得到所述标准目标;
    将所述对比运算图像从RGB色彩空间转换到HSV色彩空间;
    将所述对比运算图像中任一像素设为第四目标像素,判断所述第四目标像素的HSV色彩空间是否属于预置的色彩阈值;若是,则将所述HSV色彩空间调整为预置的极低值;若否,则将所述HSV色彩空间调整为预置的极高值;
    从所述对比运算图像中获取HSV色彩空间为极低值的像素并汇总,得到所述对比目标。
  20. 根据权利要求15所述的可读存储介质,其中,所述对比所述标准轮廓和所述对比轮廓的差异,根据所述差异判断所述标准目标和所述对比目标是否相同的步骤,包括:
    获取所述标准轮廓中各像素的标准向量,及所述对比轮廓中各像素的对比向量,将所述标准向量和所述对比向量录入所述识别神经网络,其中,所述标准向量表征了所述标准轮廓中像素的位置坐标,所述对比向量表征了所述对比轮廓中像素的位置坐标;
    调用所述识别神经网络通过提取所述标准轮廓中相邻的两个像素的标准向量,计算两个所述标准向量之间的欧式距离得到所述相邻的两个像素之间的空间距离的方式,计算所述标准轮廓中各所述相邻的两个像素之间的空间距离,并汇总形成标准距离向量;及通过提取所述对比轮廓中相邻的两个像素的对比向量,计算两个所述对比向量之间的欧式距离得到所述相邻的两个像素之间的空间距离的方式,计算所述对比轮廓中各所述相邻的两个像素之间的空间距离,并汇总形成对比距离向量;
    计算所述标准距离向量和所述对比距离向量之间的欧式距离或余弦相似度获得对比相似值,所述对比相似值表征了所述标准轮廓和所述对比轮廓的差异;判断所述对比相似值是否超过预置的相似阈值;若是,则判定所述标准目标和所述对比目标不同;若否,则判定所述标准目标和所述对比目标相同;
    所述计算所述标准距离向量和所述对比距离向量之间的欧式距离或余弦相似度获得对比相似值之后,所述方法包括:
    将所述对比相似值上传至区块链中。
PCT/CN2021/109284 2021-01-22 2021-07-29 图像目标对比方法、装置、计算机设备及可读存储介质 WO2022156178A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110086294.4 2021-01-22
CN202110086294.4A CN112784900A (zh) 2021-01-22 2021-01-22 图像目标对比方法、装置、计算机设备及可读存储介质

Publications (1)

Publication Number Publication Date
WO2022156178A1 true WO2022156178A1 (zh) 2022-07-28

Family

ID=75758479

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/109284 WO2022156178A1 (zh) 2021-01-22 2021-07-29 图像目标对比方法、装置、计算机设备及可读存储介质

Country Status (2)

Country Link
CN (1) CN112784900A (zh)
WO (1) WO2022156178A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116012860A (zh) * 2022-12-29 2023-04-25 华南师范大学 一种基于图像识别的教师板书设计水平诊断方法及装置

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112784900A (zh) * 2021-01-22 2021-05-11 深圳壹账通智能科技有限公司 图像目标对比方法、装置、计算机设备及可读存储介质
CN113591564B (zh) * 2021-06-24 2024-05-03 贵州国致科技有限公司 一种场景异常状态检测方法
CN113620614A (zh) * 2021-07-27 2021-11-09 深圳市若菲特科技有限公司 玻璃表面油墨去除方法、装置、设备及存储介质
CN113610866B (zh) * 2021-07-28 2024-04-23 上海墨说科教设备有限公司 练字图像的裁剪方法、装置、设备和存储介质
CN113406092B (zh) * 2021-08-18 2022-01-11 阿里巴巴(中国)有限公司 数字化生产检测系统、方法、装置、设备及存储介质
CN114466183A (zh) * 2022-02-21 2022-05-10 江东电子材料有限公司 基于特征光谱的铜箔瑕疵检测方法、装置和电子设备

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108197642A (zh) * 2017-12-25 2018-06-22 山东浪潮云服务信息科技有限公司 一种印章鉴别方法及装置
CN108469438A (zh) * 2018-03-20 2018-08-31 东莞市美盈森环保科技有限公司 一种印刷品检测方法、装置、设备及存储介质
US10108870B1 (en) * 2018-01-10 2018-10-23 Ezee Steve, Llc Biometric electronic signatures
CN110136123A (zh) * 2019-05-17 2019-08-16 无锡睿勤科技有限公司 物品检测方法、移动终端及计算机可读存储介质
CN110472623A (zh) * 2019-06-29 2019-11-19 华为技术有限公司 图像检测方法、设备以及系统
CN112784900A (zh) * 2021-01-22 2021-05-11 深圳壹账通智能科技有限公司 图像目标对比方法、装置、计算机设备及可读存储介质

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108197642A (zh) * 2017-12-25 2018-06-22 山东浪潮云服务信息科技有限公司 一种印章鉴别方法及装置
US10108870B1 (en) * 2018-01-10 2018-10-23 Ezee Steve, Llc Biometric electronic signatures
CN108469438A (zh) * 2018-03-20 2018-08-31 东莞市美盈森环保科技有限公司 一种印刷品检测方法、装置、设备及存储介质
CN110136123A (zh) * 2019-05-17 2019-08-16 无锡睿勤科技有限公司 物品检测方法、移动终端及计算机可读存储介质
CN110472623A (zh) * 2019-06-29 2019-11-19 华为技术有限公司 图像检测方法、设备以及系统
CN112784900A (zh) * 2021-01-22 2021-05-11 深圳壹账通智能科技有限公司 图像目标对比方法、装置、计算机设备及可读存储介质

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116012860A (zh) * 2022-12-29 2023-04-25 华南师范大学 一种基于图像识别的教师板书设计水平诊断方法及装置
CN116012860B (zh) * 2022-12-29 2024-01-16 华南师范大学 一种基于图像识别的教师板书设计水平诊断方法及装置

Also Published As

Publication number Publication date
CN112784900A (zh) 2021-05-11

Similar Documents

Publication Publication Date Title
WO2022156178A1 (zh) 图像目标对比方法、装置、计算机设备及可读存储介质
US10699146B2 (en) Mobile document detection and orientation based on reference object characteristics
US10248954B2 (en) Method and system for verifying user identity using card features
US9311531B2 (en) Systems and methods for classifying objects in digital images captured using mobile devices
US11354917B2 (en) Detection of fraudulently generated and photocopied credential documents
US8983200B2 (en) Object segmentation at a self-checkout
KR102406432B1 (ko) 신원 인증 방법 및 장치, 전자 기기 및 저장 매체
US20160026861A1 (en) Methods and apparatus for capturing, processing, training, and detecting patterns using pattern recognition classifiers
CN111353497B (zh) 一种身份证信息的识别方法和装置
US20170109610A1 (en) Building classification and extraction models based on electronic forms
US11263441B1 (en) Systems and methods for passive-subject liveness verification in digital media
CN108256591B (zh) 用于输出信息的方法和装置
CN108090511B (zh) 图像分类方法、装置、电子设备及可读存储介质
US11373449B1 (en) Systems and methods for passive-subject liveness verification in digital media
WO2022246989A1 (zh) 一种数据识别方法、装置、设备及可读存储介质
CN110795714A (zh) 一种身份验证方法、装置、计算机设备及存储介质
WO2022134831A1 (zh) 证件图片生成方法、装置、设备及存储介质
CN112330331A (zh) 基于人脸识别的身份验证方法、装置、设备及存储介质
CN112396047B (zh) 训练样本生成方法、装置、计算机设备和存储介质
CN112418180A (zh) 表格数据提取方法、装置、设备及计算机存储介质
CN110895811A (zh) 一种图像篡改检测方法和装置
CN110991434A (zh) 自助终端证件识别方法及装置
CN111488811B (zh) 人脸识别方法、装置、终端设备及计算机可读介质
CN114663418A (zh) 图像处理的方法及装置、存储介质及电子设备
CN114049646A (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: 21920559

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 27.10.2023)

122 Ep: pct application non-entry in european phase

Ref document number: 21920559

Country of ref document: EP

Kind code of ref document: A1