Method and device for detecting target in image and computer equipment

Through the size transformation, pixel value filling, and image enhancement of the original image, the problem of inaccurate target detection in the image in the existing technology has been solved, and the accurate positioning and number distribution of the user position of the number machine have been realized. Efficiency.

CN119359999APending Publication Date: 2025-01-24BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411503715.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-25
Publication Date
2025-01-24

AI Technical Summary

Technical Problem

The prior art cannot achieve accurate object detection in terms of object detection in images, resulting in the numbering machine being unable to accurately move to the user for number distribution.

Method used

By performing size transformation, pixel value filling, and image enhancement of the original image, the image after the second update is generated to accurately determine the coordinates of the target detection point.

Benefits of technology

The accurate positioning of the target detection point in the image is achieved to ensure that the exhaust machine can accurately move to the user to distribute the number, which improves the efficiency of business processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119359999A_ABST
    Figure CN119359999A_ABST
Patent Text Reader

Abstract

The invention relates to a method and a device for detecting a target in an image and computer equipment in the technical field of artificial intelligence. The method comprises the steps that when it is detected that a user enters a preset business handling area, an original image of the environment where the user is located and pixel values of all pixel points in the original image are acquired; performing size transformation on the original image to obtain a to-be-processed image; obtaining a second pixel value of each pixel point in the to-be-processed image based on the pixel value, and updating the to-be-processed image based on the second pixel value; performing image enhancement on the updated to-be-processed image to obtain a secondarily updated image; and determining each target detection point in the secondarily updated image, and determining coordinates of each target detection point. By adopting the method, the target in the image can be accurately detected.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a method, apparatus, computer equipment, storage medium and computer program product for detecting objects in images. Background Art

[0002] With the development of artificial intelligence technology, many smart devices have been used in the daily work of banks, bringing great convenience to the bank's business operations.

[0003] At present, taking the case where a user needs to handle business at a bank as an example, when the user enters the bank, he or she will obtain the number corresponding to himself or herself, and queue up according to the obtained number to wait for business processing. In the process of queuing numbers in the bank, a queuing machine is generally used. It can be equipped with a camera. The camera captures the image of the user entering the bank, and directly determines the target detection point in the image based on the captured image, where the target monitoring point is each user who is handling business. The distance between the target detection point where the user is located in the image and the queuing device is determined based on the positioning model to obtain the target detection result; based on the target detection result, the movement of the queuing machine is controlled to distribute numbers, so that users can queue up according to the obtained numbers, replacing the manual separation in traditional technology, and can more efficiently handle business.

[0004] However, this method of object detection in images still cannot perform accurate object detection, so that the number-taking machine cannot accurately obtain movement trajectory data, and thus cannot accurately move to the side of the user to distribute numbers. Summary of the invention

[0005] Based on this, it is necessary to provide an accurate method, device, computer equipment, computer-readable storage medium and computer program product for detecting targets in images in order to solve the above technical problems.

[0006] In a first aspect, the present application provides a method for detecting an object in an image, comprising:

[0007] When it is detected that a user enters a preset business handling area, an original image of the user's environment and a pixel value of each pixel in the original image are obtained;

[0008] Resizing the original image to obtain an image to be processed;

[0009] Based on the pixel value, obtaining a second pixel value of each pixel in the image to be processed, and based on the second pixel value, updating the image to be processed;

[0010] Performing image enhancement on the updated image to be processed to obtain a second updated image;

[0011] Determine each target detection point in the second updated image, and determine the coordinates of each target detection point.

[0012] In one embodiment, obtaining the second pixel value of each pixel in the image to be processed based on the pixel value includes:

[0013] Based on the pixel value, a third pixel value corresponding to a second pixel point is obtained, where the second pixel point is a pixel point whose pixel value among the pixels in the image to be processed corresponds to the pixel value of the pixels in the original image;

[0014] Determine a pixel point to be sampled, and determine a fifth pixel value of the pixel point to be sampled;

[0015] The pixel points to be sampled are pixel points whose pixel values ​​are not determined in the image to be processed;

[0016] Based on the fifth pixel value and the third pixel value, a second pixel value of each pixel in the image to be processed is obtained.

[0017] In one embodiment, determining the fifth pixel value of the pixel to be sampled includes:

[0018] Generate a plurality of rectangular areas with the pixel point to be sampled as a reference and the second pixel point as a rectangular vertex;

[0019] Selecting a minimum rectangular area among the multiple rectangular areas, and obtaining a target vertex pixel point corresponding to the minimum rectangular area;

[0020] A fourth pixel value of the target vertex pixel is obtained, and a fifth pixel value of the pixel to be sampled is determined based on the fourth pixel value.

[0021] In one embodiment, determining the fifth pixel value of the pixel to be sampled based on the fourth pixel value comprises:

[0022] Obtain the target vertex coordinates of the target vertex pixel point and the coordinates to be sampled of the pixel point to be sampled;

[0023] Determine the fourth coordinate according to the target vertex coordinate and the coordinate to be sampled; the fourth coordinate has the same ordinate as the target vertex coordinate and the same abscissa as the coordinate to be sampled; obtain a sixth pixel value of the fourth coordinate based on the target vertex coordinate, the coordinate to be sampled and the fourth pixel value;

[0024] Based on the target vertex coordinates, the coordinates to be sampled and the sixth pixel value, a fifth pixel value of the pixel to be sampled is obtained.

[0025] In one embodiment, updating the image to be processed based on the second pixel value comprises:

[0026] The sixth pixel value and the fifth pixel value are subjected to filtering and smoothing processing to update the image to be processed.

[0027] In one embodiment, after determining the coordinates of each target detection point, the method further includes:

[0028] Based on the coordinates of each of the target detection points, determining the distance to each of the target detection points;

[0029] Selecting a target detection point corresponding to the minimum distance, and determining a moving destination based on the coordinates of the selected target detection point;

[0030] The movement trajectory data is generated according to the movement destination.

[0031] In a second aspect, the present application further provides a device for detecting an object in an image, the device comprising:

[0032] The original data acquisition module is used to acquire the original image of the user's environment and the pixel value of each pixel in the original image when detecting that the user enters the preset business handling area;

[0033] A size conversion module, used for performing size conversion on the original image to obtain an image to be processed;

[0034] An image updating module, configured to obtain a second pixel value of each pixel in the image to be processed based on the pixel value, and update the image to be processed based on the second pixel value;

[0035] An image enhancement module is used to perform image enhancement on the updated image to be processed to obtain a second updated image;

[0036] The coordinate acquisition module is used to determine each target detection point in the image after the second update, and determine the coordinates of each target detection point.

[0037] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0038] When it is detected that a user enters a preset business handling area, an original image of the user's environment and a pixel value of each pixel in the original image are obtained;

[0039] Resizing the original image to obtain an image to be processed;

[0040] Based on the pixel value, obtaining a second pixel value of each pixel in the image to be processed, and based on the second pixel value, updating the image to be processed;

[0041] Performing image enhancement on the updated image to be processed to obtain a second updated image;

[0042] Determine each target detection point in the second updated image, and determine the coordinates of each target detection point.

[0043] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:

[0044] When it is detected that a user enters a preset business handling area, an original image of the user's environment and a pixel value of each pixel in the original image are obtained;

[0045] Resizing the original image to obtain an image to be processed;

[0046] Based on the pixel value, obtaining a second pixel value of each pixel in the image to be processed, and based on the second pixel value, updating the image to be processed;

[0047] Performing image enhancement on the updated image to be processed to obtain a second updated image;

[0048] Determine each target detection point in the second updated image, and determine the coordinates of each target detection point.

[0049] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:

[0050] When it is detected that a user enters a preset business handling area, an original image of the user's environment and a pixel value of each pixel in the original image are obtained;

[0051] Resizing the original image to obtain an image to be processed;

[0052] Based on the pixel value, obtaining a second pixel value of each pixel in the image to be processed, and based on the second pixel value, updating the image to be processed;

[0053] Performing image enhancement on the updated image to be processed to obtain a second updated image;

[0054] Determine each target detection point in the second updated image, and determine the coordinates of each target detection point.

[0055] The above-mentioned method, apparatus, computer device, storage medium and computer program product for detecting targets in images can accurately pre-process the original image and more accurately obtain the coordinates of each target detection point from the image after secondary update, thereby realizing accurate target detection in the image, by resizing the original image, filling the pixel values ​​of the resized image to make the pixels in the resized image continuous, and enhancing the image. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0057] Figure 1 A diagram showing an application environment of a method for detecting an object in an image in an embodiment;

[0058] FIG2 is a schematic diagram of a flow chart of a method for detecting an object in an image in one embodiment;

[0059] Figure 3 is a schematic diagram of a flow chart of a method for detecting an object in an image in another embodiment;

[0060] Figure 4 It is a schematic diagram of the principle of the bilinear interpolation method in a specific application example;

[0061] Figure 5 It is a schematic diagram of a positioning model in a specific application example;

[0062] Figure 6 It is a flowchart of a method for detecting an object in an image in a specific application example;

[0063] Figure 7 is a structural block diagram of a device for detecting an object in an image in an embodiment;

[0064] FIG. 8 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0065] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0066] The method for detecting an object in an image provided by the embodiment of the present application can be applied to Figure 1In the application environment shown, the number-picking machine 102 is equipped with an image processing device 104 , and the image processing device 104 includes an image acquisition module 106 and a control module 108 .

[0067] When the image acquisition module 106 on the image processing device 104 detects that the user enters the preset business handling area, the original image of the user's environment is collected, and based on the original image of the user's environment, a target detection request is generated. The image acquisition module 106 sends the target detection request to the control module 108, and the control module 108 obtains the original image of the user's environment, determines the pixel value of each pixel in the original image; performs a size transformation on the original image to obtain the image to be processed; based on the pixel value, obtains the second pixel value of each pixel in the image to be processed, and based on the second pixel value, updates the image to be processed; performs image enhancement on the updated image to be processed to obtain a second updated image; determines each target detection point in the second updated image, and determines the coordinates of each target detection point. Further, the control module 108 generates trajectory data based on the coordinates of the target detection point, and controls the entire number-picking machine 102 to move to the target (user) position corresponding to the target detection point based on the trajectory data.

[0068] In an exemplary embodiment, as shown in FIG2 , a method for detecting an object in an image is provided, wherein the method is applied to Figure 1 The control module 108 in the image processing device in the embodiment is taken as an example to illustrate, including the following S100 to S500. Among them:

[0069] S100, when it is detected that a user enters a preset business handling area, an original image of the environment where the user is located and a pixel value of each pixel in the original image are obtained.

[0070] Specifically, when the image acquisition module detects that the user enters the preset business handling area, it collects the original image of the user's environment, and based on the original image of the user's environment, generates a target detection request, and the image acquisition module sends the original image of the user's environment to the control module, and the control module obtains the original image of the user's environment and determines the pixel value of each pixel in the original image. Furthermore, a pixel is the basic unit in digital image processing, and the coordinate value of a pixel in the coordinate system of the image is an integer.

[0071] S200, resizing the original image to obtain an image to be processed.

[0072] Specifically, in order to increase the rate of target detection in the image, an image downsampling method can be used. Therefore, the control module performs a size transformation on the original image to obtain a size-transformed image. Generally, in order to achieve image downsampling, the size transformation in this application generally refers to size scaling. Further, the principle of image downsampling is to reduce the number of sampling points in the image, but since the number of sampling points in the image is reduced, the quality of the image will be reduced. Therefore, it is necessary to enhance the image quality after the size transformation to a certain extent. Currently available image quality enhancement methods include: nearest neighbor interpolation downsampling method, but the coordinates of the pixel points obtained by the nearest neighbor interpolation downsampling method are not necessarily integers, but may be floating point numbers. At this time, the image will have problems such as image interruption, discontinuous pixels, and distortion. Therefore, while performing image quality enhancement, it is also necessary to supplement the pixel values ​​of the interrupted pixels in the image to be processed.

[0073] S300, obtaining a second pixel value of each pixel in the image to be processed based on the pixel value, and updating the image to be processed based on the second pixel value.

[0074] Specifically, the pixel value of each pixel in the image to be processed can be determined based on the pixel value of each pixel in the original image. That is, based on the pixel value of each pixel in the original image, a second pixel value of each pixel in the image to be processed is obtained; based on the second pixel value, the image to be processed is updated. Furthermore, the pixel value of each pixel in the image to be processed cannot be directly obtained based on the pixel value of the pixel in the original image. For example, when the coordinates of the pixel in the image to be processed are not integers, the pixel value of the pixel in the original image needs to be analyzed and processed to obtain the pixel value of the corresponding pixel in the image to be processed. The analysis and processing method includes but is not limited to using a bilinear interpolation downsampling method to supplement the pixel value of the image to be processed.

[0075] S400, performing image enhancement on the updated image to be processed to obtain a second updated image.

[0076] Specifically, after the pixel values ​​of the image to be processed are supplemented, the problem of uneven light in the image needs to be solved to improve the efficiency of target detection. Specifically, the adaptive threshold method is used to enhance the updated image to be processed to obtain a second updated image. Among them, the adaptive threshold method may include a histogram equalization method. The obtained second updated image not only has uniform brightness of each pixel in the image, but also reduces noise, so that the target in the image can be detected more accurately.

[0077] S500, determining each target detection point in the image after the second update, and determining the coordinates of each target detection point.

[0078] Specifically, the control module is written with an improved AprilTag image recognition algorithm based on Openmv. By performing pixel supplementation and image enhancement processing on the image, the AprilTag image recognition algorithm based on Openmv can accurately determine each target detection point in the image after the secondary update, and determine the coordinates of each target detection point. Among them, when the preset business handling area is a bank branch, each target detection point can be each user entering the bank.

[0079] In the above-mentioned method for detecting targets in an image, during the whole process, by resizing the original image, filling the pixel values ​​of the resized image to make the pixels in the resized image continuous, and enhancing the image, the original image can be accurately preprocessed, and the coordinates of each target detection point can be more accurately obtained from the image after the second update, thereby achieving accurate target detection in the image.

[0080] In one embodiment, after acquiring the original image, the control module can also perform grayscale processing on the original image. The specific method includes: grayscale processing on the original image to obtain a grayscale image of the original image. Based on the grayscale image of the original image, the grayscale value in the grayscale image is obtained. Among them, when obtaining the grayscale value in the grayscale image based on the grayscale image of the original image, a grayscale calculation method with an accuracy of 7 bits or a grayscale calculation method with an accuracy of 8 bits can be used; and because the operation test effect of the grayscale calculation method with an accuracy of 7 bits is consistent with the test effect of the grayscale calculation method with an accuracy of 8 bits, but the operation speed of the grayscale calculation method with an accuracy of 7 bits is greater than that of the grayscale calculation method with an accuracy of 8 bits, therefore, in practical applications, the grayscale calculation method with an accuracy of 7 bits is mostly used to calculate the grayscale value of the grayscale image. The specific calculation expression of the grayscale value in the process of updating the color image to the grayscale image includes: Gray=(R*38+G*75+B*15)>>7.

[0081] In one embodiment, the updated image to be processed is enhanced, and the image obtained after the second update can be enhanced by using the histogram equalization method. The specific expression formula of the histogram equalization method is: . Wherein, w refers to the integral pseudo variable, s refers to the grayscale variable, r refers to the image grayscale, and Pr(r) refers to the probability density function of r. The grayscale value in the image to be processed is updated based on the specific expression formula of the histogram equalization method to enhance the updated image to be processed.

[0082] In an exemplary embodiment, Figure 3 As shown, S300 includes S320 to S380. Among them:

[0083] S320: Based on the pixel value, obtain a third pixel value corresponding to the second pixel.

[0084] The second pixel point is a pixel point whose pixel value among the pixel points in the image to be processed corresponds to the pixel value of the pixel points in the original image.

[0085] Specifically, in the original image, each pixel can be regarded as having corresponding coordinates. When the original image is resized to obtain the image to be processed, the coordinates of each pixel in the original image change, but the pixel values ​​of the pixels before and after the change remain unchanged, that is, the coordinates of the pixel change, but the pixel is still the pixel value corresponding to the pixel. For example, in the original image, the coordinates of a certain pixel are (2, 2), and the pixel value of the pixel is 2; when the original image is resized to obtain the image to be processed, the coordinates of the pixel are (1, 1), and the pixel value of the pixel is still 2, that is, the pixel value of the coordinate (2, 2) in the original image is 2, and the pixel value of the coordinate (1, 1) in the image to be processed is 2. Therefore, based on the pixel values ​​of each pixel in the original image, the third pixel value corresponding to the second pixel can be obtained. However, since the pixels in the image generally need to be integers, when the size transformation is rescaling, for example, in the original image, the coordinates of a pixel point are (3, 3), and after rescaling, the coordinates of the pixel point are (1.5, 1.5). At this time, the pixel value of the pixel point is not the pixel value of the corresponding pixel point in the original image, that is, the pixel value of the corresponding pixel point in the image to be processed cannot be directly determined by the pixel value of each pixel point in the original image.

[0086] S340, determining a pixel point to be sampled, and determining a fifth pixel value of the pixel point to be sampled.

[0087] The pixel points to be sampled are pixel points whose pixel values ​​are not determined in the image to be processed.

[0088] Specifically, the pixel points whose pixel values ​​in the image to be processed cannot be determined are used as the pixel points to be sampled, and these pixel points to be sampled need to be supplemented to obtain the fifth pixel value of the pixel points to be sampled. Further, based on the third pixel value, the bilinear interpolation downsampling method can be used to indirectly supplement the pixel values ​​of the pixel points to be sampled.

[0089] S360: Obtain a second pixel value of each pixel in the image to be processed based on the fifth pixel value and the third pixel value.

[0090] Specifically, on the basis of directly determining the third pixel value corresponding to the second pixel point in the image to be processed based on the pixel value of each pixel point in the original image, and determining the fifth pixel value of the pixel point to be sampled based on the third pixel value, the second pixel value of each pixel point in the image to be processed can be obtained based on the third pixel value and the fifth pixel value.

[0091] S380: Update the image to be processed based on the second pixel value.

[0092] Specifically, the second pixel value is used as the pixel value of each pixel point of the image to be processed to update the image to be processed.

[0093] In this embodiment, after the original image is resized to obtain the image to be processed, there will be an image interruption problem, that is, the pixel values ​​of some pixels in the image to be processed are missing. Therefore, it is necessary to supplement the pixel points with missing pixel values ​​in the image to be processed, so that the image to be processed can be processed more accurately and the quality of the image to be processed can be improved.

[0094] In one embodiment, determining the fifth pixel value of the pixel to be sampled includes:

[0095] Generate multiple rectangular areas with the pixel point to be sampled as a reference and the second pixel point as the rectangular vertex; select the smallest rectangular area among the multiple rectangular areas, and obtain the target vertex pixel point corresponding to the smallest rectangular area; obtain the fourth pixel value of the target vertex pixel point, and determine the fifth pixel value of the pixel point to be sampled based on the fourth pixel value.

[0096] Specifically, in the process of using the bilinear interpolation downsampling method to supplement pixel values, first, four pixels need to be selected from the pixels whose pixel values ​​have been determined in the image to be processed as the four vertices of the pixels to be sampled, and the pixel values ​​of the pixels to be sampled are determined by the pixel values ​​of the four pixels. Further, selecting four pixels as the four vertices of the pixels to be sampled means taking the coordinates of the pixels to be sampled as a reference and taking the coordinates of the second pixel as the vertices of a rectangle, that is, the selected four pixels need to generate a rectangular area taking the coordinates of the pixels to be sampled as a reference.

[0097] Since there can be many generated rectangular areas, in order to accurately determine the pixel value of the pixel to be sampled, the smallest rectangular area will be selected from the generated rectangular areas to reduce the error in the process of obtaining the pixel value of the pixel to be sampled. The four target vertex pixels corresponding to the smallest rectangular area are obtained. Since the target vertex pixel is determined based on the second coordinate pixel, the pixel value of the target vertex pixel is known, and the fourth pixel value of the target vertex pixel is obtained. The fifth pixel value of the pixel to be sampled in the middle of the rectangular area can be determined by the fourth pixel value.

[0098] In this embodiment, by determining the smallest rectangular area among multiple rectangular areas generated with the second pixel point as the rectangular vertex and taking the pixel point to be sampled as the reference, it is possible to accurately determine how to determine the target vertex pixel point that can calculate the pixel value of the pixel point to be sampled, thereby achieving the accurate acquisition of the pixel value of the pixel point to be sampled based on the third pixel value corresponding to the target vertex pixel point in the smallest rectangular area.

[0099] In an exemplary embodiment, it is also possible to check whether the target vertex pixel point is a vertex pixel point of a rectangular area based on the pixel point to be sampled. For example, the coordinates of the target vertex pixel point can be determined, and it is judged whether the correspondence between the coordinates of the four target vertex pixel points conforms to the preset coordinate correspondence of the rectangular area. For example, the preset coordinate correspondence of the rectangular area includes that the ordinates of the two vertices on the same horizontal line need to be consistent, and the abscissas of the two vertices on the same vertical line need to be consistent. In addition, it can also be determined by the difference in pixel values ​​corresponding to adjacent pixel points inside and outside the edge line of the rectangular area.

[0100] In an exemplary embodiment, determining the fifth pixel value of the pixel to be sampled based on the target vertex pixel and the fourth pixel value includes:

[0101] Obtain the target vertex coordinates of the target vertex pixel point and the coordinates to be sampled of the pixel point to be sampled; determine the fourth coordinate based on the target vertex coordinates and the coordinates to be sampled, and obtain the sixth pixel value of the fourth coordinate based on the target vertex coordinates, the coordinates to be sampled and the fourth pixel value; obtain the fifth pixel value of the pixel point to be sampled based on the target vertex coordinates, the coordinates to be sampled and the sixth pixel value.

[0102] The fourth coordinate is the same as the ordinate of the target vertex coordinate and the same as the abscissa of the coordinate to be sampled.

[0103] Specifically, the bilinear interpolation down-sampling method is used to determine the fifth pixel value of the pixel point to be sampled in the rectangular area through the pixel values ​​of the four target vertex pixels in the rectangular area. Figure 4 As shown, a rectangular coordinate system is established in the image to be processed to obtain the target vertex coordinates of the target vertex pixel and the to-be-sampled coordinates of the to-be-sampled pixel. Let the target vertex pixel be Q 11 , Q 12 , Q 21 , Q 22 ; The pixel to be sampled is P. Interpolate the target vertex pixel in the x-axis direction, that is, Q 11 With Q 21 Interpolate in the x-axis direction to determine the fourth coordinate R1 that is the same as the horizontal coordinate of the coordinate value to be sampled, and the vertical coordinate of the fourth coordinate is the same as Q 11 With Q 21 The vertical coordinates are the same; for Q 12 With Q 22 Interpolate in the x-axis direction to determine the fourth coordinate R2 that is the same as the horizontal coordinate of the coordinate value to be sampled, and the vertical coordinate of the fourth coordinate is the same as Q 12 With Q 22 The vertical coordinates are the same.

[0104] At this time, let the target vertex pixel Q 11 The coordinates are (x1, y1), the target vertex pixel Q 21 The coordinates are (x2, y1), the target vertex pixel Q 12 The coordinates are (x1, y2), the target vertex pixel Q 22 The coordinates of the vertex are (x2, y2) and the coordinates to be sampled are (x, y). Based on the target vertex coordinates, the coordinates to be sampled and the fourth pixel value, the sixth pixel values ​​f(R1) and f(R2) of the fourth coordinates R1 and R2 can be determined. The specific formula is: f(R1)≈(x2-x) / (x2-x1)*f(Q 11 )+(x-x1) / (x2-x1)*f(Q 21 ); f(R2)≈(x2-x) / (x2-x11)*f(Q 12 )+(x-x1) / (x2-x1)*f(Q 22 ).

[0105] Then, the fourth coordinate is interpolated on the y-axis to obtain the fifth pixel value f(P) of the pixel point to be sampled P. The specific formula is: f(P)≈(y2-y) / (y2-y1)*f(R1)+(y-y1) / (y2-y1)*f(R2).

[0106] In this embodiment, by using bilinear interpolation method on the values ​​of the pixel points around the pixel point to be sampled, the pixel value of the pixel point to be sampled can be accurately determined.

[0107] In an exemplary embodiment, updating the image to be processed based on the second pixel value includes:

[0108] The sixth pixel value and the fifth pixel value are filtered and smoothed to update the image to be processed.

[0109] Specifically, after determining the pixel value of the pixel to be sampled, it is necessary to perform a filtering operation on the fifth pixel value of the pixel to be sampled and the sixth pixel value corresponding to the fourth coordinate so that it becomes a smooth straight line, so that the pixels in the image to be processed are continuous.

[0110] In this embodiment, by performing filtering and smoothing processing on the sixth pixel value corresponding to the fourth coordinate and the fifth pixel value corresponding to the pixel point to be sampled, the pixel points in the image to be processed can be made continuous, thereby improving the quality of the image to be processed.

[0111] In an exemplary embodiment, after determining the coordinates of each target detection point, the method further includes:

[0112] Based on the coordinates of each target detection point, the distance to each target detection point is determined; the target detection point corresponding to the minimum distance is selected, and the moving destination is determined based on the coordinates of the selected target detection point; and the moving trajectory data is generated according to the moving destination.

[0113] Specifically, each target detection point determined in this application is the client itself. That is, the control module needs to first use the target detection algorithm to determine the object that needs to be detected in the image to be processed, and use the positioning model to determine the distance between itself and the target detection object. The positioning model used in this application is the AprilTag positioning model, such as Figure 5 The positioning model is used to analyze the target detection point. The positioning model can establish a three-dimensional rectangular coordinate system with itself as the origin, and the positioning model outputs six variables in the serial port, including: T x 、T y 、T z are three spatial position quantities, R x , R y , R z In other words, the positioning model can determine the three-dimensional coordinates of each target detection point in the three-dimensional rectangular coordinate system and the rotation angle of each target detection point corresponding to the xyz axis of the three-dimensional rectangular coordinate system.

[0114] Based on the three-dimensional coordinates of each target detection point in the three-dimensional rectangular coordinate system and the rotation angle between each target detection point and the xyz axis of the three-dimensional rectangular coordinate system, the distance between itself and each target detection point can be determined by using the Pythagorean theorem for calculation.

[0115] The target detection point corresponding to the smallest distance from each target detection point is selected, and the coordinates of the target detection point are used as the moving destination to generate movement trajectory data. Furthermore, the movement trajectory data can be pushed to the mobile device on the number-queuing machine, instructing the number-queuing machine to move to the target detection point based on the movement trajectory data and distribute queue numbers to customers corresponding to the target detection point.

[0116] In this embodiment, by using images with better quality after preprocessing, the coordinates of each target detection point can be determined more accurately to obtain the distance to each target detection point, thereby determining the moving destination according to the size of the distance and accurately generating movement trajectory data.

[0117] In one embodiment, after determining the distance to each target detection point, since the distance calculated at this time is the distance in the three-dimensional rectangular coordinate system, the size ratio of the standard image and the image to be processed can also be used to obtain the actual distance. That is, a standard image can be first obtained, such as an image of a customer just entering the door, and the coordinates of the customer just entering the door in the standard image and the actual distance between the number-taking machine and the customer just entering the door are obtained to obtain the corresponding relationship between the coordinates and the distance, thereby determining the actual distance between the number-taking machine and the target detection point in the image to be processed based on the coordinates of the target detection point in the image to be processed.

[0118] In a specific application example, there are a camera system and a mobile device on the number-taking machine, and the camera system includes an image acquisition module and a control module. The improved AprilTag image recognition algorithm is written into the camera system to obtain a processed image with better image quality, thereby being able to more accurately calculate the customer distance and control the mobile device to actively move toward the customer to issue a number for him. Among them, the improved AprilTag image recognition algorithm includes a detection part and a decryption part. Specifically, the improved AprilTag image recognition algorithm is used to perform a method for detecting targets in an image, such as Figure 6 As shown, including:

[0119] S1. Get the original image of AprilTag.

[0120] S2. Preprocess the original AprilTag image to obtain the target image. The preprocessing steps include: grayscale processing of color images, bilinear interpolation downsampling processing, and adaptive threshold image enhancement processing. Among them, the adaptive threshold image enhancement processing includes histogram equalization method. In addition, it also includes bilateral filtering processing.

[0121] S3, performing Canny edge detection, line segment detection and quadrilateral detection in the target image to obtain a quadrilateral image in the target image. The quadrilateral image is encrypted to be stored in a database. The encryption method includes encrypting the quadrilateral image using an improved fast wavelet transform technology.

[0122] S4. When a processing command is received, the encrypted quadrilateral image is obtained from the database, and matching, recognition and decoding processing is performed.

[0123] S5. Determine the target detection point from the decoded information, and use the positioning model to output the distance to the target detection point, that is, output the final detection result of the AprilTag original image.

[0124] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0125] Based on the same inventive concept, the embodiment of the present application also provides an image target detection device for implementing the above-mentioned image target detection method. The implementation solution provided by the device to solve the problem is similar to the implementation solution recorded in the above-mentioned method, so the specific limitations in one or more image target detection device embodiments provided below can refer to the limitations of the image target detection method above, and will not be repeated here.

[0126] In an exemplary embodiment, Figure 7 As shown, a device for detecting an object in an image is provided, comprising: an original data acquisition module 100, a size conversion module 200, an image update module 300, an image enhancement module 400 and a coordinate acquisition module 500, wherein:

[0127] The original data acquisition module 100 is used to acquire the original image of the user's environment and the pixel value of each pixel in the original image when detecting that the user enters the preset business processing area.

[0128] The size conversion module 200 is used to perform size conversion on the original image to obtain an image to be processed.

[0129] The image updating module 300 is used to obtain a second pixel value of each pixel in the image to be processed based on the pixel value, and update the image to be processed based on the second pixel value.

[0130] The image enhancement module 400 is used to perform image enhancement on the updated image to be processed to obtain a second updated image.

[0131] The coordinate acquisition module 500 is used to determine each target detection point in the image after the second update, and determine the coordinates of each target detection point.

[0132] In one embodiment, the image update module 300 is also used to obtain a third pixel value corresponding to a second pixel point based on the pixel value, where the second pixel point is a pixel point whose pixel value among the pixels in the image to be processed corresponds to the pixel value of the pixels in the original image; determine the pixel point to be sampled, and determine the fifth pixel value of the pixel point to be sampled; the pixel point to be sampled is a pixel point in the image to be processed whose pixel value has not been determined; based on the fifth pixel value and the third pixel value, obtain the second pixel value of each pixel point in the image to be processed.

[0133] In one embodiment, the image update module 300 is also used to generate multiple rectangular areas based on the pixel point to be sampled and the second pixel point as the rectangular vertex; select the smallest rectangular area among the multiple rectangular areas, and obtain the target vertex pixel point corresponding to the smallest rectangular area; obtain the fourth pixel value of the target vertex pixel point, and determine the fifth pixel value of the pixel point to be sampled based on the fourth pixel value.

[0134] In one embodiment, the image update module 300 is also used to obtain the target vertex coordinates of the target vertex pixel point and the coordinates to be sampled of the pixel point to be sampled; determine the fourth coordinate according to the target vertex coordinates and the coordinates to be sampled; the fourth coordinate is the same as the longitudinal coordinate of the target vertex coordinate and the same as the horizontal coordinate of the coordinate to be sampled; based on the target vertex coordinates, the coordinates to be sampled and the fourth pixel value, obtain the sixth pixel value of the fourth coordinate; based on the target vertex coordinates, the coordinates to be sampled and the sixth pixel value, obtain the fifth pixel value of the pixel point to be sampled.

[0135] In one embodiment, the image updating module 300 is further configured to perform filtering and smoothing processing on the sixth pixel value and the fifth pixel value to update the image to be processed.

[0136] In one embodiment, the target detection device in the image also includes a mobile data acquisition module, which is used to determine the distance to each target detection point based on the coordinates of each target detection point; select the target detection point corresponding to the minimum distance, and determine the moving destination based on the coordinates of the selected target detection point; and generate moving trajectory data according to the moving destination.

[0137] Each module in the above-mentioned device for detecting objects in an image can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module above.

[0138] In an exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be shown in FIG8. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface is connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data such as original images and images to be processed. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a method for detecting a target in an image is implemented.

[0139] Those skilled in the art will understand that the structure shown in FIG. 8 is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0140] In an exemplary embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.

[0141] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0142] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0143] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0144] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0145] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0146] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A method for detecting an object in an image, characterized in that: The method comprises: When it is detected that a user enters a preset business handling area, an original image of the user's environment and a pixel value of each pixel in the original image are obtained; Resizing the original image to obtain an image to be processed; Based on the pixel value, obtaining a second pixel value of each pixel in the image to be processed, and based on the second pixel value, updating the image to be processed; Performing image enhancement on the updated image to be processed to obtain a second updated image; Determine each target detection point in the second updated image, and determine the coordinates of each target detection point.

2. The method according to claim 1, characterized in that The obtaining, based on the pixel value, a second pixel value of each pixel in the image to be processed comprises: Based on the pixel value, a third pixel value corresponding to a second pixel point is obtained, where the second pixel point is a pixel point whose pixel value among the pixels in the image to be processed corresponds to the pixel value of the pixels in the original image; Determine a pixel point to be sampled, and determine a fifth pixel value of the pixel point to be sampled; The pixel points to be sampled are pixel points whose pixel values ​​are not determined in the image to be processed; Based on the fifth pixel value and the third pixel value, a second pixel value of each pixel in the image to be processed is obtained.

3. The method according to claim 2, characterized in that The determining the fifth pixel value of the pixel to be sampled comprises: Generate a plurality of rectangular areas with the pixel point to be sampled as a reference and the second pixel point as a rectangular vertex; Selecting a minimum rectangular area among the multiple rectangular areas, and obtaining a target vertex pixel point corresponding to the minimum rectangular area; A fourth pixel value of the target vertex pixel is obtained, and a fifth pixel value of the pixel to be sampled is determined based on the fourth pixel value.

4. The method according to claim 3, characterized in that The determining, based on the fourth pixel value, a fifth pixel value of the pixel to be sampled comprises: Obtain the target vertex coordinates of the target vertex pixel point and the coordinates to be sampled of the pixel point to be sampled; Determine a fourth coordinate according to the target vertex coordinate and the coordinate to be sampled; the fourth coordinate is the same as the ordinate of the target vertex coordinate and the same as the abscissa of the coordinate to be sampled; obtain a sixth pixel value of the fourth coordinate based on the target vertex coordinate, the coordinate to be sampled and the fourth pixel value; Based on the target vertex coordinates, the coordinates to be sampled and the sixth pixel value, a fifth pixel value of the pixel to be sampled is obtained.

5. The method according to claim 4, characterized in that The updating of the image to be processed based on the second pixel value comprises: The sixth pixel value and the fifth pixel value are subjected to filtering and smoothing processing to update the image to be processed.

6. The method according to claim 1, characterized in that After determining the coordinates of each target detection point, the method further includes: Based on the coordinates of each of the target detection points, determining the distance to each of the target detection points; Selecting a target detection point corresponding to the minimum distance, and determining a moving destination based on the coordinates of the selected target detection point; The movement trajectory data is generated according to the movement destination.

7. A device for detecting an object in an image, characterized in that: The device comprises: The original data acquisition module is used to acquire the original image of the user's environment and the pixel value of each pixel in the original image when detecting that the user enters the preset business handling area; A size conversion module, used for performing size conversion on the original image to obtain an image to be processed; An image updating module, configured to obtain a second pixel value of each pixel in the image to be processed based on the pixel value, and update the image to be processed based on the second pixel value; An image enhancement module is used to perform image enhancement on the updated image to be processed to obtain a second updated image; The coordinate acquisition module is used to determine each target detection point in the image after the second update, and determine the coordinates of each target detection point.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.