Cigarette case detection method and system
By adopting a combination of global cameras and micro cameras in the object detection system, and using coordinate offset correction technology, the problem of different positioning of three-dimensional targets is solved, improving the accuracy of image and the accuracy of authenticity detection.
Patent Information
- Application Number
- CN202110090781.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-22
- Publication Date
- 2025-07-01
- Estimated Expiration
- 2041-01-22
AI Technical Summary
When collecting microscopic images of three-dimensional targets, due to the slope of the edge corner points of the target, there is a difference in positioning of corner points in the global image and the microscopic image, resulting in coordinate conversion errors, which in turn affects the accuracy of the microscopic image.
An object detection method is adopted to collect the global image of the target through a global camera, determine the coordinates of the corner points in the target and the relative coordinates of the area to be photographed, and combine the coordinate mapping relationship of the micro camera to perform coordinate offset correction to ensure the accuracy of the image acquired by the micro camera.
Through coordinate offset correction, the accuracy of the microscopic image is improved and the accuracy of the detection results of whether the target object is a genuine product is enhanced.
Smart Images

Figure CN114881911B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of image acquisition, particularly to an object detection method and system, especially for cigarette cases. Background Art
[0002] In related technologies, when acquiring a microscopic image of a specified area of a target, generally, a global image of the target needs to be acquired first by using a global camera, and the coordinates of the specified area in the global image are determined. Then, the coordinates of the specified area in the global image are converted into target coordinates for the microscopic image, so as to acquire the microscopic image at the target coordinates by using a microscopic camera.
[0003] However, in an actual scenario, there is a certain slope at the edge corner points of a three-dimensional target, resulting in differences in the positioning of corner points in the global image and the microscopic image, thus causing errors in the coordinate conversion between the global image and the microscopic image, and ultimately resulting in inaccurate microscopic images of the specified area being acquired. Summary of the Invention
[0004] The purpose of the embodiments of the present application is to provide an object detection method and system to improve the accuracy of the acquired microscopic images. The specific technical solutions are as follows:
[0005] In a first aspect, the embodiments of the present application provide an object detection method applied to an object detection system. The system includes a first detection device and a second detection device. The first detection device includes a global camera and a first microscopic camera, and the second detection device includes a second microscopic camera. The method includes:
[0006] Obtain a global image including a first object acquired by the global camera, where the first object is an object with sloped edge corner points;
[0007] In the global image, determine the coordinates of a first corner point in the first object and the relative coordinates of a target sub-region to be microscopically photographed in the first object relative to the first corner point;
[0008] According to the coordinate mapping relationship between the global camera and the first microscopic camera, and the coordinates of the first corner point, control the center of the first microscopic camera to move to the coordinates of the first corner point, and acquire a first microscopic image by using the first microscopic camera;
[0009] In the first microscopic image, determine the coordinates of an outer corner point corresponding to the first corner point of the first object, and calculate the coordinate offset of the outer corner point coordinates in the first microscopic image relative to the center of the first microscopic image;
[0010] Obtain a second microscopic image collected by the second microscopic camera, which includes the first corner point of the first object. In the second microscopic image, determine the coordinates of the outer corner point corresponding to the first corner point of the first object;
[0011] According to the coordinates of the outer corner points in the second microscopic image, the relative coordinates, and the coordinate offset, determine the target coordinates for the second microscopic camera to collect the image of the target sub-region, so that the second microscopic camera moves to the target coordinates to collect the target microscopic image of the target sub-region;
[0012] Based on the target microscopic image and the features of the true-value microscopic images stored in the database for indicating genuine products, determine whether the first object is a genuine product.
[0013] In a possible implementation manner, the determining the coordinates of the first corner point in the first object and the relative coordinates of the target sub-region to be microscopically photographed in the first object with respect to the first corner point in the global image includes:
[0014] Perform foreground-background segmentation on the global image and perform foreground edge fitting to obtain the target foreground region of the first object and the coordinates of the first corner point of the target foreground region;
[0015] Determine the target sub-region to be microscopically photographed in the target foreground region, and determine the relative coordinates of the target sub-region and the first corner point.
[0016] In a possible implementation manner, the determining the target sub-region to be microscopically photographed in the target foreground region and determining the relative coordinates of the target sub-region and the first corner point includes:
[0017] Divide the target foreground region into multiple sub-regions, and extract the texture features of each sub-region;
[0018] Select each sub-region whose texture features meet the preset texture rules to obtain each target sub-region;
[0019] Calculate the coordinates of the center points of each target sub-region respectively to obtain the coordinates of each target sub-region;
[0020] According to the coordinates of each target sub-region and the coordinates of the first corner point in the global image, calculate the relative coordinates of each target sub-region and the first corner point respectively.
[0021] In a possible implementation manner, determining the target coordinates at which the second microscopic camera captures an image of the target sub-region according to the coordinates of the outer corner points in the second microscopic image, the relative coordinates, and the coordinate offset amount, so that the second microscopic camera moves to the target coordinates to capture the target microscopic image of the target sub-region includes:
[0022] Determining the coordinates of the inner corner points in the second microscopic image according to the coordinates of the outer corner points in the second microscopic image and the coordinate offset amount:
[0023] Determining the coordinates of the target sub-region in the second microscopic image according to the coordinates of the inner corner points in the second microscopic image and the relative coordinates, to obtain target coordinates;
[0024] Moving the second microscopic camera to the target coordinates, so that the second microscopic camera moves to the target coordinates to capture the target microscopic image of the target sub-region.
[0025] In a possible implementation manner, in the first microscopic image, determining the coordinates of the outer corner points corresponding to the first corner point of the first object, and calculating the coordinate offset amount of the coordinates of the outer corner points in the first microscopic image relative to the center of the first microscopic image includes:
[0026] Performing foreground-background segmentation on the first microscopic image and performing foreground edge fitting to obtain the coordinates of the outer corner points corresponding to the first corner point in the first microscopic image;
[0027] Obtaining the coordinates of the center of the first microscopic image, and calculating the coordinates of the outer corner points in the first microscopic image relative to the center of the first microscopic image to obtain the coordinate offset amount.
[0028] In a possible implementation manner, selecting each sub-region whose texture feature satisfies a preset texture rule to obtain each target sub-region includes:
[0029] Among each of the sub-regions, selecting the top n sub-regions with the highest texture feature richness as each target sub-region.
[0030] In a possible implementation manner, performing foreground-background segmentation on the global image and performing foreground edge fitting to obtain the target foreground region of the first object and the coordinates of the first corner point of the target foreground region includes:
[0031] Performing Gaussian pre-filtering on the global image to obtain a first global image;
[0032] Converting the first global image to the YUV format to obtain a YUV global image;
[0033] Statistically calculate the mean value of the Y component, the mean value of the U component, and the mean value of the V component of the pixels within the specified background region of the YUV global image to obtain the background mean value;
[0034] Perform smoothing filtering on each channel of the YUV global image to obtain a second global image;
[0035] Calculate the normalized contrast of each pixel of the second global image with respect to the background mean value to obtain a normalized contrast histogram;
[0036] Determine an adaptive segmentation threshold based on the normalized contrast histogram;
[0037] Use the adaptive segmentation threshold to binarize the normalized contrast histogram Figure 2 to obtain an initial foreground region;
[0038] Fit the initial foreground region to obtain the target foreground region and the coordinates of the corner points of the specified corner of the target foreground region.
[0039] In a possible implementation manner, the performing smoothing filtering on each channel of the YUV global image to obtain a second global image includes:
[0040] Determine the histogram of the Y channel, the histogram of the U channel, and the histogram of the V channel of the YUV global image;
[0041] Determine each peak in the histogram of the Y channel and perform smoothing filtering to obtain the filtered histogram of the Y channel;
[0042] Determine each peak in the histogram of the U channel and perform smoothing filtering to obtain the filtered histogram of the U channel;
[0043] Determine each peak in the histogram of the V channel and perform smoothing filtering to obtain the filtered histogram of the V channel;
[0044] Based on the filtered histogram of the Y channel, the filtered histogram of the U channel, and the filtered histogram of the V channel, obtain a second global image.
[0045] In a possible implementation manner, performing Gaussian pre-filtering on the global image to obtain a first global image includes:
[0046] Perform Gaussian pre-filtering and convolution operation on the global image based on the following method to obtain a first global image:
[0047] I smooth = I * k(w, σ)
[0048] where, I smoothIt represents the first global image, k(w,σ) represents the Gaussian kernel with a filtering window of w and a standard deviation of σ, and I represents the convolution operation.
[0049] In a possible implementation, the step of statistically calculating the mean values of the Y component, U component, and V component of the pixels within a specified background region of the YUV global image to obtain the background mean value includes:
[0050] Statistically calculate the Y component, U component, and V component of each pixel within the edge width L of the YUV global image respectively, and calculate the mean values of the Y component, U component, and V component according to the following formula to obtain the background mean value:
[0051]
[0052]
[0053]
[0054] Among them, Y i,j represents the Y component of the pixel at the i-th row and j-th column, U i,j represents the U component of the pixel at the i-th row and j-th column, V i,j represents the V component of the pixel at the i-th row and j-th column, W represents the number of columns of the YUV global image, H represents the number of rows of the YUV global image, Y m represents the mean value of the Y component, U m represents the mean value of the U component, V m represents the mean value of the V component, and the background mean value is represented by Y m 、U m 、V m .
[0055] In a possible implementation, the first object is a cigarette case.
[0056] In a second aspect, an object detection device provided by an embodiment of the present application is applied to an object detection system. The system includes a first detection device and a second detection device. The first detection device includes a global camera and a first microscopic camera, and the second detection device includes a second microscopic camera; the device includes:
[0057] A global image acquisition module, configured to acquire a global image including a first object collected by the global camera, where the first object is an object with a slope at the edge corner points;
[0058] A corner coordinate determination module, configured to determine the coordinates of the first corner in the first object and the relative coordinates of the target sub-region to be microscopically photographed in the first object with respect to the first corner in the global image;
[0059] The first microscopic image acquisition module is configured to control the center of the first microscopic camera to move to the coordinates of the first corner point according to the coordinate mapping relationship between the global camera and the first microscopic camera and the coordinates of the first corner point, and acquire a first microscopic image captured by the first microscopic camera;
[0060] The coordinate offset determination module is configured to determine the coordinates of the outer corner point corresponding to the first corner point of the first object in the first microscopic image, and calculate the coordinate offset of the coordinates of the outer corner point in the first microscopic image relative to the center of the first microscopic image;
[0061] The second microscopic image acquisition module is configured to acquire a second microscopic image including the first corner point of the first object captured by the second microscopic camera;
[0062] The outer corner point coordinate determination module is configured to determine the coordinates of the outer corner point corresponding to the first corner point of the first object in the second microscopic image;
[0063] The target microscopic image acquisition module is configured to determine the target coordinates of the image of the target sub-region captured by the second microscopic camera according to the coordinates of the outer corner point in the second microscopic image, the relative coordinates, and the coordinate offset, so that the second microscopic camera moves to the target coordinates to acquire a target microscopic image of the target sub-region;
[0064] The object authenticity detection module is configured to determine whether the first object is genuine based on the target microscopic image and the features of the true microscopic image stored in the database indicating a genuine product.
[0065] In a third aspect, an embodiment of the present application provides an object detection system, including:
[0066] A controller, a first detection device, and a second detection device, where the first detection device includes a global camera and a first microscopic camera, and the second detection device includes a second microscopic camera;
[0067] The controller is configured to implement any of the object detection methods in the present application when running.
[0068] In a fourth aspect, an embodiment of the present application provides an electronic device, including a processor and a memory;
[0069] The memory is used to store a computer program;
[0070] The processor is configured to implement any of the object detection methods in the present application when executing the program stored in the memory.
[0071] Fifth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the object detection method described in any one of the present application is implemented.
[0072] Beneficial effects of the embodiments of the present application:
[0073] The object detection method and system provided by the embodiments of the present application obtain a global image including a first object collected by a global camera, where the first object is an object with a slope at the edge corner points; in the global image, determine the coordinates of the first corner point in the first object and the relative coordinates of the target sub-region to be microscopically photographed in the first object relative to the first corner point; according to the coordinate mapping relationship between the global camera and the first micro-camera and the first corner point coordinates, control the center of the first micro-camera to move to the first corner point coordinates, and collect a first micro-image by using the first micro-camera; in the first micro-image, determine the outer corner point coordinates corresponding to the first corner point of the first object, and calculate the coordinate offset of the outer corner point coordinates in the first micro-image relative to the center of the first micro-image; obtain a second micro-image including the first corner point of the first object collected by a second micro-camera; in the second micro-image, determine the outer corner point coordinates corresponding to the first corner point of the first object; according to the coordinates, relative coordinates and coordinate offset of the outer corner points in the second micro-image, determine the target coordinates for the second micro-camera to collect an image of the target sub-region, so that the second micro-camera moves to the target coordinates to collect a target micro-image of the target sub-region; based on the target micro-image and the characteristics of the true value micro-image stored in the database for indicating genuine products, determine whether the first object is genuine. Coordinate correction of the inner corner points and outer corner points is achieved by using coordinate offset, so as to improve the accuracy of the collected target micro-image, and finally increase the accuracy of the detection result of whether the first object is genuine. Of course, it is not necessary for any product or method implementing the present application to achieve all the above advantages at the same time. Description of the drawings
[0074] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0075] Figure 1a It is a schematic diagram of a corner point at the upper left corner of a cigarette case located in a global image by algorithm fitting in the related art;
[0076] Figure 1b It is a schematic diagram of a corner point at the upper left corner of a cigarette case located in a micro-image by algorithm fitting in the related art;
[0077] Figure 2 It is a schematic diagram of an object detection method according to an embodiment of the present application;
[0078] Figure 3 It is a schematic diagram of a possible implementation manner of step S102 in an embodiment of the present application;
[0079] Figure 4 It is a schematic diagram of a possible implementation manner of step S1021 in an embodiment of the present application;
[0080] Figure 5 It is a schematic diagram of a Y - component histogram of a YUV global image in an embodiment of the present application;
[0081] Figure 6 It is a schematic diagram of a possible implementation manner of step S1022 in an embodiment of the present application;
[0082] Figure 7 It is a schematic diagram of a possible implementation manner of step S107 in an embodiment of the present application;
[0083] Figure 8 It is a schematic diagram of an object detection system according to an embodiment of the present application;
[0084] Figure 9 It is a schematic diagram of an object detection device according to an embodiment of the present application;
[0085] Figure 10 It is a schematic diagram of an electronic device according to an embodiment of the present application. Detailed implementation manners
[0086] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
[0087] There will be a certain slope at the corner edge points of the target, resulting in differences in the positioning of corner points in the global image and the microscopic image. Taking a cigarette case as an example, see Figure 1a and Figure 1bAs shown in the figure, the corner point A at the upper left corner of the cigarette case in the global image is located by algorithm fitting. However, due to the certain slope of the edge corner points of the cigarette case, when directly using the microscopic camera to photograph the corner points of the cigarette case, two corner points will appear at the slope in the microscopic image. The corner point located by algorithm fitting in the microscopic image is B, while the corner point located in the global image is A. In this application, the corner point B is called the outer corner point, and the corner point A is called the inner corner point. When performing coordinate conversion between the global camera and the microscopic camera, due to the different corner points, there is an error of about 300 pixels between the microscopic image and the expected accurate image.
[0088] In view of this, an embodiment of this application provides an object detection method. Refer to Figure 2 , the method includes:
[0089] S101, obtain a global image including a first object collected by a global camera, where the first object is an object with a sloped edge corner point.
[0090] The object detection method of the embodiment of this application can be implemented by an electronic device. Specifically, the electronic device can be an intelligent camera, a computer, or a controller based on a SoC (System on Chip), etc. The object detection method of the embodiment of this application can also be implemented by multiple electronic devices together. For example, it can be implemented through a combination of a global camera, a microscopic camera, and a controller.
[0091] Utilize the global image including the first object collected by the global camera, and obtain this global image. The first object is any object that needs to be detected for authenticity. For example, it can be the packaging of a product, including but not limited to cigarette cases, wine boxes, cosmetic boxes, bottles, etc.
[0092] In one example, the global camera can be a lens of a conventional monitoring device. The global camera is used to photograph the global image of the target, perform block feature analysis on the global image, and extract the center point coordinates of several feature blocks.
[0093] In one example, in order to improve the accuracy of target foreground region extraction, a solid color background can be used and the solid color background is different from the color of the target. During the global image acquisition process, sufficient supplementary light and appropriate exposure can also be maintained, and the target is at the center position of the global image.
[0094] S102, in the above global image, determine the coordinates of the first corner point in the first object and the relative coordinates of the target sub-region to be microscopically photographed in the first object relative to the first corner point.
[0095] The first corner point can be any corner point in the first object. In one example, for example Figure 1aAs shown, the first corner point can be the corner point A at the upper left corner of the first object. The target sub-region is the sub-region that needs to be micro-photographed, that is, the sub-region used to detect the authenticity of the first object. The specific setting method of the target sub-region can be customized according to the actual situation. For example, the region with the most obvious image features or the richest image texture can be selected.
[0096] The coordinates of the first corner point and the coordinates of the target sub-region can be obtained through computer vision technology, and the relative coordinates of the target sub-region relative to the first corner point can be further calculated. The relative coordinates of the target sub-region and the first corner point can be the relative coordinates of the key point of the target sub-region (such as the center point of the target sub-region) and the first corner point.
[0097] S103, according to the above coordinate mapping relationship between the global camera and the above first micro-camera, and the above first corner point coordinates, control the center of the above first micro-camera to move to the above first corner point coordinates, and use the first micro-image collected by the above first micro-camera.
[0098] The coordinate mapping relationship between the global camera and the first micro-camera can be the mapping relationship between the image coordinates of the global camera and the world coordinates of the first micro-camera. According to this coordinate mapping relationship, guide the center of the first micro-camera to move to the first corner point to collect the first micro-image. Ignoring the mechanical positioning error, the center of the first micro-image is the first corner point, and the coordinates of the first corner point in the first micro-image are expressed as O(x o ,y o ), then x o =W / 2, y o =H / 2, where W is the width of the first micro-image and H is the height of the first micro-image.
[0099] S104, in the first micro-image, determine the coordinates of the outer corner point corresponding to the first corner point of the above first object, and calculate the coordinate offset of the outer corner point coordinates in the above first micro-image relative to the center of the above first micro-image.
[0100] The coordinates of the outer corner point corresponding to the first corner point can be obtained through computer vision technology, and the coordinate offset of the outer corner point coordinates in the first micro-image relative to the center of the first micro-image can be further calculated, that is, the coordinate offset between the outer corner point and the inner corner point of the first object. The first corner point in the global image corresponds to the inner corner point (the center of the first micro-image) in the first micro-image. For example Figure 1a and Figure 1b the corner point A; and the outer corner point corresponding to the first corner point in the first micro-image is the corner point B.
[0101] In a possible implementation, in the first microscopic image, determine the coordinates of the outer corner point corresponding to the first corner point of the first object, and calculate the coordinate offset of the outer corner point coordinates in the first microscopic image relative to the center of the first microscopic image, including:
[0102] Step A: Perform foreground-background segmentation on the first microscopic image and perform foreground edge fitting to obtain the coordinates of the outer corner point corresponding to the first corner point in the first microscopic image.
[0103] Step B: Obtain the coordinates of the center of the first microscopic image, calculate the coordinates of the outer corner point of the first microscopic image relative to the center of the first microscopic image, and obtain the coordinate offset.
[0104] The center coordinates of the first microscopic image are O(x o ,y o ), and the coordinates of the outer corner point of the specified angle in the first microscopic image are L B (x B ,y B ). Then the coordinate offset δ offset (dx,dy) = δ offset (x B -x o ,y B -y o ).
[0105] S105: Obtain a second microscopic image including the first corner point of the first object collected by the second microscopic camera.
[0106] The center of the second microscopic image is not necessarily the first corner point, as long as the first corner point of the first object is within the shooting range of the second microscopic camera. The second microscopic camera and the first microscopic camera can be the same microscopic camera or different microscopic cameras.
[0107] S106: In the second microscopic image, determine the coordinates of the outer corner point corresponding to the first corner point of the first object.
[0108] The coordinates of the outer corner point corresponding to the first corner point of the first object in the second microscopic image can be obtained through computer vision technology. For example, foreground-background segmentation can be performed on the second microscopic image and foreground edge fitting can be performed to obtain the coordinates of the outer corner point of the first corner point in the second microscopic image. The specific method of the foreground-background segmentation algorithm can refer to the foreground-background segmentation algorithm in the related technology, which is not specifically limited here; the specific method of foreground edge fitting can refer to the foreground edge fitting method in the related technology. For example, line fitting or projection counting in the horizontal and vertical directions can be used.
[0109] S107. Determine the target coordinates at which the second microscopic camera captures the image of the target sub-region based on the coordinates of the outer corner points in the second microscopic image, the relative coordinates, and the coordinate offset, so that the second microscopic camera moves to the target coordinates to capture the target microscopic image of the target sub-region.
[0110] Use coordinate offset to achieve the coordinate conversion between the inner corner and the outer corner points, and use the relative coordinates to obtain the target coordinates at which the second microscopic camera captures the image of the target sub-region, so that the second microscopic camera moves to the target coordinates and captures the microscopic image of the target sub-region, that is, the target microscopic image.
[0111] S108. Determine whether the first object is genuine based on the target microscopic image and the characteristics of the true microscopic image stored in the database indicating authenticity.
[0112] If the similarity between the characteristics of the target microscopic image and the characteristics of the true microscopic image is greater than the preset similarity threshold, determine that the first object is genuine; otherwise, determine that the first object is not genuine.
[0113] In the embodiment of the present application, coordinate offset is used to achieve the coordinate correction between the inner corner points and the outer corner points, thereby improving the accuracy of the captured microscopic image.
[0114] In a possible implementation manner, refer to Figure 3 , in the above global image, determining the coordinates of the first corner point in the first object and the relative coordinates of the target sub-region to be microscopically photographed in the first object relative to the first corner point includes:
[0115] S1021. Perform foreground-background segmentation on the global image and perform foreground edge fitting to obtain the target foreground region of the first object and the coordinates of the first corner point of the target foreground region.
[0116] For the specific method of the foreground-background segmentation algorithm, reference can be made to the foreground-background segmentation algorithm in the related art, which is not specifically limited here; for the specific method of foreground edge fitting, reference can be made to the foreground edge fitting method in the related art. For example, line fitting or projection counting in the horizontal and vertical directions can be used. The specified corner of the target foreground region can be the reference corner point used for the coordinate conversion between the global image and the microscopic image, and can be custom-set according to the actual situation.
[0117] In a possible implementation manner, refer to Figure 4 , the above performing foreground-background segmentation on the global image and performing foreground edge fitting to obtain the target foreground region of the first object and the coordinates of the first corner point of the target foreground region includes:
[0118] S10211. Perform Gaussian pre-filtering on the above global image to obtain a first global image.
[0119] For the specific method of performing Gaussian pre-filtering on the global image, reference can be made to the Gaussian pre-filtering method of images in the related art.
[0120] In one example, Gaussian pre-filtering can be first performed on the global image to remove the influence of some background granular noise and then convolution is carried out. The above-mentioned performing Gaussian pre-filtering on the global image to obtain a first global image includes: performing Gaussian pre-filtering and convolution operations on the above global image based on the following method to obtain a first global image:
[0121] I smooth = I * k(w, σ)
[0122] where I smooth represents the first global image, k(w, σ) represents a Gaussian kernel with a filtering window of w and a standard deviation of σ, and I represents the convolution operation.
[0123] S10212. Convert the first global image to the YUV format to obtain a YUV global image.
[0124] The images captured by the camera are generally in the RGB format. Convert the first global image in the RGB format to the YUV format. Those skilled in the art can understand that if the first global image is itself in the YUV format, there is no need for conversion and this step can be omitted.
[0125] S10213. Statistically calculate the mean values of the Y component, U component, and V component of the pixels in the specified background area of the above YUV global image to obtain the background mean value.
[0126] The specified background area can be selected according to the actual situation. In one example, when the target is at the center position of the global image, a range with a certain width (such as 20 pixels) at the edge of the global image is used as the specified background area. Statistically calculate the mean value of the luminance component Y m and the chrominance components U m , V m as the background mean value.
[0127] In one example, the above-mentioned statistically calculating the mean values of the Y component, U component, and V component of the pixels in the specified background area of the YUV global image to obtain the background mean value includes: respectively statistically calculating the Y component, U component, and V component of each pixel within the edge width L of the above YUV global image, and calculating the mean values of the Y component, U component, and V component according to the following formula to obtain the background mean value:
[0128]
[0129]
[0130]
[0131] Among them, Y i,j represents the Y component of the pixel at the i-th row and j-th column, U i,j represents the U component of the pixel at the i-th row and j-th column, V i,j represents the V component of the pixel at the i-th row and j-th column, W represents the number of columns of the above YUV global image, H represents the number of rows of the above YUV global image, Y m represents the average value of the Y component, U m represents the average value of the U component, V m represents the average value of the V component, and the above background average value is represented by Y m 、U m 、V m .
[0132] S10214. Perform smoothing filtering on each channel of the above YUV global image to obtain a second global image.
[0133] Statistically analyze the histogram of the Y component of the YUV global image. As Figure 5 shown, the values corresponding to the two main peaks of the histogram are M1 Y 、M2 Y respectively; similarly, statistically analyze the histogram of the U component, and the values corresponding to the two main peaks are M1 U 、M2 U respectively; statistically analyze the histogram of the V component, and the values corresponding to the two main peaks are M1 V 、M2 V respectively. Filter the histogram to obtain the smoothed Y, U, and V component histograms, thereby obtaining a second global image.
[0134] In a possible implementation manner, the above-mentioned performing smoothing filtering on each channel of the YUV global image to obtain a second global image includes: determining the histogram of the Y channel, the histogram of the U channel, and the histogram of the V channel of the above YUV global image; determining each peak in the histogram of the Y channel and performing smoothing filtering to obtain the filtered histogram of the Y channel; determining each peak in the histogram of the U channel and performing smoothing filtering to obtain the filtered histogram of the U channel; determining each peak in the histogram of the V channel and performing smoothing filtering to obtain the filtered histogram of the V channel; obtaining a second global image based on the filtered histogram of the Y channel, the filtered histogram of the U channel, and the filtered histogram of the V channel.
[0135] S10215. Calculate the normalized contrast of each pixel of the above second global image with respect to the above background average value to obtain a normalized contrast histogram.
[0136] Calculate the normalized contrast of the second global image relative to the background:
[0137]
[0138] where Contrast i,j represents the normalized contrast of the pixel at the i-th row and j-th column, abs() represents taking the absolute value, and Y i,j represents the Y component value of the pixel at the i-th row and j-th column, and U i,j represents the U component value of the pixel at the i-th row and j-th column, and V i,j represents the V component value of the pixel at the i-th row and j-th column.
[0139] Statistical histogram of the normalized contrast of each pixel to obtain the normalized contrast histogram.
[0140] S10216. Determine the adaptive segmentation threshold according to the above normalized contrast histogram.
[0141] S10217. Use the above adaptive segmentation threshold to binarize the above normalized contrast histogram Figure 2 to obtain the initial foreground region.
[0142] According to the normalized contrast histogram, calculate the adaptive segmentation threshold thresh, and binarize the image according to thresh. For example, pixels greater than thresh are set to black, and pixels less than thresh are set to white. The black region is segmented as the foreground to obtain the initial foreground region.
[0143] S10218. Fit the above initial foreground region to obtain the target foreground region and the coordinates of the corner points of the specified corner of the above target foreground region.
[0144] The specific method for fitting the initial foreground region can refer to the edge fitting method in the related art. For example, line fitting or projection counting in the horizontal and vertical directions can be used. Fit the initial foreground region to obtain the target foreground region, and obtain the coordinates of the corner points of the specified corner of the target foreground region.
[0145] The specific ways of foreground and background segmentation of the first microscopic image and foreground edge fitting and foreground and background segmentation of the second microscopic image and foreground edge fitting can refer to the ways of foreground and background segmentation of the global image and foreground edge fitting in the embodiments of the present application, which will not be elaborated here.
[0146] In the embodiments of the present application, using the normalized contrast for foreground and background segmentation of the global image can improve the accuracy of the target foreground region, thereby improving the accuracy of the collected microscopic images.
[0147] S1022. Determine the target sub-region to be micro-photographed in the above-mentioned target foreground region, and determine the relative coordinates of the above-mentioned target sub-region and the above-mentioned first corner point.
[0148] In a possible implementation, refer to Figure 6 , the above-mentioned determining the target sub-region to be micro-photographed in the above-mentioned target foreground region, and determining the relative coordinates of the above-mentioned target sub-region and the above-mentioned first corner point, includes:
[0149] S10221. Divide the above-mentioned target foreground region into multiple sub-regions, and extract the texture features of each of the above-mentioned sub-regions.
[0150] The division method of the sub-regions can be custom-set according to the actual situation. For example, the target foreground region can be divided into multiple squares of a specified size, etc.
[0151] S10222. Select each sub-region whose texture features meet the preset texture rules to obtain each target sub-region.
[0152] The preset texture rules can be custom-set according to the actual situation. The sub-regions with relatively rich texture features (greater than the preset texture richness threshold) can be selected using the preset texture rules as the target sub-regions.
[0153] In one example, the above-mentioned selecting each sub-region whose texture features meet the preset texture rules to obtain each target sub-region includes: Among each of the above-mentioned sub-regions, select the top n sub-regions with the highest texture feature richness as each target sub-region. Among each of the above-mentioned sub-regions, select the sub-regions with texture feature richness Top n as each target sub-region
[0154] S10223. Calculate the coordinates of the center points of each of the above-mentioned target sub-regions respectively to obtain the coordinates of each of the above-mentioned target sub-regions.
[0155] S10224. According to the coordinates of each of the above-mentioned target sub-regions and the coordinates of the first corner point in the above-mentioned global image, calculate the relative coordinates of each of the above-mentioned target sub-regions and the above-mentioned first corner point respectively.
[0156] In one example, the target foreground region is divided into multiple sub-regions, the texture features of each sub-region are extracted, and the top M sub-regions with the richest texture are selected to obtain M target sub-regions. Denote the image center coordinates of the nth target sub-region as f n (x n , y n ), and the relative coordinates of the center coordinates of the nth target sub-region with respect to the corner point of the specified angle are f n _L A (x na , y na ).
[0157] In a possible implementation, referring to Figure 7 , determining the target coordinates for the second microscopic camera to capture the image of the target sub-region based on the coordinates of the outer corner points in the second microscopic image, the relative coordinates, and the coordinate offset, so that the second microscopic camera moves to the target coordinates to capture the target microscopic image of the target sub-region, includes:
[0158] S1071. Determine the coordinates of the inner corner points in the second microscopic image according to the coordinates of the outer corner points in the second microscopic image and the coordinate offset.
[0159] Denote the coordinates of the outer corner point of the specified angle in the second microscopic image as L′ B (x B′ , y B′ ), and the coordinate offset as δ offset (dx, dy). Then, the coordinates of the inner corner point of the specified angle in the second microscopic image after correction are L′ A (x A′ , y A′ ):
[0160] L′ A (x A′ , y A′ ) = L′ A (x B′ + dx, y B′ + dy).
[0161] S1072. Determine the coordinates of the target sub-region in the second microscopic image according to the coordinates of the inner corner points in the second microscopic image and the relative coordinates, to obtain the target coordinates.
[0162] Denote the relative coordinates as f n _L A (x na , y na ). Then, the target coordinates f′ n (x n , y n , ) are:
[0163] f′ n (x n′ , y n′ ) = f′ n (x A′ + x na , y A′ + y na ).
[0164] S1073. Move the second microscopic camera to the target coordinates so that the second microscopic camera moves to the target coordinates to capture the target microscopic image of the target sub-region.
[0165] In the embodiments of the present application, coordinate offset is used to correct the coordinates of the inner corner points and outer corner points, so as to improve the accuracy of the captured microscopic images.
[0166] The embodiments of the present application also provide an object detection system. Refer to Figure 8 , including: a first detection device 11, a second detection device 12 and a controller 13. The first detection device 11 includes a global camera 111 and a first microscopic camera 112. The second detection device 12 includes a second microscopic camera 121. The controller 13 is configured to implement any of the object detection methods described in the present application when running. In an example, the first detection device 11 further includes a first mechanism for driving the position movement of the global camera 111, a second mechanism for driving the position movement of the first microscopic camera 112. The second detection device 12 further includes a third mechanism for driving the position movement of the second microscopic camera 121. The first detection device 11 and the second detection device 12 can be integrated on one device or distributed on two devices. In an example, the controller 13 can be an independent device or integrated in the first detection device 11 or the second detection device 12. In addition, the controller 13 can further include a first processor and a second processor, where the first processor is arranged on the side of the first detection device 11, the second processor is arranged on the side of the second detection device 12, and the first processor and the second processor cooperate to implement any of the object detection methods described in the present application, and they are all within the protection scope of the present application.
[0167] The embodiments of the present application also provide an object detection device, which is applied to an object detection system. The system includes a first detection device and a second detection device. The first detection device includes a global camera and a first microscopic camera. The second detection device includes a second microscopic camera. Refer to Figure 9 , the device includes:
[0168] A global image acquisition module 21, configured to acquire a global image including a first object captured by the global camera, where the first object is an object with a slope at the edge corner points;
[0169] A corner point coordinate determination module 22, configured to determine the coordinates of a first corner point in the first object and the relative coordinates of a target sub-region to be microscopically photographed in the first object relative to the first corner point in the global image;
[0170] The first microscopic image acquisition module 23 is configured to control the center of the first microscopic camera to move to the first corner point coordinates according to the coordinate mapping relationship between the global camera and the first microscopic camera and the first corner point coordinates, and acquire a first microscopic image by using the first microscopic camera;
[0171] The coordinate offset determination module 24 is configured to determine the outer corner point coordinates corresponding to the first corner point of the first object in the first microscopic image, and calculate the coordinate offset of the outer corner point coordinates in the first microscopic image relative to the center of the first microscopic image;
[0172] The second microscopic image acquisition module 25 is configured to acquire a second microscopic image including the first corner point of the first object acquired by the second microscopic camera;
[0173] The outer corner point coordinate determination module 26 is configured to determine the outer corner point coordinates corresponding to the first corner point of the first object in the second microscopic image;
[0174] The target microscopic image acquisition module 27 is configured to determine the target coordinates of the image of the target sub-region acquired by the second microscopic camera according to the coordinates of the outer corner points in the second microscopic image, the relative coordinates, and the coordinate offset, so that the second microscopic camera moves to the target coordinates to acquire a target microscopic image of the target sub-region;
[0175] The object authenticity detection module 28 is configured to determine whether the first object is genuine based on the target microscopic image and the features of the true microscopic image stored in the database for indicating genuine products.
[0176] In a possible implementation manner, the corner point coordinate determination module includes:
[0177] The first corner point coordinate determination sub-module is configured to perform foreground-background segmentation on the global image and perform foreground edge fitting to obtain the target foreground region of the first object and the coordinates of the first corner point of the target foreground region;
[0178] The relative coordinate determination sub-module is configured to determine the target sub-region to be microscopically photographed in the target foreground region, and determine the relative coordinates of the target sub-region and the first corner point.
[0179] In a possible implementation manner, the first corner point coordinate determination sub-module includes:
[0180] The image filtering unit is configured to perform Gaussian pre-filtering on the global image to obtain a first global image;
[0181] The format conversion unit is configured to convert the first global image into the YUV format to obtain a YUV global image;
[0182] A mean calculation unit, configured to calculate the mean value of the Y component, the mean value of the U component, and the mean value of the V component of the pixels within a specified background region of the YUV global image, so as to obtain a background mean value;
[0183] A smoothing filter unit, configured to perform smoothing filtering on each channel of the YUV global image to obtain a second global image;
[0184] A histogram determination unit, configured to calculate the normalized contrast of each pixel of the second global image relative to the background mean value to obtain a normalized contrast histogram;
[0185] A segmentation threshold determination unit, configured to determine an adaptive segmentation threshold according to the normalized contrast histogram;
[0186] A binarization segmentation unit, configured to binarize the normalized contrast histogram by using the adaptive segmentation threshold to obtain an initial foreground region; Figure 2 to obtain an initial foreground region;
[0187] A foreground region fitting unit, configured to fit the initial foreground region to obtain a target foreground region and the coordinates of the corner points of the specified angle of the target foreground region.
[0188] In a possible implementation manner, the image filtering unit is specifically configured to: perform Gaussian pre-filtering and convolution operation on the global image based on the following manner to obtain a first global image:
[0189] I smooth = Ik(w,σ)
[0190] wherein, I smooth represents the first global image, k(w,σ) represents a Gaussian kernel with a filtering window of w and a standard deviation of σ, and I represents a convolution operation.
[0191] In a possible implementation manner, the smoothing filter unit is specifically configured to: determine the histogram of the Y channel, the histogram of the U channel, and the histogram of the V channel of the YUV global image; determine each peak in the histogram of the Y channel, and perform smoothing filtering to obtain a filtered histogram of the Y channel; determine each peak in the histogram of the U channel, and perform smoothing filtering to obtain a filtered histogram of the U channel; determine each peak in the histogram of the V channel, and perform smoothing filtering to obtain a filtered histogram of the V channel; and obtain a second global image based on the filtered histogram of the Y channel, the filtered histogram of the U channel, and the filtered histogram of the V channel.
[0192] In a possible implementation manner, the mean value calculation unit is specifically configured to: respectively count the Y component, U component, and V component of each pixel within the edge width L of the YUV global image, and calculate the mean value of the Y component, the mean value of the U component, and the mean value of the V component according to the following formula to obtain the background mean value:
[0193]
[0194]
[0195]
[0196] Wherein, Y i,j represents the Y component of the pixel at the i-th row and j-th column, U i,j represents the U component of the pixel at the i-th row and j-th column, V i,j represents the V component of the pixel at the i-th row and j-th column, W represents the number of columns of the YUV global image, H represents the number of rows of the YUV global image, Y m represents the mean value of the Y component, U m represents the mean value of the U component, V m represents the mean value of the V component, and the background mean value is represented by Y m , U m , V m .
[0197] In a possible implementation manner, the relative coordinate determination sub-module includes:
[0198] A texture feature extraction unit, configured to divide the target foreground region into multiple sub-regions and extract the texture features of each sub-region;
[0199] A target sub-region determination unit, configured to select each sub-region whose texture features meet a preset texture rule to obtain each target sub-region;
[0200] A center point coordinate determination unit, configured to calculate the coordinates of the center point of each target sub-region respectively to obtain the coordinates of each target sub-region;
[0201] A relative coordinate calculation unit, configured to calculate the relative coordinates of each target sub-region and the first corner point in the global image according to the coordinates of each target sub-region and the coordinates of the first corner point in the global image.
[0202] In a possible implementation manner, the target sub-region determination unit is specifically configured to: select the top n sub-regions with the highest texture feature richness in each sub-region as each target sub-region.
[0203] In a possible implementation manner, the target microscopic image acquisition module is specifically configured to: determine the coordinates of the inner corner points in the second microscopic image according to the coordinates of the outer corner points in the second microscopic image and the coordinate offset; determine the coordinates of the target sub-region in the second microscopic image according to the coordinates of the inner corner points in the second microscopic image and the relative coordinates, so as to obtain target coordinates; move the second microscopic camera to the target coordinates, so that the second microscopic camera moves to the target coordinates to acquire the target microscopic image of the target sub-region.
[0204] In a possible implementation manner, the coordinate offset determination module is specifically configured to: perform foreground-background segmentation on the first microscopic image and fit the foreground edges to obtain the coordinates of the outer corner points corresponding to the first corner points in the first microscopic image; obtain the coordinates of the center of the first microscopic image, and calculate the coordinates of the outer corner points of the first microscopic image relative to the coordinates of the center of the first microscopic image to obtain the coordinate offset.
[0205] An embodiment of the present application further provides an electronic device, including: a processor and a memory;
[0206] The above-mentioned memory is used to store a computer program;
[0207] When the above-mentioned processor is used to execute the computer program stored in the above-mentioned memory, any object detection method in the present application is implemented.
[0208] Optionally, referring to Figure 10 , in addition to the processor 31 and the memory 33, the electronic device according to the embodiment of the present application further includes a communication interface 32 and a communication bus 34. Among them, the processor 31, the communication interface 32, and the memory 33 complete communication with each other through the communication bus 34.
[0209] The communication bus mentioned in the above-mentioned electronic device may be a PCI (Peripheral Component Interconnect, peripheral component interconnect standard) bus or an EISA (Extended Industry Standard Architecture, extended industry standard structure) bus, etc. This communication bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of convenience of representation, only a thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0210] The communication interface is used for communication between the above-mentioned electronic device and other devices.
[0211] The memory may include RAM (Random Access Memory), or may also include NVM (Non-Volatile Memory), such as at least one disk memory. Optionally, the memory may also be at least one storage device located far from the aforementioned processor.
[0212] The aforementioned processor may be a general-purpose processor, including a CPU (Central Processing Unit), an NP (Network Processor), etc.; it may also be a DSP (Digital Signal Processing), an ASIC (Application Specific Integrated Circuit), an FPGA (Field-Programmable Gate Array), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0213] It should be noted that in this document, the technical features in each alternative can be combined as long as they are not contradictory to form a solution, and these solutions are all within the scope disclosed in this application. Relative terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising one..." does not exclude the presence of additional identical elements in the process, method, article or device comprising the element.
[0214] Each embodiment in this specification is described in a related manner. The same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the embodiments of the device, electronic device, computer program product and storage medium, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiments.
[0215] The above are only the preferred embodiments of the present application and are not intended to limit the protection scope of the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present application are all included in the protection scope of the present application.
Claims
1. An object detection method, characterized in that, Applied to an object detection system, the system includes a first detection device and a second detection device. The first detection device includes a global camera and a first microscopic camera, and the second detection device includes a second microscopic camera; the method includes: Obtain a global image including a first object collected by the global camera, where the first object is an object with a slope at the edge corner points; In the global image, determine the coordinates of a first corner point in the first object and the relative coordinates of a target sub-region to be microscopically photographed in the first object relative to the first corner point; the first corner point is any corner point in the first object; According to the coordinate mapping relationship between the global camera and the first microscopic camera and the coordinates of the first corner point, control the center of the first microscopic camera to move to the coordinates of the first corner point, and use the first microscopic camera to collect a first microscopic image; In the first microscopic image, determine the coordinates of the outer corner point corresponding to the first corner point of the first object, and calculate the coordinate offset of the outer corner point in the first microscopic image relative to the center of the first microscopic image; Obtain a second microscopic image including the first corner point of the first object collected by the second microscopic camera; In the second microscopic image, determine the coordinates of the outer corner point corresponding to the first corner point of the first object; According to the coordinates of the outer corner point in the second microscopic image, the relative coordinates, and the coordinate offset, determine the target coordinates for the second microscopic camera to collect an image of the target sub-region, so that the second microscopic camera moves to the target coordinates to collect a target microscopic image of the target sub-region; Based on the target microscopic image and the features of the true-value microscopic image stored in the database for indicating a genuine product, determine whether the first object is a genuine product; Wherein, in the microscopic image, there are two inner and outer corner points at the slope of the edge corner point of the first object. Among them, the outer corner point is the corner point located in the microscopic image by algorithm fitting, and the inner corner point is the corner point located in the global image by algorithm fitting.
2. The method according to claim 1, characterized in that, The step of determining the coordinates of the first corner point in the first object and the relative coordinates of the target sub-region to be microscopically photographed in the first object relative to the first corner point in the global image includes: Perform foreground-background segmentation on the global image and perform foreground edge fitting to obtain the target foreground region of the first object and the coordinates of the first corner point of the target foreground region; Determine the target sub-region to be microscopically photographed in the target foreground region, and determine the relative coordinates of the target sub-region and the first corner point.
3. The method according to claim 2, wherein The step of performing foreground-background segmentation on the global image and performing foreground edge fitting to obtain the target foreground region of the first object and the coordinates of the first corner point of the target foreground region includes: Perform Gaussian pre-filtering on the global image to obtain a first global image; Convert the first global image to the YUV format to obtain a YUV global image; Statistically calculate the average value of the Y component, the average value of the U component, and the average value of the V component of the pixels in the specified background region of the YUV global image to obtain the background average value; Perform smoothing filtering on each channel of the YUV global image to obtain a second global image; Calculate the normalized contrast of each pixel in the second global image with respect to the background mean to obtain a normalized contrast histogram; Determine an adaptive segmentation threshold according to the normalized contrast histogram; Binarize the normalized contrast histogram using the adaptive segmentation threshold to obtain an initial foreground region; Fit the initial foreground region to obtain a target foreground region and the coordinates of the corner points of the specified angle of the target foreground region.
4. The method according to claim 3, wherein The step of performing smoothing filtering on each channel of the YUV global image to obtain a second global image includes: Determine the histogram of the Y channel, the histogram of the U channel, and the histogram of the V channel of the YUV global image; Determine each peak in the histogram of the Y channel and perform smoothing filtering to obtain a filtered histogram of the Y channel; Determine each peak in the histogram of the U channel and perform smoothing filtering to obtain a filtered histogram of the U channel; Determine each peak in the histogram of the V channel and perform smoothing filtering to obtain a filtered histogram of the V channel; Based on the filtered histogram of the Y channel, the filtered histogram of the U channel, and the filtered histogram of the V channel, obtain a second global image.
5. The method according to claim 3, wherein The step of statistically calculating the mean value of the Y component, the mean value of the U component, and the mean value of the V component of the pixels in the specified background region of the YUV global image to obtain the background mean includes: Respectively statistically calculate the Y component, the U component, and the V component of each pixel within the edge width L of the YUV global image, and calculate the mean value of the Y component, the mean value of the U component, and the mean value of the V component according to the following formula to obtain the background mean: Among them, Y i,j represents the Y component of the pixel at the i-th row and j-th column, U i,j represents the U component of the pixel at the i-th row and j-th column, V i,j represents the V component of the pixel at the i-th row and j-th column, W represents the number of columns of the YUV global image, H represents the number of rows of the YUV global image, Y m represents the mean value of the Y component, U m represents the mean value of the U component, V m represents the mean value of the V component, and the background mean value is represented by Y m , U m , V m .
6. The method according to claim 2, wherein The step of determining the target sub-region to be micro-photographed in the target foreground region and determining the relative coordinates of the target sub-region and the first corner point includes: Divide the target foreground region into multiple sub-regions and extract the texture features of each sub-region; Select each sub-region whose texture features satisfy the preset texture rule to obtain each target sub-region; Respectively calculate the coordinates of the center points of each target sub-region to obtain the coordinates of each target sub-region; According to the coordinates of each target sub-region and the coordinates of the first corner point in the global image, respectively calculate the relative coordinates of each target sub-region and the first corner point.
7. The method according to claim 6, characterized in that, The step of selecting each sub-region whose texture features satisfy the preset texture rule to obtain each target sub-region includes: Among each sub-region, select the top n sub-regions with the highest texture feature richness as each target sub-region.
8. The method according to claim 1, characterized in that, The step of determining the target coordinates for the second micro-camera to capture the image of the target sub-region according to the coordinates of the outer corner points in the second micro-image, the relative coordinates, and the coordinate offset, so that the second micro-camera moves to the target coordinates to capture the target micro-image of the target sub-region includes: Determine the coordinates of the inner corner points in the second micro-image according to the coordinates of the outer corner points in the second micro-image and the coordinate offset; Determine the coordinates of the target sub-region in the second microscopic image according to the coordinates of the inner corner points in the second microscopic image and the relative coordinates, to obtain target coordinates; Move the second microscopic camera to the target coordinates, so that the second microscopic camera moves to the target coordinates to collect the target microscopic image of the target sub-region.
9. The method according to claim 1, characterized in that, In the first microscopic image, determine the coordinates of the outer corner points corresponding to the first corner points of the first object, and calculate the coordinate offset of the outer corner points in the first microscopic image relative to the center of the first microscopic image, including: Perform foreground-background segmentation on the first microscopic image and perform foreground edge fitting to obtain the coordinates of the outer corner points corresponding to the first corner points in the first microscopic image; Obtain the coordinates of the center of the first microscopic image, and calculate the coordinates of the outer corner points of the first microscopic image relative to the center of the first microscopic image to obtain the coordinate offset.
10. An object detection system, characterized in that, Including: A controller, a first detection device and a second detection device, the first detection device includes a global camera and a first microscopic camera, and the second detection device includes a second microscopic camera; The controller is configured to implement the object detection method according to any one of claims 1-9 when running.
Citation Information
Patent Citations
Anti-fake method and system based on calligraphy and painting micro-texture
CN103065109A
Collector of calligraphy and painting micro-texture image and collection method therefor
CN104866837A