Gray-scale image processing system, gray-scale image processing equipment and storage medium
Through the grayscale image processing system, the grayscale image acquisition equipment and processing equipment are used to obtain and cut out the most accurate target image area in the grayscale image, solving the problem of difficulty in accurately processing grayscale images in the prior art, and achieving efficient and accurate image processing effects.
Patent Information
- Application Number
- CN202510329370.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-20
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2045-03-20
AI Technical Summary
In practical applications, it is necessary to accurately process specific areas in grayscale images, and it is difficult for the prior art to effectively obtain and cut out the most accurate areas containing accurate target images.
A grayscale image processing system is provided, including a grayscale image acquisition device and a processing device. By obtaining the target area in the first frame image, determining the initial clipping area and the index comparison interval, calculating the mean and standard deviation comparison values, and adjusting the clipping area frame by frame to obtain the most accurate target image area.
It realizes accurate tailoring of specific areas in grayscale images, obtains the most accurate areas containing accurate target images, and improves the accuracy and efficiency of processing.
Smart Images

Figure CN119850655A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image data processing, and in particular to a grayscale image processing system, a grayscale image processing device and a storage medium. Background Art
[0002] In practical applications, it is often necessary to obtain an image of a specific area in a grayscale image, which requires processing the grayscale image. A processing solution is needed that can accurately obtain an image of a specific area in a grayscale image. Summary of the invention
[0003] In order to solve the above problems, the present invention provides a grayscale image processing system, a grayscale image processing device and a storage medium.
[0004] In a first aspect, the present invention provides a grayscale image processing system, the system comprising: a grayscale image acquisition device and a grayscale image processing device; There is a communication connection between the grayscale image acquisition device and the grayscale image processing device; The grayscale image acquisition device is used to acquire multiple frames of grayscale images and transmit the multiple frames of grayscale images to the grayscale image processing device through a communication connection; wherein each frame of grayscale image includes an image of the target; A grayscale image processing device is used to obtain a target area in a first frame of a grayscale image, and determine the obtained area as a target initial area; determine a minimum circumscribed rectangle containing the target initial area as an initial clipping area; determine an index comparison interval based on the target initial area; determine a mean V1 and a standard deviation σ1 of index values of all pixels covered by the initial clipping area; determine a mean V2 and a standard deviation σ2 of index values of all pixels covered by the target initial area; determine a mean comparison value of |V1-V2| / V1 and a standard deviation comparison value of |σ1-σ2| / σ1; determine both the mean comparison value and the standard deviation comparison value as target comparison values; determine a target clipping area based on the target comparison value; and clip the grayscale image based on the target clipping area to obtain multiple frames of target grayscale images.
[0005] Optionally, determining a target clipping area according to the target comparison value includes: For each non-first frame grayscale image, the initial cropping area is expanded outward by one pixel in each direction, and the target area in each non-first frame grayscale image is determined according to the area after each expansion, the index comparison interval and the target comparison value; determining the acquired target area as a target adjustment area; The minimum area including the initial clipping area and all target adjustment areas is determined as the target clipping area.
[0006] Optionally, the indicator comparison interval is determined according to the target initial area, including: Determine the index value of each pixel point covered by the target initial area; Determine the maximum value max1, minimum value min1, mean value V3, and standard deviation σ3 of the index values of all pixels; Determine the adjustment coefficient δ1 based on max1, min1, V3, and σ3; Determine the initial comparison interval as [min1×(1-δ1), max1×(1+δ1)]; The indicator comparison interval is determined to be (preset target indicator value standard interval ∪ initial comparison interval) ∩preset target indicator value maximum interval.
[0007] Optionally, the adjustment coefficient δ1 is determined according to max1, min1, V3, and σ3, including: Determine the adjusted mean value to be (max1+min1+V3) / 3; Determine the first adjustment degree as the adjusted mean / σ3; Among the index values of all pixels covered by the target initial area, determine the number of pixels n1 greater than the maximum value of the target index value standard interval, the number of pixels n2 less than the minimum value of the target index value standard interval, and the total number n3 of all pixels covered by the target initial area; Determine the second adjustment degree as 1-[(n1×n1)+(n2×n2)+(n3-n1-n2)×(n3-n1-n2)] / (n3×n3); Determine δ1=max{first adjustment degree, second adjustment degree}; wherein max{} is a maximum value function.
[0008] Optionally, for each non-first frame grayscale image, the initial cropping area is sequentially expanded outward by one pixel in each direction, and the target area in each non-first frame grayscale image is determined according to the area after each expansion, the index comparison interval and the target comparison value, including: For any non-first frame grayscale image i, its target area is determined by the following steps: Determine the index value of each pixel covered by the initial clipping area in the grayscale image i; According to the index value of each pixel covered by the initial clipping area in the grayscale image i, determine the number of pixels n4 that are not located in the target index comparison interval, the mean V4 and the standard deviation σ4 of the index values of all pixels covered by the initial clipping area in the grayscale image i; The area formed by all the pixels covered by the initial clipping area in the grayscale image i is determined as the processing area; According to the preset direction priority, the direction with the highest priority is selected as the expansion direction; The current processing area is enlarged by one pixel in the current enlargement direction, and the enlarged area is determined according to the enlarged area, n4, V4, σ4, target index comparison interval and target comparison value each time; Update the processing area to the expansion area, update the expansion direction to a direction with a priority only lower than the current expansion direction, re-execute the current processing area to expand one pixel in the current expansion direction, and determine the step of expanding the area and subsequent steps according to the area after each expansion, n4, V4, σ4, target indicator comparison interval and target comparison value until all directions are selected; The current enlarged area is determined as the target area in the grayscale image i.
[0009] Optionally, the current processing area is sequentially enlarged by one pixel in the current enlargement direction, and the enlarged area is determined according to the enlarged area, n4, V4, σ4, target index comparison interval and target comparison value, including: Initialize the expansion times n5=1; Determine the current processing area as the first area; Determine a region obtained by enlarging the first region by 1 pixel in the current enlarging direction as the second region; Determine the index values of all pixels covered by the first area and the second area respectively; Determine the enlarged change degree according to the index values, n4, V4, σ4, target index comparison interval and target comparison value of all pixel points covered by the first area and the second area; If the enlargement change degree is greater than the preset change threshold, the first area is determined as the enlarged area; if the enlargement change degree is not greater than the preset change threshold, n5 is updated to n5+1, if n5 is equal to the preset change threshold, the first area is determined as the enlarged area, if n5 is less than the preset change threshold, the first area is updated to the second area, and the step of determining the area obtained by enlarging the first area by 1 pixel in the current enlargement direction as the second area and subsequent steps are repeated.
[0010] Optionally, determining the enlarged change degree according to the index values, n4, V4, σ4, target index comparison interval and target comparison value of all pixels covered by the first area and the second area includes: According to the index values of all the pixels covered by the first area, determine the number of pixels n61 that are not located in the target index comparison interval, the mean V51 and the standard deviation σ51 of the index values of all the pixels covered by the first area; According to the index values of all the pixels covered by the second area, determine the number of pixels n62 that are not located in the target index comparison interval, the mean V52 and the standard deviation σ52 of the index values of all the pixels covered by the second area; If n62-n61>0, the enlarged change degree is determined to be a preset maximum value; If n62-n61≤0, the mean change value is determined to be |V52-V51| / V4, the standard deviation change value is determined to be |σ52-σ51| / σ4, and the expanded change degree is determined based on the mean change value, standard deviation change value, n4 and target comparison value.
[0011] Optionally, the target comparison value includes a mean comparison value and a standard deviation comparison value; The degree of expansion change is determined based on the mean change value, standard deviation change value, n4 and target comparison value, including: If the mean change value > mean comparison value × (1 + preset mean adjustment ratio), or the standard deviation change value > standard deviation comparison value × (1 + preset standard deviation adjustment ratio), then the enlarged change degree is determined to be the preset maximum value; If the mean change value ≤ mean comparison value × (1 + preset mean adjustment ratio), and the standard deviation change value ≤ standard deviation comparison value × (1 + preset standard deviation adjustment ratio), then the expanded change degree is determined as the cube root of the change value, where the change value is [(n62-n61) / n4] × mean change value × standard deviation change value.
[0012] In a second aspect, the present invention provides a grayscale image processing device, which is the grayscale image processing device in the system described in the first aspect; Wherein, the grayscale image processing device comprises: a memory and a processor; A memory, used for storing computer programs involved in realizing the grayscale image acquisition device; A processor is used to execute computer programs stored in the memory.
[0013] In a third aspect, the present invention provides a computer-readable storage medium storing a computer program for implementing a grayscale image acquisition device in the system as described in the first aspect.
[0014] The present invention relates to a grayscale image processing system, a grayscale image processing device and a storage medium, and the system includes: a grayscale image acquisition device and a grayscale image processing device. There is a communication connection between the grayscale image acquisition device and the grayscale image processing device; wherein the grayscale image acquisition device is used to acquire multiple frames of grayscale images, and transmit the multiple frames of grayscale images to the grayscale image processing device through the communication connection; each frame of grayscale image includes an image of a target; the grayscale image processing device is used to acquire a target area in the first frame of grayscale image, and determine the acquired area as the target initial area; determine the minimum circumscribed rectangle containing the target initial area as the initial clipping area; determine the index comparison interval according to the target initial area; determine the area covered by the initial clipping area The method comprises the following steps: determining the mean V1 and standard deviation σ1 of the index values of all pixels of the target initial area; determining the mean V2 and standard deviation σ2 of the index values of all pixels covered by the target initial area; determining the mean comparison value to be |V1-V2| / V1, and the standard deviation comparison value to be |σ1-σ2| / σ1; determining both the mean comparison value and the standard deviation comparison value as the target comparison value; determining the target clipping area according to the target comparison value; clipping the grayscale image based on the target clipping area to obtain multiple frames of target grayscale images, so that the multiple frames of target grayscale images are the most accurate areas including the accurate target image. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 A schematic diagram of the structure of a grayscale image processing system provided in one embodiment of the present application; Figure 2 A schematic diagram of a first area provided in an embodiment of the present application; Figure 3 A schematic diagram of a second area provided in one embodiment of the present application. DETAILED DESCRIPTION
[0016] In order to better explain the present invention and facilitate understanding, the present invention is described in detail below through specific implementation modes in conjunction with the accompanying drawings.
[0017] This embodiment provides a grayscale image processing system. Figure 1 As shown, the system includes: a grayscale image acquisition device and a grayscale image processing device.
[0018] There is a communication connection between the grayscale image acquisition device and the grayscale image processing device, for example, there is a wireless communication connection between the grayscale image acquisition device and the grayscale image processing device, or there is a wired communication connection between the grayscale image acquisition device and the grayscale image processing device.
[0019] 1. Grayscale image acquisition equipment The grayscale image acquisition device is used to acquire multiple frames of grayscale images and transmit the multiple frames of grayscale images to the grayscale image processing device through a communication connection.
[0020] Each frame of grayscale image includes an image of the target, and the index value (such as grayscale value) of the area where the image of the same target is located in the grayscale image does not change much.
[0021] The target is a certain area in the grayscale image, such as the area where an object is located in the grayscale image.
[0022] For example, the grayscale image acquisition device continuously acquires images in a preset acquisition range, where the acquisition range includes the entire target, or includes a portion of the target.
[0023] In a specific implementation, the target may be a person, or a part of a person (such as a hand), or an object, or an animal, or others. The position of the grayscale image acquisition device may remain relatively unchanged, and the target may approach or move away from the grayscale image acquisition device, thereby obtaining multiple frames of grayscale images.
[0024] 2. Grayscale image processing equipment A grayscale image processing device is used to obtain a target area in a first frame of grayscale image, and determine the obtained area as a target initial area. The minimum circumscribed rectangle containing the target initial area is determined as an initial clipping area. An index comparison interval is determined based on the target initial area. The mean V1 and standard deviation σ1 of the index values of all pixels covered by the initial clipping area are determined. The mean V2 and standard deviation σ2 of the index values of all pixels covered by the target initial area are determined. The mean comparison value is determined to be |V1-V2| / V1, and the standard deviation comparison value is determined to be |σ1-σ2| / σ1. Both the mean comparison value and the standard deviation comparison value are determined as target comparison values. According to the target comparison value, a target clipping area is determined. The grayscale image is clipped based on the target clipping area to obtain multiple frames of target grayscale images.
[0025] The execution process of the grayscale image processing device is described in detail below: 101. Acquire multiple frames of grayscale images acquired by a grayscale image acquisition device.
[0026] Multiple frames of grayscale images acquired by the grayscale image acquisition device can be acquired through a communication connection.
[0027] Each frame of grayscale image includes an image of the target, and the index value (such as grayscale value) of the area where the image of the same target is located in the grayscale image does not change much.
[0028] 102, obtaining a target region in the first frame grayscale image, and determining the obtained region as a target initial region.
[0029] The target area is the area where the target object is located.
[0030] This step can be implemented with the assistance of relevant personnel or trained AI models, such as outputting the first frame grayscale image to the relevant personnel or the trained AI model, and having the relevant personnel or the trained AI model mark it, circle the target area in the first frame grayscale image, and then determine the target area in the first frame grayscale image circled by the relevant personnel or the trained AI model as the target initial area.
[0031] Since this step is determined by professionals, the target initial area is an accurate target area, so that the subsequent processing is based on the target initial area, ensuring the accuracy of all subsequent processing.
[0032] 103, determining the minimum bounding rectangle containing the target initial area as the initial clipping area.
[0033] The target initial area obtained in step 102 is the target area marked by the relevant personnel or the trained AI model, and the shape of the area may be regular or irregular. Regardless of whether it is regular or not, in step 103, the minimum bounding rectangle containing the target initial area will be used to expand its shape to a regular shape, that is, the initial clipping area. Therefore, the initial clipping area is an area of regular shape, which includes the target initial area (that is, the precise target area) and a small number of non-target initial areas.
[0034] 104, determining the index comparison interval according to the target initial area.
[0035] Although the index value (such as grayscale value) of the image area of the same target in the multi-frame grayscale images collected at the same time does not change much. However, the index value of the same target in the multi-frame grayscale images collected at different times will fluctuate. This fluctuation may be due to different acquisition parameters of the grayscale image acquisition device, or changes in the index value of the target itself. Therefore, it is necessary to determine the target adjustment area based on the index value of the target in the currently collected multi-frame grayscale images, so that a more accurate target area (i.e., target adjustment area) that is more in line with the current multi-frame grayscale images can be obtained in each non-first frame grayscale image.
[0036] Since the target initial area is the target area marked by relevant personnel or trained AI models, this area is the most accurate area that includes the target area. Therefore, the index value of this area can represent the index value of the target of the multi-frame grayscale image currently collected.
[0037] The implementation process of step 104 is as follows: 104-1, determine the index value of each pixel point covered by the target initial area.
[0038] 104-2, determine the maximum value max1, the minimum value min1, the mean value V3, and the standard deviation σ3 of the index values of all pixels.
[0039] 104-3, determine the adjustment coefficient δ1 based on max1, min1, V3, and σ3.
[0040] The implementation process of determining the adjustment coefficient δ1 is as follows: 104-3-1, determine the adjusted mean as (max1+min1+V3) / 3.
[0041] 104-3-2, determine the first adjustment degree as the adjusted mean / σ3.
[0042] The first adjustment degree represents the index value of the target of the multi-frame grayscale image currently collected from the change of the index value of each pixel point covered by the target initial area. The larger the value, the greater the fluctuation of the index value of the target of the multi-frame grayscale image currently collected.
[0043] 104-3-3, among the index values of all the pixels covered by the target initial area, determine the number of pixels n1 greater than the maximum value of the target index value standard interval, the number of pixels n2 less than the minimum value of the target index value standard interval, and the total number n3 of all the pixels covered by the target initial area.
[0044] The target indicator value standard interval is a pre-set range of normal target indicator values, such as the target indicator value standard interval is [40,50].
[0045] 104-3-4, determine the second adjustment degree as 1-[(n1×n1)+(n2×n2)+(n3-n1-n2)×(n3-n1-n2)] / (n3×n3).
[0046] The second adjustment degree is a distribution fluctuation from all pixels covered by the target initial area that meet the target index value standard, are higher than the target index value standard, and are lower than the target index value standard. The larger the value, the greater the distribution fluctuation.
[0047] 104-3-5, determine δ1=max{first adjustment degree, second adjustment degree}, where max{} is a maximum value function.
[0048] Among them, max{} is the maximum value function.
[0049] The first adjustment degree and the second adjustment degree characterize the fluctuation of the target index value of the multi-frame grayscale image currently collected from different dimensions, and the larger value of the two is used as the adjustment coefficient δ1.
[0050] 104-4, determine the initial comparison interval as [min1×(1-δ1), max1×(1+δ1)].
[0051] The initial comparison interval is an interval adjusted upward and downward by δ1 based on the target real index value of the currently acquired multi-frame grayscale image. This interval can accurately represent the target index value of the currently acquired multi-frame grayscale image.
[0052] 104-5, determine the index comparison interval as (preset target index value standard interval ∪ initial comparison interval) ∩ preset target index value maximum interval.
[0053] The initial comparison interval is the target index value of the currently acquired multi-frame grayscale image, and the target index value standard interval is the range of normal target index values. As long as the index value is within the range of normal target index values, it may be the target area. Therefore, merging the target index value standard interval with the initial comparison interval (that is, the preset target index value standard interval ∪ initial comparison interval) can obtain an interval that meets both the standard normal target and the target of the currently acquired multi-frame grayscale image.
[0054] Considering that the target index value will not increase or decrease infinitely, it has a maximum range of changes. The preset maximum range of the target index value is a maximum range of the target index value obtained by relevant personnel or trained AI models according to specific circumstances. If the preset target index value standard interval ∪ initial comparison interval is greater than this interval, it means that it is wrong. Therefore, the preset target index value standard interval ∪ initial comparison interval and the preset target index value maximum interval are intersected to obtain a normal target that meets the standard and the target interval of the currently collected multi-frame grayscale image, and also meets the target's light absorption characteristics. This interval is the index comparison interval.
[0055] The index comparison interval is an interval that satisfies the current multi-frame grayscale image conditions, the index value distribution of normal targets, and the target's light absorption characteristics. This interval ensures the accurate determination of subsequent target adjustment areas.
[0056] 105 , determine the mean value V1 and the standard deviation σ1 of the index values of all the pixels covered by the initial clipping area.
[0057] 106, determine the mean value V2 and the standard deviation σ2 of the index values of all the pixels covered by the target initial area.
[0058] 107, the mean comparison value is determined to be |V1-V2| / V1, and the standard deviation comparison value is determined to be |σ1-σ2| / σ1.
[0059] |V2-V3| represents the change between the overall index value (i.e., V2) of the non-target area (i.e., the initial cropping area) and the index value (i.e., V3) of the precise target area (i.e., the target initial area). This change is the change caused by the index value of the non-target area. Therefore, |V2-V3| / V2 represents the proportion of the change in the index value of the non-target area to the index value of the non-target area, that is, the proportion of the change in the index value of the non-target area in the overall non-target area (i.e., the initial cropping area).
[0060] |σ2-σ3| represents the change between the overall index value fluctuation (i.e., σ2-) of the non-target area (i.e., the initial clipping area) and the index value fluctuation (i.e., V3) of the precise target area (i.e., the target initial area). This change is the change caused by the index value fluctuation of the non-target area. Therefore, |σ2-σ3| / σ2 represents the proportion of the change in the index value fluctuation of the non-target area to the index value fluctuation of the non-target area, that is, the proportion of the change in the index value fluctuation of the non-target area in the overall non-target area (i.e., the initial clipping area).
[0061] 108, determining both the mean comparison value and the standard deviation comparison value as target comparison values.
[0062] After executing this, a target comparison value can be obtained. The target comparison value includes a mean comparison value and a standard deviation comparison value, which are determined according to the initial clipping area.
[0063] Because the subsequent target adjustment area is an expanded area that includes the precise target area, the area includes non-target areas in addition to the precise target area. The index comparison interval can only reflect the situation of the target area in the target adjustment area, but cannot reflect the situation of the non-target area in the target adjustment area. The initial clipping area includes the target initial area (i.e., the precise target area) and the non-target initial area. The index value of the initial clipping area can be used to characterize the index value of the target area and the non-target area in the target adjustment area. Therefore, the target comparison value can be used to characterize the overall distribution of the index value of the target adjustment area from two dimensions: the mean change and the fluctuation change of the index value.
[0064] 109, determining a target clipping area according to the target comparison value.
[0065] The implementation process of this step is as follows: 109-1, for each non-first frame grayscale image, the initial cropping area is expanded outward by one pixel in each direction in turn, and the target area in each non-first frame grayscale image is determined according to the area after each expansion, the index comparison interval and the target comparison value.
[0066] The target area in each non-first frame grayscale image is based on the initial cropping area and is expanded in all directions until the minimum area including the target area is obtained.
[0067] For any non-first frame grayscale image i, its target area (i.e., target adjustment area) is determined by the following steps: 201 , determining the index value of each pixel point covered by the initial clipping area in the grayscale image i.
[0068] In each multi-frame grayscale image, although the position of the grayscale image acquisition device is relatively fixed, this fixation will make the basic position of the target image in each frame of grayscale image unchanged. However, the area (i.e., size) of the target may change. For example, if the target is a balloon, as the balloon is blown into gas, its basic position remains unchanged but its size changes. Another example is that if the target is a car, the car moves straight toward the grayscale image acquisition device, and its basic position remains unchanged but its size changes.
[0069] It should be noted that the basic position is a specific position in the target, not the position covered by the target. For example, as the size of the target changes, the area covered by the target will change, but its central position remains relatively unchanged, and this central position is the basic position.
[0070] In specific implementation, the initial clipping area can be used as a fixed area, and the target area (ie, the target adjustment area) of the grayscale image i is searched outward from the area.
[0071] In a specific implementation, the pixel identifiers covered by the initial cropping area in the first frame of the grayscale image can be determined to form an identifier set, and the area in the grayscale image i that covers the pixel identifiers of all the identifiers in the identifier set is determined as the area covered by the initial cropping area in the grayscale image i, the pixel identifiers corresponding to each identifier in the identifier set are determined as the pixel identifiers covered by the initial cropping area in the grayscale image i, and the index values of the pixel identifiers corresponding to each identifier in the identifier set in the grayscale image i are determined as the index values of each pixel identifier covered by the initial cropping area in the grayscale image i.
[0072] 202, according to the index value of each pixel covered by the initial clipping area in the grayscale image i, determine the number of pixels n4 that are not located in the target index comparison interval, the mean V4 and the standard deviation σ4 of the index values of all pixels covered by the initial clipping area in the grayscale image i.
[0073] 203 , determine the area formed by all the pixels covered by the initial clipping area in the grayscale image i as the processing area.
[0074] For example, the processing area is the area formed by all pixels covered by the initial clipping area in the grayscale image i, such as Figure 2The area covered by the solid line box is shown.
[0075] It should be noted that Figure 2 The size and position of the solid-line box are examples and do not represent the actual situation. In actual application, the size and position of the solid-line box are determined according to the actual situation.
[0076] 204 , according to the preset direction priority, select the direction with the highest priority as the expansion direction.
[0077] Direction priority is preset and can be set by relevant personnel. If not set, it can be a default priority or a random priority. For example, the priorities from high to low are up, down, left, and right. It should be noted that the up, down, left, and right here are relative to the coordinate system, such as up is the positive direction of the vertical axis, down is the negative direction of the vertical axis, left is the positive direction of the horizontal axis, and right is the negative direction of the horizontal axis.
[0078] 205, the current processing area is enlarged by one pixel in the current enlargement direction, and the enlarged area is determined according to the area after each enlargement, n4, V4, σ4, the target indicator comparison interval and the target comparison value.
[0079] For example, the enlarged area is determined by the following method: 205-1, initialize the expansion times n5=1.
[0080] n5 represents the total number of pixels actually enlarged in the current processing area in the current enlargement direction.
[0081] 205-2, determine the current processing area as the first area.
[0082] like Figure 2 The area covered by the solid line frame in is the first area.
[0083] 205-3, determine a region obtained by enlarging the first region by 1 pixel in the current enlarging direction as the second region.
[0084] For example, if the current expansion direction is upward, Figure 2 The upper edge of the area covered by the solid line frame in Figure 3 The solid line in the figure is further expanded upward by 1 pixel to obtain Figure 3 The area covered by the dotted box is the second area.
[0085] 205-4, respectively determine the index values of all pixels covered by the first area and the second area.
[0086] 205-5, determine the enlargement change degree according to the index values of all pixels covered by the first area and the second area, n4, V4, σ4, the target index comparison interval and the target comparison value.
[0087] The process of determining the degree of enlargement change is as follows: ① According to the index values of all the pixels covered by the first area, determine the number of pixels n61 that are not located in the target index comparison interval, the mean V51 and the standard deviation σ51 of the index values of all the pixels covered by the first area.
[0088] ② According to the index values of all the pixels covered by the second area, determine the number of pixels n62 that are not located in the target index comparison interval, the mean V52 and the standard deviation σ52 of the index values of all the pixels covered by the second area.
[0089] ③If n62-n61>0, the enlarged change degree is determined to be the preset maximum value. If n62-n61≤0, the mean change value is determined to be |V52-V51| / V4, the standard deviation change value is determined to be |σ52-σ51| / σ4, and the enlarged change degree is determined according to the mean change value, standard deviation change value, n4 and target comparison value.
[0090] n62-n61 represents the change in the number of points with abnormal index values (i.e., pixel points in the second region whose index values are not in the target index comparison interval) in the region after expanding by 1 pixel in the current expansion direction. If n62-n61>0, it means that the number of points with abnormal index values has increased after expanding by 1 pixel in the current expansion direction. Therefore, the expansion change degree is determined to be the preset maximum value. This indicates that the change has caused the index value of the second region to deteriorate. Then, the edge in the current expansion direction before expanding by 1 pixel in the current expansion direction is the maximum position of the target adjustment region of the grayscale image i in this direction.
[0091] If n62-n61≤0, it means that after expanding by 1 pixel in the current expansion direction, the point with abnormal index value has not changed or has decreased. At this time, it is possible that the maximum position of the target adjustment area of the grayscale image i in this direction is reached, or it may not be reached. Therefore, the expansion change degree is determined based on the mean change value (i.e. |V52-V51| / V4), the standard deviation change value (i.e. |σ52-σ51| / σ4), n4 and the target comparison value.
[0092] Since the target comparison value includes the mean comparison value and the standard deviation comparison value, the process of determining the enlarged change degree according to the mean change value, the standard deviation change value, n4 and the target comparison value is: If the mean change value > mean comparison value × (1 + preset mean adjustment ratio), or the standard deviation change value > standard deviation comparison value × (1 + preset standard deviation adjustment ratio), then the expanded change degree is determined to be the preset maximum value.
[0093] If the mean change value ≤ mean comparison value × (1 + preset mean adjustment ratio), and the standard deviation change value ≤ standard deviation comparison value × (1 + preset standard deviation adjustment ratio), then the expanded change degree is determined as the cube root of the change value, where the change value is [(n62-n61) / n4] × mean change value × standard deviation change value.
[0094] Among them, the preset standard deviation adjustment ratio is a value of 0-1, which is a preset empirical value used to adjust the accuracy. If the accuracy requirement is high, the standard deviation adjustment ratio will increase, so that the mean comparison value × (1 + preset mean adjustment ratio) and the standard deviation comparison value × (1 + preset standard deviation adjustment ratio) will increase, and the mean comparison value × (1 + preset mean adjustment ratio) and the standard deviation comparison value × (1 + preset standard deviation adjustment ratio) can be used as the stop threshold for each area expansion (that is, the normal change ratio), that is If the mean change value before and after each area expansion is greater than the mean comparison value × (1 + the preset mean adjustment ratio), or the standard deviation change value is greater than the standard deviation comparison value × (1 + the preset standard deviation adjustment ratio), the area expansion will be stopped and the expansion change degree will be directly determined to be the preset maximum value. If the mean change value is ≤ the mean comparison value × (1 + the preset mean adjustment ratio), and the standard deviation change value is ≤ the standard deviation comparison value × (1 + the preset standard deviation adjustment ratio), then whether to stop the area expansion will be further determined by the expansion change degree. That is to say, the accuracy of determining whether to stop the expansion of the area by expanding the degree of change is greater than the accuracy of directly determining the expansion degree of change to be a preset maximum value. Therefore, the larger the preset standard deviation adjustment ratio, the lower the probability of satisfying the mean change value > mean comparison value × (1 + preset mean adjustment ratio), or the standard deviation change value > standard deviation comparison value × (1 + preset standard deviation adjustment ratio). The probability of further determining whether to stop the expansion of the area by expanding the degree of change increases, that is, more fine-grained judgments will increase, which will result in a more accurate judgment result and a more accurate target adjustment area.
[0095] In addition, the mean change value is |V52-V51| / V4, where |V52-V51| represents the degree of change of the average index value in the area after expanding by one pixel in the current expansion direction compared with that before expansion, and |V52-V51| / V4 is the ratio of the degree of change to the mean V4 of the index values of all pixels covered by the initial clipping area in the grayscale image i. If the ratio is greater than the mean comparison value × (1 + the preset mean adjustment ratio), it means that the mean change ratio is greater than the normal mean change ratio, indicating that the abnormal change degree of the average index value after expanding by one pixel in the current expansion direction is abnormal, and therefore, the expansion change degree is determined to be the preset maximum value. At this time, it means that the change has caused a large fluctuation in the average index value, and the edge in the current expansion direction before expanding by one pixel in the current expansion direction is the maximum position of the target adjustment area of the grayscale image i in this direction.
[0096] The standard deviation change value is |σ52-σ51| / σ4, where |σ52-σ51| represents the change degree of the index value in the area after expanding by 1 pixel in the current expansion direction (i.e., the standard deviation of the index value) compared with the change degree before expansion, and |σ52-σ51| / σ4 is the ratio of the change degree to the standard deviation σ4 of all pixels covered by the initial clipping area in the grayscale image i. If this ratio is larger than the standard deviation comparison value × (1 + the preset standard deviation adjustment ratio), the standard deviation change ratio is larger than the normal standard deviation change ratio, indicating that the standard deviation change degree of the average index value after expanding by 1 pixel in the current expansion direction is abnormal, that is, the index value fluctuates abnormally, and therefore, the expansion change degree is determined to be the preset maximum value. At this time, it means that the change has caused a large fluctuation in the index value, so the edge in the current expansion direction before expanding by 1 pixel in the current expansion direction is the maximum position of the target adjustment area of the grayscale image i in this direction.
[0097] If the mean change value is ≤ mean comparison value × (1 + preset mean adjustment ratio), and the standard deviation change value is ≤ standard deviation comparison value × (1 + preset standard deviation adjustment ratio), it means that the changes in the mean value and standard deviation of the indicator value after expanding by 1 pixel in the current expansion direction are normal. Then, the cube root of [(n62-n61) / n4] × mean change value × standard deviation change value is taken as the expansion change degree, and whether to stop expanding in this direction is determined based on the expansion change degree.
[0098] 205-6, if the enlarged change degree is greater than the preset change degree threshold, the first area is determined as the enlarged area. If the enlarged change degree is not greater than the preset change degree threshold, n5 is updated to n5+1, if n5 is equal to the preset change threshold, the first area is determined as the enlarged area, if n5 is less than the preset change threshold, the first area is updated to the second area, and the step of determining the area obtained by enlarging the first area by 1 pixel in the current enlargement direction as the second area (i.e., step 205-3) and subsequent steps are repeated.
[0099] The change threshold is a preset value, which can be an empirical value or a normal change ratio caused by the expansion of the target image area by one pixel in one direction through a big data learning model based on a large amount of sample data. The process of determining the change threshold is an existing process and will not be described in detail here.
[0100] If the enlargement change degree is greater than the preset change threshold, it means that the change brought about by expanding by one pixel in the current enlargement direction exceeds the normal change. Then the edge in the current enlargement direction before expanding by one pixel in the current enlargement direction is the maximum position of the target adjustment area of the grayscale image i in this direction, and therefore the first area is determined as the enlarged area.
[0101] If the enlargement change degree is not greater than the preset change degree threshold, it means that the change brought about by enlarging one pixel in the current enlargement direction is normal and has not reached the maximum position in this direction. Therefore, A) n5 is updated to n5+1 (i.e. n5=n5+1). B) if n5 (i.e. n5 after update) is equal to the preset change threshold, it means that the enlargement range in this direction exceeds the maximum range of the target, and the first area is determined as the enlarged area. C) if n5 (i.e. n5 after update) is less than the preset change threshold, it means that it can continue to expand in this direction, so the first area is updated to the second area (i.e. Figure 3 The area shown is taken as the current first area), and step 205-3 and subsequent steps are repeated until the enlarged change degree is greater than the preset change degree threshold or the updated n5 is equal to the preset change threshold.
[0102] For example, when executing step 205-3 and subsequent steps again, Figure 3 The area shown is expanded upward by 1 pixel again, and whether to continue expanding or stop expanding is determined based on the indicator values in the area before and after the expansion.
[0103] In addition, the change threshold is determined based on the maximum width of the target image on the axis. For example, the target image occupies a maximum of x pixels in the vertical axis direction, and the target initial area occupies a maximum of x1 pixels in the vertical axis direction. Then, it can be expanded by a maximum of x-x1 pixels in the vertical axis direction. The expansion in the vertical axis direction includes upward expansion and downward expansion. It can be expanded upward by (x-x1) / 2 pixels. Add the estimated pixel redundancy value y (this value is a pre-set value to compensate for the errors caused by force majeure factors such as acquisition equipment and operation during grayscale image acquisition, as well as the errors in the above processing). Therefore, the change threshold is y+(x-x1) / 2.
[0104] It is normal to expand within the change threshold. If it exceeds the change threshold, it means that it has exceeded the target area and is no longer the minimum area containing the target area, so further expansion stops.
[0105] After executing 205 , it indicates that the maximum position has been found in the current enlargement direction, so the enlargement in the current enlargement direction will be stopped, and the enlargement will be performed in other directions where the maximum position has not been found through 206 .
[0106] 206, update the processing area to the expanded area, update the expansion direction to a direction with a priority just lower than the current expansion direction, re-execute the process of expanding the current processing area by one pixel in the current expansion direction, and determine the step of expanding the area (i.e., step 205) and subsequent steps according to the area after each expansion, n4, V4, σ4, target indicator comparison interval and target comparison value until all directions are selected.
[0107] When entering step 206, the expanded area is an area that reaches the maximum position in the current expansion direction. In step 206, expansion in other directions will be performed on this basis (that is, steps 205 and 206 are repeated) so that the expansion is performed below while the upper position remains unchanged, and then the expansion is performed in the left direction while the upper and lower positions remain unchanged, and finally the expansion is performed on the right while the upper and lower left positions remain unchanged) to find the maximum position in other directions. When all four directions are executed, the expanded area obtained is the target area in the grayscale image i.
[0108] 207 , determining the current enlarged area as the target area in the grayscale image i.
[0109] In step 102, the target area (i.e., the initial cropping area) of the first frame grayscale image is obtained, and in step 109-1, the target areas (i.e., the target adjustment areas) in the other non-first frame grayscale images are determined. In other words, each frame grayscale image has a target area, except that the target area of the first frame grayscale image is named the initial cropping area, and the target area of the non-first frame grayscale image is named the target adjustment area, and the target adjustment area corresponds to the non-first frame grayscale image one by one.
[0110] 109-2, determining the acquired target area as the target adjustment area.
[0111] The target area is also the target adjustment area in the grayscale image i.
[0112] The target area is the smallest area that contains the target area, which is obtained by expanding the initial clipping area in all directions according to the index comparison interval and the target comparison value. Since the initial clipping area, the index comparison interval and the target comparison value can accurately represent the real situation of the target image of the multi-frame grayscale image currently collected, the target adjustment area is also the smallest area that more accurately contains the entire target image and non-target images. In other words, the target adjustment area is an accurate area with the least interference data.
[0113] 109-3, determining the minimum area including the initial clipping area and all target adjustment areas as the target clipping area.
[0114] The initial cropping area is the precise area with the least interference data in the first grayscale image among multiple grayscale images. Each target adjustment area is the precise area with the least interference data in its corresponding non-first grayscale image. The minimum area including the initial cropping area and all target adjustment areas is determined as the target cropping area. On the one hand, the target cropping areas of each grayscale image are the same and include the precise area with the least interference data.
[0115] 110 , cropping the grayscale image based on the target cropping area to obtain multiple frames of target grayscale images.
[0116] In step 110, non-target clipping areas are clipped from each frame of the grayscale image, leaving the target clipping area, and the remaining target clipping area is the target grayscale image.
[0117] The present embodiment relates to a grayscale image processing system, which includes: a grayscale image acquisition device and a grayscale image processing device. There is a communication connection between the grayscale image acquisition device and the grayscale image processing device; wherein the grayscale image acquisition device is used to acquire multiple frames of grayscale images, and transmit the multiple frames of grayscale images to the grayscale image processing device through the communication connection; each frame of grayscale image includes an image of the target; the grayscale image processing device is used to obtain the target area in the first frame of grayscale image, and determine the obtained area as the target initial area; determine the minimum circumscribed rectangle containing the target initial area as the initial clipping area; determine the index comparison interval based on the target initial area; determine the area covered by the initial clipping area The method comprises the following steps: determining the mean V1 and standard deviation σ1 of the index values of all pixels of the target initial area; determining the mean V2 and standard deviation σ2 of the index values of all pixels covered by the target initial area; determining the mean comparison value to be |V1-V2| / V1, and the standard deviation comparison value to be |σ1-σ2| / σ1; determining both the mean comparison value and the standard deviation comparison value as the target comparison value; determining the target clipping area according to the target comparison value; clipping the grayscale image based on the target clipping area to obtain multiple frames of target grayscale images, so that the multiple frames of target grayscale images are the most accurate areas including the accurate target image.
[0118] Based on the same inventive concept of the grayscale image processing system, this embodiment provides a grayscale image processing device, which is a grayscale image processing device in the grayscale image processing system.
[0119] The grayscale image processing device includes: a memory and a processor.
[0120] The memory is used to store computer programs involved in implementing the grayscale image acquisition device.
[0121] A processor is used to execute computer programs stored in the memory.
[0122] Specifically, there is a communication connection between the grayscale image processing device and the grayscale image acquisition device.
[0123] The computer program involved in implementing the grayscale image processing device can obtain multiple frames of grayscale images collected by the grayscale image acquisition device through a communication connection, wherein each frame of the grayscale image includes an image of the target. The target area in the first frame of the grayscale image is obtained, and the obtained area is determined as the target initial area. The minimum circumscribed rectangle containing the target initial area is determined as the initial clipping area. The index comparison interval is determined according to the target initial area. The mean V1 and standard deviation σ1 of the index values of all pixels covered by the initial clipping area are determined. The mean V2 and standard deviation σ2 of the index values of all pixels covered by the target initial area are determined. The mean comparison value is determined to be |V1-V2| / V1, and the standard deviation comparison value is determined to be |σ1-σ2| / σ1. The mean comparison value and the standard deviation comparison value are both determined as target comparison values. According to the target comparison value, the target clipping area is determined. The grayscale image is clipped based on the target clipping area to obtain multiple frames of target grayscale images.
[0124] Optionally, determining a target clipping area according to the target comparison value includes: For each non-first frame grayscale image, the initial cropping area is expanded outward by one pixel in each direction in turn, and the target area in each non-first frame grayscale image is determined based on the area after each expansion, the index comparison interval and the target comparison value.
[0125] The acquired target area is determined as the target adjustment area.
[0126] The minimum area including the initial clipping area and all target adjustment areas is determined as the target clipping area.
[0127] Optionally, the indicator comparison interval is determined according to the target initial area, including: Determine the index value of each pixel covered by the target initial area.
[0128] Determine the maximum value max1, minimum value min1, mean value V3, and standard deviation σ3 of the index values of all pixels.
[0129] The adjustment coefficient δ1 is determined based on max1, min1, V3, and σ3.
[0130] Determine the initial comparison interval as [min1×(1-δ1),max1×(1+δ1)].
[0131] The indicator comparison interval is determined to be (preset target indicator value standard interval ∪ initial comparison interval) ∩preset target indicator value maximum interval.
[0132] Optionally, the adjustment coefficient δ1 is determined according to max1, min1, V3, and σ3, including: Determine the adjusted mean as (max1+min1+V3) / 3.
[0133] The first adjustment degree is determined to be the adjusted mean value / σ3.
[0134] Among the index values of all pixels covered by the target initial area, determine the number of pixels n1 greater than the maximum value of the target index value standard interval, the number of pixels n2 less than the minimum value of the target index value standard interval, and the total number n3 of all pixels covered by the target initial area.
[0135] The second adjustment degree is determined to be 1-[(n1×n1)+(n2×n2)+(n3-n1-n2)×(n3-n1-n2)] / (n3×n3).
[0136] Determine δ1=max{first adjustment degree, second adjustment degree}, where max{} is a maximum value function.
[0137] Optionally, for each non-first frame grayscale image, the initial cropping area is sequentially expanded outward by one pixel in each direction, and the target area in each non-first frame grayscale image is determined according to the area after each expansion, the index comparison interval and the target comparison value, including: For any non-first frame grayscale image i, its target area is determined by the following steps: Determine the index value of each pixel covered by the initial clipping area in the grayscale image i.
[0138] According to the index value of each pixel covered by the initial clipping area in the grayscale image i, the number of pixels n4 not located in the target index comparison interval, the mean V4 and standard deviation σ4 of the index values of all pixels covered by the initial clipping area in the grayscale image i are determined.
[0139] The area formed by all the pixels covered by the initial clipping area in the grayscale image i is determined as the processing area.
[0140] According to the preset direction priority, the direction with the highest priority is selected as the expansion direction.
[0141] The current processing area is enlarged by one pixel in the current enlargement direction, and the enlarged area is determined according to the area after each enlargement, n4, V4, σ4, target indicator comparison interval and target comparison value.
[0142] Update the processing area to the expanded area, update the expansion direction to the direction with a priority just lower than the current expansion direction, re-execute the process of expanding the current processing area by one pixel in the current expansion direction, and determine the step of expanding the area and subsequent steps based on the area after each expansion, n4, V4, σ4, target indicator comparison interval and target comparison value until all directions are selected.
[0143] The current enlarged area is determined as the target area in the grayscale image i.
[0144] Optionally, the current processing area is sequentially enlarged by one pixel in the current enlargement direction, and the enlarged area is determined according to the enlarged area, n4, V4, σ4, target index comparison interval and target comparison value, including: Initialize the expansion times n5=1.
[0145] The current processing region is determined as the first region.
[0146] An area obtained by enlarging the first area by 1 pixel in the current enlargement direction is determined as the second area.
[0147] The index values of all pixels covered by the first area and the second area are determined respectively.
[0148] The enlarged change degree is determined according to the index values of all pixels covered by the first area and the second area, n4, V4, σ4, the target index comparison interval and the target comparison value.
[0149] If the enlarged change degree is greater than the preset change degree threshold, the first area is determined as the enlarged area. If the enlarged change degree is not greater than the preset change degree threshold, n5 is updated to n5+1, if n5 is equal to the preset change threshold, the first area is determined as the enlarged area, if n5 is less than the preset change threshold, the first area is updated to the second area, and the step of determining the area obtained by enlarging the first area by 1 pixel in the current enlargement direction as the second area and subsequent steps are repeated.
[0150] Optionally, determining the enlarged change degree according to the index values, n4, V4, σ4, target index comparison interval and target comparison value of all pixels covered by the first area and the second area includes: According to the index values of all the pixels covered by the first area, the number n61 of pixels not located in the target index comparison interval, the mean V51 and the standard deviation σ51 of the index values of all the pixels covered by the first area are determined.
[0151] According to the index values of all the pixels covered by the second area, the number n62 of pixels not located in the target index comparison interval, the mean V52 and the standard deviation σ52 of the index values of all the pixels covered by the second area are determined.
[0152] If n62-n61>0, the enlarged change degree is determined to be a preset maximum value.
[0153] If n62-n61≤0, the mean change value is determined to be |V52-V51| / V4, the standard deviation change value is determined to be |σ52-σ51| / σ4, and the expanded change degree is determined based on the mean change value, standard deviation change value, n4 and target comparison value.
[0154] Optionally, the target comparison value includes a mean comparison value and a standard deviation comparison value.
[0155] The degree of expansion change is determined based on the mean change value, standard deviation change value, n4 and target comparison value, including: If the mean change value > mean comparison value × (1 + preset mean adjustment ratio), or the standard deviation change value > standard deviation comparison value × (1 + preset standard deviation adjustment ratio), then the expanded change degree is determined to be the preset maximum value.
[0156] If the mean change value ≤ mean comparison value × (1 + preset mean adjustment ratio), and the standard deviation change value ≤ standard deviation comparison value × (1 + preset standard deviation adjustment ratio), then the expanded change degree is determined as the cube root of the change value, where the change value is [(n62-n61) / n4] × mean change value × standard deviation change value.
[0157] The grayscale image processing device provided in the present embodiment obtains the target area in the first frame of grayscale image, and determines the obtained area as the target initial area; determines the minimum circumscribed rectangle containing the target initial area as the initial clipping area; determines the index comparison interval according to the target initial area; determines the mean V1 and standard deviation σ1 of the index values of all pixels covered by the initial clipping area; determines the mean V2 and standard deviation σ2 of the index values of all pixels covered by the target initial area; determines the mean comparison value as |V1-V2| / V1, and the standard deviation comparison value as |σ1-σ2| / σ1; determines both the mean comparison value and the standard deviation comparison value as target comparison values; determines the target clipping area according to the target comparison value; clips the grayscale image based on the target clipping area to obtain multiple frames of target grayscale images, so that the multiple frames of target grayscale images are the most accurate areas including accurate target images.
[0158] Based on the same inventive concept of the grayscale image processing system, this embodiment provides a computer-readable storage medium on which a computer program involved in implementing a grayscale image processing device is stored.
[0159] Specifically, there is a communication connection between the grayscale image processing device and the grayscale image acquisition device.
[0160] The computer program involved in implementing the grayscale image processing device can obtain multiple frames of grayscale images collected by the grayscale image acquisition device through a communication connection, wherein each frame of the grayscale image includes an image of the target. The target area in the first frame of the grayscale image is obtained, and the obtained area is determined as the target initial area. The minimum circumscribed rectangle containing the target initial area is determined as the initial clipping area. The index comparison interval is determined according to the target initial area. The mean V1 and standard deviation σ1 of the index values of all pixels covered by the initial clipping area are determined. The mean V2 and standard deviation σ2 of the index values of all pixels covered by the target initial area are determined. The mean comparison value is determined to be |V1-V2| / V1, and the standard deviation comparison value is determined to be |σ1-σ2| / σ1. The mean comparison value and the standard deviation comparison value are both determined as target comparison values. According to the target comparison value, the target clipping area is determined. The grayscale image is clipped based on the target clipping area to obtain multiple frames of target grayscale images.
[0161] Optionally, determining a target clipping area according to the target comparison value includes: For each non-first frame grayscale image, the initial cropping area is expanded outward by one pixel in each direction in turn, and the target area in each non-first frame grayscale image is determined based on the area after each expansion, the index comparison interval and the target comparison value.
[0162] The acquired target area is determined as the target adjustment area.
[0163] The minimum area including the initial clipping area and all target adjustment areas is determined as the target clipping area.
[0164] Optionally, the indicator comparison interval is determined according to the target initial area, including: Determine the index value of each pixel covered by the target initial area.
[0165] Determine the maximum value max1, minimum value min1, mean value V3, and standard deviation σ3 of the index values of all pixels.
[0166] The adjustment coefficient δ1 is determined based on max1, min1, V3, and σ3.
[0167] Determine the initial comparison interval as [min1×(1-δ1),max1×(1+δ1)].
[0168] The indicator comparison interval is determined to be (preset target indicator value standard interval ∪ initial comparison interval) ∩preset target indicator value maximum interval.
[0169] Optionally, the adjustment coefficient δ1 is determined according to max1, min1, V3, and σ3, including: Determine the adjusted mean as (max1+min1+V3) / 3.
[0170] The first adjustment degree is determined to be the adjusted mean value / σ3.
[0171] Among the index values of all pixels covered by the target initial area, determine the number of pixels n1 greater than the maximum value of the target index value standard interval, the number of pixels n2 less than the minimum value of the target index value standard interval, and the total number n3 of all pixels covered by the target initial area.
[0172] The second adjustment degree is determined to be 1-[(n1×n1)+(n2×n2)+(n3-n1-n2)×(n3-n1-n2)] / (n3×n3).
[0173] Determine δ1=max{first adjustment degree, second adjustment degree}, where max{} is a maximum value function.
[0174] Optionally, for each non-first frame grayscale image, the initial cropping area is sequentially expanded outward by one pixel in each direction, and the target area in each non-first frame grayscale image is determined according to the area after each expansion, the index comparison interval and the target comparison value, including: For any non-first frame grayscale image i, its target area is determined by the following steps: Determine the index value of each pixel covered by the initial clipping area in the grayscale image i.
[0175] According to the index value of each pixel covered by the initial clipping area in the grayscale image i, the number of pixels n4 not located in the target index comparison interval, the mean V4 and standard deviation σ4 of the index values of all pixels covered by the initial clipping area in the grayscale image i are determined.
[0176] The area formed by all the pixels covered by the initial clipping area in the grayscale image i is determined as the processing area.
[0177] According to the preset direction priority, the direction with the highest priority is selected as the expansion direction.
[0178] The current processing area is enlarged by one pixel in the current enlargement direction, and the enlarged area is determined according to the area after each enlargement, n4, V4, σ4, target indicator comparison interval and target comparison value.
[0179] Update the processing area to the expanded area, update the expansion direction to the direction with a priority just lower than the current expansion direction, re-execute the process of expanding the current processing area by one pixel in the current expansion direction, and determine the step of expanding the area and subsequent steps based on the area after each expansion, n4, V4, σ4, target indicator comparison interval and target comparison value until all directions are selected.
[0180] The current enlarged area is determined as the target area in the grayscale image i.
[0181] Optionally, the current processing area is sequentially enlarged by one pixel in the current enlargement direction, and the enlarged area is determined according to the enlarged area, n4, V4, σ4, target index comparison interval and target comparison value, including: Initialize the expansion times n5=1.
[0182] The current processing region is determined as the first region.
[0183] An area obtained by enlarging the first area by 1 pixel in the current enlargement direction is determined as the second area.
[0184] The index values of all pixels covered by the first area and the second area are determined respectively.
[0185] The enlarged change degree is determined according to the index values of all pixels covered by the first area and the second area, n4, V4, σ4, the target index comparison interval and the target comparison value.
[0186] If the enlarged change degree is greater than the preset change degree threshold, the first area is determined as the enlarged area. If the enlarged change degree is not greater than the preset change degree threshold, n5 is updated to n5+1, if n5 is equal to the preset change threshold, the first area is determined as the enlarged area, if n5 is less than the preset change threshold, the first area is updated to the second area, and the step of determining the area obtained by enlarging the first area by 1 pixel in the current enlargement direction as the second area and subsequent steps are repeated.
[0187] Optionally, determining the enlarged change degree according to the index values, n4, V4, σ4, target index comparison interval and target comparison value of all pixels covered by the first area and the second area includes: According to the index values of all the pixels covered by the first area, the number n61 of pixels not located in the target index comparison interval, the mean V51 and the standard deviation σ51 of the index values of all the pixels covered by the first area are determined.
[0188] According to the index values of all the pixels covered by the second area, the number n62 of pixels not located in the target index comparison interval, the mean V52 and the standard deviation σ52 of the index values of all the pixels covered by the second area are determined.
[0189] If n62-n61>0, the enlarged change degree is determined to be a preset maximum value.
[0190] If n62-n61≤0, the mean change value is determined to be |V52-V51| / V4, the standard deviation change value is determined to be |σ52-σ51| / σ4, and the expanded change degree is determined based on the mean change value, standard deviation change value, n4 and target comparison value.
[0191] Optionally, the target comparison value includes a mean comparison value and a standard deviation comparison value.
[0192] The degree of expansion change is determined based on the mean change value, standard deviation change value, n4 and target comparison value, including: If the mean change value > mean comparison value × (1 + preset mean adjustment ratio), or the standard deviation change value > standard deviation comparison value × (1 + preset standard deviation adjustment ratio), then the expanded change degree is determined to be the preset maximum value.
[0193] If the mean change value ≤ mean comparison value × (1 + preset mean adjustment ratio), and the standard deviation change value ≤ standard deviation comparison value × (1 + preset standard deviation adjustment ratio), then the expanded change degree is determined as the cube root of the change value, where the change value is [(n62-n61) / n4] × mean change value × standard deviation change value.
[0194] The computer-readable storage medium provided in this embodiment has a computer program executed by a processor to obtain a target area in a first frame grayscale image, and determine the obtained area as a target initial area; determine a minimum circumscribed rectangle containing the target initial area as an initial clipping area; determine an index comparison interval according to the target initial area; determine a mean V1 and a standard deviation σ1 of the index values of all pixels covered by the initial clipping area; determine a mean V2 and a standard deviation σ2 of the index values of all pixels covered by the target initial area; determine a mean comparison value of |V1-V2| / V1 and a standard deviation comparison value of |σ1-σ2| / σ1; determine both the mean comparison value and the standard deviation comparison value as target comparison values; determine a target clipping area according to the target comparison value; clip the grayscale image based on the target clipping area to obtain multiple frames of target grayscale images, so that the multiple frames of target grayscale images are the most accurate areas including accurate target images.
[0195] It should be clear that the present invention is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known system is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the system process of the present invention is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present invention.
[0196] It should also be noted that the exemplary embodiments mentioned in the present invention describe some systems or systems based on a series of steps or devices. However, the present invention is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiments, or in a different order from the embodiments, or several steps can be performed simultaneously.
[0197] Finally, it should be noted that the above-described embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some or all of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A grayscale image processing system, characterized in that: The system comprises: a grayscale image acquisition device and a grayscale image processing device; There is a communication connection between the grayscale image acquisition device and the grayscale image processing device; The grayscale image acquisition device is used to acquire multiple frames of grayscale images and transmit the multiple frames of grayscale images to the grayscale image processing device through a communication connection; each frame of grayscale image includes an image of the target; The grayscale image processing device is used to obtain a target area in a first frame of a grayscale image, and determine the obtained area as a target initial area; determine a minimum circumscribed rectangle containing the target initial area as an initial clipping area; determine an index comparison interval according to the target initial area; determine a mean V1 and a standard deviation σ1 of index values of all pixels covered by the initial clipping area; determine a mean V2 and a standard deviation σ2 of index values of all pixels covered by the target initial area; determine a mean comparison value as |V1-V2| / V1 and a standard deviation comparison value as |σ1-σ2| / σ1; determine both the mean comparison value and the standard deviation comparison value as target comparison values; determine a target clipping area according to the target comparison value; and clip the grayscale image based on the target clipping area to obtain multiple frames of target grayscale images.
2. The system according to claim 1, characterized in that The step of determining a target clipping area according to the target comparison value includes: For each non-first frame grayscale image, the initial cropping area is expanded outward by one pixel in each direction, and the target area in each non-first frame grayscale image is determined according to the area after each expansion, the index comparison interval and the target comparison value; determining the acquired target area as a target adjustment area; The minimum area including the initial clipping area and all target adjustment areas is determined as the target clipping area.
3. The system according to claim 1, characterized in that Determining the indicator comparison interval according to the target initial area includes: Determine the index value of each pixel point covered by the target initial area; Determine the maximum value max1, minimum value min1, mean value V3, and standard deviation σ3 of the index values of all pixels; Determine the adjustment coefficient δ1 based on max1, min1, V3, and σ3; Determine the initial comparison interval as [min1×(1-δ1), max1×(1+δ1)]; The indicator comparison interval is determined to be (preset target indicator value standard interval ∪ initial comparison interval) ∩preset target indicator value maximum interval.
4. The system according to claim 3, characterized in that The step of determining the adjustment coefficient δ1 according to max1, min1, V3, and σ3 includes: Determine the adjusted mean value to be (max1+min1+V3) / 3; Determine the first adjustment degree as the adjusted mean / σ3; Among the index values of all pixels covered by the target initial area, determine the number of pixels n1 greater than the maximum value of the target index value standard interval, the number of pixels n2 less than the minimum value of the target index value standard interval, and the total number n3 of all pixels covered by the target initial area; Determine the second adjustment degree as 1-[(n1×n1)+(n2×n2)+(n3-n1-n2)×(n3-n1-n2)] / (n3×n3); Determine δ1=max{first adjustment degree, second adjustment degree}; wherein max{} is a maximum value function.
5. The system according to claim 2, characterized in that For each non-first frame grayscale image, the initial cropping area is sequentially expanded outward by one pixel in each direction, and the target area in each non-first frame grayscale image is determined according to the area after each expansion, the index comparison interval and the target comparison value, including: For any non-first frame grayscale image i, its target area is determined by the following steps: Determine the index value of each pixel point covered by the initial clipping area in the grayscale image i; According to the index value of each pixel covered by the initial clipping area in the grayscale image i, determine the number of pixels n4 that are not located in the target index comparison interval, the mean V4 and the standard deviation σ4 of the index values of all pixels covered by the initial clipping area in the grayscale image i; Determine the area formed by all the pixels covered by the initial clipping area in the grayscale image i as the processing area; According to the preset direction priority, the direction with the highest priority is selected as the expansion direction; The current processing area is enlarged by one pixel in the current enlargement direction, and the enlarged area is determined according to the enlarged area, n4, V4, σ4, target index comparison interval and target comparison value after each enlargement; The processing area is updated to an enlarged area, and the enlargement direction is updated to a direction with a priority only lower than the current enlargement direction, and the current processing area is enlarged one pixel in the current enlargement direction in sequence, and the step of enlarging the area and subsequent steps are determined according to the area after each enlargement, n4, V4, σ4, the target indicator comparison interval and the target comparison value, until all directions are selected; The current enlarged area is determined as the target area in the grayscale image i.
6. The system according to claim 5, characterized in that The current processing area is sequentially enlarged by one pixel in the current enlargement direction, and the enlarged area is determined according to the enlarged area, n4, V4, σ4, target index comparison interval and target comparison value, including: Initialize the expansion times n5=1; Determine the current processing area as the first area; Determine a region obtained by enlarging the first region by 1 pixel in the current enlarging direction as the second region; Determine the index values of all pixels covered by the first area and the second area respectively; Determine the enlarged change degree according to the index values, n4, V4, σ4, target index comparison interval and target comparison value of all pixel points covered by the first area and the second area; If the enlargement change degree is greater than the preset change threshold, the first area is determined as the enlarged area; if the enlargement change degree is not greater than the preset change threshold, n5 is updated to n5+1, if n5 is equal to the preset change threshold, the first area is determined as the enlarged area, if n5 is less than the preset change threshold, the first area is updated to the second area, and the step of determining the area obtained by enlarging the first area by 1 pixel in the current enlargement direction as the second area and subsequent steps are repeated.
7. The system according to claim 6, characterized in that The step of determining the enlarged change degree according to the index values, n4, V4, σ4, target index comparison interval and target comparison value of all pixel points covered by the first area and the second area includes: According to the index values of all the pixels covered by the first area, determine the number of pixels n61 that are not located in the target index comparison interval, the mean V51 and the standard deviation σ51 of the index values of all the pixels covered by the first area; According to the index values of all the pixels covered by the second area, determine the number of pixels n62 that are not located in the target index comparison interval, the mean V52 and the standard deviation σ52 of the index values of all the pixels covered by the second area; If n62-n61>0, the enlarged change degree is determined to be a preset maximum value; If n62-n61≤0, the mean change value is determined to be |V52-V51| / V4, the standard deviation change value is determined to be |σ52-σ51| / σ4, and the expanded change degree is determined based on the mean change value, standard deviation change value, n4 and target comparison value.
8. The system according to claim 7, characterized in that The target comparison value includes a mean comparison value and a standard deviation comparison value; Determining the enlarged change degree according to the mean change value, the standard deviation change value, n4 and the target comparison value includes: If the mean change value > mean comparison value × (1 + preset mean adjustment ratio), or the standard deviation change value > standard deviation comparison value × (1 + preset standard deviation adjustment ratio), then the enlarged change degree is determined to be the preset maximum value; If the mean change value ≤ mean comparison value × (1 + preset mean adjustment ratio), and the standard deviation change value ≤ standard deviation comparison value × (1 + preset standard deviation adjustment ratio), then the expanded change degree is determined as the cube root of the change value, where the change value is [(n62-n61) / n4] × mean change value × standard deviation change value.
9. A grayscale image processing device, characterized in that: The grayscale image processing device is the grayscale image processing device in the system according to any one of claims 1 to 8; Wherein, the grayscale image processing device comprises: a memory and a processor; The memory is used to store a computer program involved in implementing the grayscale image acquisition device; The processor is used to execute the computer program stored in the memory.
10. A computer-readable storage medium, characterized in that: A computer program for implementing the grayscale image acquisition device in the system as described in any one of claims 1 to 8 is stored thereon.
Citation Information
Patent Citations
Vein recognition algorithm transplantation method and device
CN114612655A
Method for Determining the Position of a first Image Region in a Correspondence Image, SOC and Control Device, and System for Carrying out the Method, and Computer Program
US20220262033A1
Image processing method and device and storage medium thereof
WO2017215194A1
Video synopsis method, system and device
WO2022241805A1