A grayscale image processing system, a grayscale image processing device, and a storage medium

By acquiring the target area in the first frame image in the grayscale image processing system and dynamically adjusting the clipping area, the problem of difficult to process the target image in the multi-frame grayscale image in the prior art is solved, and precise tailoring of the target image is achieved.

CN119850655BActive Publication Date: 2025-05-30CHINESE PEOPLES LIBERATION ARMY GENERAL HOSPITAL HAINAN HOSPITAL
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510329370.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-03-20
Publication Date
2025-05-30
Estimated Expiration
2045-03-20

AI Technical Summary

Technical Problem

The prior art is difficult to accurately acquire images of specific areas in grayscale images, and it is impossible to effectively process target images in multi-frame grayscale images.

Method used

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 dynamically adjusting the target clipping area to achieve accurate clipping of multi-frame images.

Benefits of technology

The target image in multi-frame grayscale images is achieved to accurately and accurately tailor the target image to obtain the most accurate area containing the target image.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119850655B_ABST
    Figure CN119850655B_ABST
Patent Text Reader

Abstract

The present invention relates to a grayscale image processing system, a grayscale image processing device, and a storage medium. The system includes: a grayscale image acquisition device and a grayscale image processing device; wherein, the grayscale image acquisition device is configured to acquire multiple frames of grayscale images, and each frame of grayscale image includes an image of a target; the grayscale image processing device is configured to determine a target initial region in the first frame of grayscale image; determine the smallest circumscribed rectangle containing the target initial region as the initial clipping region; determine an index comparison interval according to the target initial region; determine a target comparison value according to the index values of all pixel points covered by the initial clipping region and the index values of all pixel points covered by the target initial region; determine a target clipping region according to the target comparison value; and perform clipping on the grayscale images based on the target clipping region to obtain multiple frames of target grayscale images, such that the multiple frames of target grayscale images are the most accurate regions including the accurate target image.
Need to check novelty before this filing date? Find Prior Art

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 the image of a specific area in a grayscale image. This requires processing the grayscale image, and a processing solution that can accurately obtain the image of the specific area in the grayscale image is needed. Summary of the Invention

[0003] 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, which includes: a grayscale image acquisition device and a grayscale image processing device;

[0005] There is a communication connection between the grayscale image acquisition device and the grayscale image processing device;

[0006] Among them, 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; among them, the image of the target is included in each frame of grayscale image;

[0007] 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 bounding rectangle containing the target initial area as the initial clipping area; determine the index comparison interval according to the target initial area; determine the mean value V1 and standard deviation σ1 of the index values of all pixel points covered by the initial clipping area; determine the mean value V2 and standard deviation σ2 of the index values of all pixel points covered by the target initial area; determine the mean comparison value as |V1 - V2| / V1, and the standard deviation comparison value as |σ1 - σ2| / σ1; determine both the mean comparison value and the standard deviation comparison value as the target comparison value; determine the target clipping area according to the target comparison value; and perform clipping on the grayscale image based on the target clipping area to obtain multiple frames of target grayscale images.

[0008] Optionally, determining the target clipping area according to the target comparison value includes:

[0009] For each non-first-frame grayscale image, expand the initial clipping area by one pixel point in each direction in turn, and determine the target area in each non-first-frame grayscale image according to the area after each expansion, the index comparison interval, and the target comparison value;

[0010] Determine the obtained target area as the target adjustment area;

[0011] Determine the target clipping region as the smallest region that includes the initial clipping region and all target adjustment regions.

[0012] Optionally, determine the index comparison interval according to the target initial region, including:

[0013] Determine the index values of each pixel point covered by the target initial region;

[0014] Determine the maximum value max1, minimum value min1, average value V3, and standard deviation σ3 of the index values of all pixel points;

[0015] Determine the adjustment coefficient δ1 according to max1, min1, V3, and σ3;

[0016] Determine the initial comparison interval as [min1×(1 - δ1), max1×(1 + δ1)];

[0017] Determine the index comparison interval as (the preset target index value standard interval ∪ the initial comparison interval) ∩ the preset target index value maximum interval.

[0018] Optionally, determine the adjustment coefficient δ1 according to max1, min1, V3, and σ3, including:

[0019] Determine the adjusted average value as (max1 + min1 + V3) / 3;

[0020] Determine the first adjustment degree as the adjusted average value / σ3;

[0021] Among the index values of all pixel points covered by the target initial region, determine the number of pixel points n1 greater than the maximum value of the target index value standard interval, the number of pixel points n2 less than the minimum value of the target index value standard interval, and the total number of all pixel points n3 covered by the target initial region;

[0022] Determine the second adjustment degree as 1 - [(n1×n1) + (n2×n2) + (n3 - n1 - n2)×(n3 - n1 - n2)] / (n3×n3);

[0023] Determine δ1 = max{the first adjustment degree, the second adjustment degree}; where max{} is the maximum value function.

[0024] Optionally, for each non-first-frame grayscale image, expand the initial clipping region by one pixel point in each direction in turn, and determine the target region in each non-first-frame grayscale image according to the region after each expansion, the index comparison interval, and the target comparison value, including:

[0025] For any non-first-frame grayscale image i, determine its target region through the following steps:

[0026] Determine the index values of the pixel points covered by the initial cropping region in the grayscale image i;

[0027] According to the index values of the pixel points covered by the initial cropping region in the grayscale image i, determine the number n4 of pixel points not located in the target index comparison interval, the mean value V4 and the standard deviation σ4 of the index values of all pixel points covered by the initial cropping region in the grayscale image i;

[0028] Determine the region formed by all pixel points covered by the initial cropping region in the grayscale image i as the processing region;

[0029] Select the direction with the highest priority as the expansion direction according to the preset direction priority;

[0030] Expand the current processing region by one pixel point in the current expansion direction in sequence. According to each expanded region, n4, V4, σ4, the target index comparison interval and the target comparison value, determine the expanded region;

[0031] Update the processing region to the expanded region, update the expansion direction to the direction with a priority only lower than the current expansion direction, and re - execute the step of expanding the current processing region by one pixel point in the current expansion direction and subsequent steps according to each expanded region, n4, V4, σ4, the target index comparison interval and the target comparison value until all directions are selected;

[0032] Determine the current expanded region as the target region in the grayscale image i.

[0033] Optionally, expand the current processing region by one pixel point in the current expansion direction in sequence. According to each expanded region, n4, V4, σ4, the target index comparison interval and the target comparison value, determine the expanded region, including:

[0034] Initialize the expansion times n5 = 1;

[0035] Determine the current processing region as the first region;

[0036] Determine the region obtained by expanding the first region by 1 pixel in the current expansion direction as the second region;

[0037] Determine the index values of all pixel points covered by the first region and the second region respectively;

[0038] According to the index values of all pixel points covered by the first region and the second region, n4, V4, σ4, the target index comparison interval and the target comparison value, determine the expansion change degree;

[0039] If the expansion change degree is greater than a preset change degree threshold, the first region is determined as the expansion region; if the expansion change degree is not greater than the preset change degree threshold, then n5 is updated to n5 + 1. If n5 is equal to the preset change threshold, the first region is determined as the expansion region. If n5 is less than the preset change threshold, the first region is updated to the second region, and the step of determining the region obtained by expanding the first region by 1 pixel in the current expansion direction as the second region and subsequent steps are repeatedly executed.

[0040] Optionally, according to the index values of all pixel points covered by the first region and the second region, n4, V4, σ4, the target index comparison interval, and the target comparison value, the expansion change degree is determined, including:

[0041] According to the index values of all pixel points covered by the first region, determine the number of pixel points n61 not located in the target index comparison interval, the mean value V51 and the standard deviation σ51 of the index values of all pixel points covered by the first region;

[0042] According to the index values of all pixel points covered by the second region, determine the number of pixel points n62 not located in the target index comparison interval, the mean value V52 and the standard deviation σ52 of the index values of all pixel points covered by the second region;

[0043] If n62 - n61 > 0, determine the expansion change degree as the preset maximum value;

[0044] If n62 - n61 ≤ 0, determine the mean change value as |V52 - V51| / V4, determine the standard deviation change value as |σ52 - σ51| / σ4, and determine the expansion change degree according to the mean change value, the standard deviation change value, n4, and the target comparison value.

[0045] Optionally, the target comparison value includes a mean comparison value and a standard deviation comparison value;

[0046] Determine the expansion change degree according to the mean change value, the standard deviation change value, n4, and the target comparison value, including:

[0047] If the mean change value > the mean comparison value × (1 + the preset mean adjustment ratio), or the standard deviation change value > the standard deviation comparison value × (1 + the preset standard deviation adjustment ratio), determine the expansion change degree as the preset maximum value;

[0048] If the mean change value ≤ the mean comparison value × (1 + the preset mean adjustment ratio), and the standard deviation change value ≤ the standard deviation comparison value × (1 + the preset standard deviation adjustment ratio), determine the expansion change degree as the cube root of the change value, where the change value is [(n62 - n61) / n4] × the mean change value × the standard deviation change value.

[0049] 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;

[0050] Among them, the grayscale image processing device includes: a memory and a processor;

[0051] The memory is used to store the computer program involved in implementing the grayscale image acquisition device;

[0052] The processor is used to execute the computer program stored in the memory.

[0053] Third aspect, the present invention provides a computer-readable storage medium, on which is stored a computer program involved in implementing the grayscale image acquisition device in the system described in the first aspect.

[0054] The present invention relates to a grayscale image processing system, a grayscale image processing device and a storage medium. 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; among them, 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 smallest circumscribed rectangle containing the target initial area as the initial cropping area; determine the index comparison interval according to the target initial area; determine the mean value V1 and the standard deviation σ1 of the index values of all pixel points covered by the initial cropping area; determine the mean value V2 and the standard deviation σ2 of the index values of all pixel points covered by the target initial area; determine the mean comparison value as |V1 - V2| / V1, and the standard deviation comparison value as |σ1 - σ2| / σ1; determine both the mean comparison value and the standard deviation comparison value as the target comparison value; determine the target cropping area according to the target comparison value; crop the grayscale image based on the target cropping 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. Description of the Drawings

[0055] Figure 1 It is a schematic structural diagram of a grayscale image processing system provided by an embodiment of the present application;

[0056] Figure 2 It is a schematic diagram of a first area provided by an embodiment of the present application;

[0057] Figure 3 It is a schematic diagram of a second area provided by an embodiment of the present application. Detailed Embodiments

[0058] For a better explanation and understanding of the present invention, the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments.

[0059] This embodiment provides a grayscale image processing system, as Figure 1 shown. The system includes: a grayscale image acquisition device and a grayscale image processing device.

[0060] Among them, 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.

[0061] 1. Grayscale image acquisition device

[0062] 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.

[0063] Among them, each frame of grayscale image includes the image of the target, and the index values (such as grayscale values) of the areas where the images of the same target are located in the grayscale image change little.

[0064] The target is a certain area in the grayscale image, such as the area where a certain object is located in the grayscale image.

[0065] For example, the grayscale image acquisition device continuously acquires images of a preset acquisition range. The acquisition range includes all of the target or part of the target.

[0066] In specific implementation, the target can 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 can be relatively unchanged, and the target will move closer to or farther away from the grayscale image acquisition device, thereby obtaining multiple frames of grayscale images.

[0067] 2. Grayscale image processing device

[0068] 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 smallest 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 mean value V1 and standard deviation σ1 of the index values of all pixel points covered by the initial clipping area. Determine the mean value V2 and standard deviation σ2 of the index values of all pixel points covered by the target initial area. Determine the mean comparison value as |V1 - V2| / V1, and the standard deviation comparison value as |σ1 - σ2| / σ1. Determine both the mean comparison value and the standard deviation comparison value as the target comparison value. Determine the 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.

[0069] The execution process of the grayscale image processing device will be elaborated in detail below:

[0070] 101. Obtain multiple frames of grayscale images collected by the grayscale image acquisition device.

[0071] Multiple frames of grayscale images collected by the grayscale image acquisition device can be obtained through a communication connection.

[0072] Among them, each frame of grayscale image includes the image of the target, and the index values (such as grayscale values) of the areas where the images of the same target are located in the grayscale image change little.

[0073] 102. Obtain the target area in the first frame of grayscale image and determine the obtained area as the target initial area.

[0074] Among them, the target area is the area where the target object is located.

[0075] This step can be assisted by relevant personnel or a trained AI model. For example, the first frame of grayscale image is output to relevant personnel or a trained AI model, and relevant personnel or the trained AI model mark it on it, circle the target area in the first frame of grayscale image, and then determine the target area circled by relevant personnel or the trained AI model in the first frame of grayscale image as the target initial area.

[0076] Since this step is determined by professionals, the target initial area is an accurate target area, so that the subsequent processing based on the target initial area is guaranteed to be accurate.

[0077] 103. Determine the minimum bounding rectangle containing the target initial area as the initial cropping area.

[0078] The target initial area obtained in step 102 is the target area marked by relevant personnel or a trained AI model, and the shape of this area may be regular or irregular. Whether it is regular or not, in step 103, its shape will be expanded to a regular shape through the minimum bounding rectangle containing the target initial area, that is, the initial cropping area. Therefore, the initial cropping area is a regular-shaped area, which includes the target initial area (i.e., the accurate target area) and a small amount of non-target initial area.

[0079] 104. Determine the index comparison interval according to the target initial area.

[0080] Although the index values (such as gray values) of the areas where the images of the same target are located in multiple gray-scale images collected at the same time do not change much. However, in multiple gray-scale images collected at different times, the index values of the same target will fluctuate. This fluctuation may be due to different acquisition parameters of the gray-scale image acquisition device, or changes in the index values of the target itself. Therefore, it is necessary to determine the target adjustment area according to the index value situation of the target in the currently collected multiple gray-scale images, so that a more accurate target area (i.e., the target adjustment area) that conforms to the situation of the currently collected multiple gray-scale images can be obtained in each non-first-frame gray-scale image.

[0081] Since the target initial area is the target area marked by relevant personnel or a trained AI model, and this area is the most accurate area that includes the target area, the index value of this area can represent the index value situation of the target in the currently collected multiple gray-scale images.

[0082] The implementation process of step 104 is as follows:

[0083] 104-1, Determine the index values of each pixel point covered by the target initial area.

[0084] 104-2, Determine the maximum value max1, minimum value min1, average value V3, and standard deviation σ3 of the index values of all pixel points.

[0085] 104-3, Determine the adjustment coefficient δ1 according to max1, min1, V3, and σ3.

[0086] The implementation process of determining the adjustment coefficient δ1 is as follows:

[0087] 104-3-1, Determine the adjusted average value as (max1 + min1 + V3) / 3.

[0088] 104-3-2, Determine the first adjustment degree as the adjusted average value / σ3.

[0089] The first adjustment degree characterizes the index value of the target in the currently collected multiple gray-scale images from the change situation of the index values of each pixel point covered by the target initial area. The larger this value is, the greater the fluctuation of the index value of the target in the currently collected multiple gray-scale images.

[0090] 104-3-3, Among the index values of all pixel points covered by the target initial area, determine the number of pixel points n1 that are greater than the maximum value of the target index value standard interval, the number of pixel points n2 that are less than the minimum value of the target index value standard interval, and the total number of all pixel points n3 covered by the target initial area.

[0091] Among them, the target index value standard interval is the range of normal target index values set in advance, such as the target index value standard interval is [40, 50].

[0092] 104 - 3 - 4, determine that the second adjustment degree is 1 - [(n1 × n1) + (n2 × n2) + (n3 - n1 - n2) × (n3 - n1 - n2)] / (n3 × n3).

[0093] The second adjustment degree is from the distribution fluctuations of all pixel points 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 this value is, the greater the distribution fluctuation.

[0094] 104 - 3 - 5, determine that δ1 = max{the first adjustment degree, the second adjustment degree}. Among them, max{} is the maximum value function.

[0095] Among them, max{} is the maximum value function.

[0096] The first adjustment degree and the second adjustment degree characterize the fluctuation of the index value of the target in the currently acquired multiple grayscale images from different dimensions, and the larger value of the two is used as the adjustment coefficient δ1.

[0097] 104 - 4, determine that the initial comparison interval is [min1 × (1 - δ1), max1 × (1 + δ1)].

[0098] The initial comparison interval is the interval after adjusting δ1 upward and downward based on the true index value of the target in the currently acquired multiple grayscale images. This interval can accurately characterize the index value situation of the target in the currently acquired multiple grayscale images.

[0099] 104 - 5, determine that the index comparison interval is (the preset target index value standard interval ∪ the initial comparison interval) ∩ the preset target index value maximum interval.

[0100] The initial comparison interval is the index value situation of the target in the currently acquired multiple grayscale images, 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 and the initial comparison interval (i.e., the preset target index value standard interval ∪ the initial comparison interval) can obtain an interval that both meets the standard normal target and the target of the currently acquired multiple grayscale images.

[0101] Considering that the target's index value will not increase or decrease infinitely, but has a maximum change range. The preset maximum range of the target index value is a maximum range of the target index value obtained by relevant personnel or a trained AI model according to specific circumstances. If the union of the preset standard range of the target index value and the initial comparison range is greater than this range, it indicates that it is incorrect. Therefore, the intersection of the union of the preset standard range of the target index value and the initial comparison range and the preset maximum range of the target index value is taken to obtain an interval that not only meets the standard normal target, but also meets the target of the currently collected multiple grayscale images, and also meets the interval of the target's light absorption characteristics. This interval is the index comparison interval.

[0102] The index comparison interval is an interval that satisfies the situation of the currently collected multiple grayscale images, the index value distribution of the normal target, and the light absorption characteristics of the target. This interval ensures the accurate determination of each subsequent target adjustment area.

[0103] 105. Determine the mean value V1 and standard deviation σ1 of the index values of all pixel points covered by the initial cropping area.

[0104] 106. Determine the mean value V2 and standard deviation σ2 of the index values of all pixel points covered by the target initial area.

[0105] 107. Determine that the mean comparison value is |V1 - V2| / V1, and the standard deviation comparison value is |σ1 - σ2| / σ1.

[0106] |V2 - V3| represents the change situation between the index value (i.e., V2) of the overall area including the non-target area (i.e., the initial cropping area) and the index value (i.e., V3) of the accurate target area (i.e., the target initial area). This change is 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 in 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 area including the non-target area (i.e., the initial cropping area).

[0107] |σ2 - σ3| represents the change situation between the index value fluctuation (i.e., σ2 -) of the overall area including the non-target area (i.e., the initial cropping area) and the index value fluctuation (i.e., V3) of the accurate target area (i.e., the target initial area). This change is 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 in 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 area including the non-target area (i.e., the initial cropping area).

[0108] 108. Determine both the mean comparison value and the standard deviation comparison value as the target comparison value.

[0109] Up to this point, the target comparison value can be obtained. The target comparison value includes the mean comparison value and the standard deviation comparison value, and this value is determined according to the initial cropping area.

[0110] Since the subsequent target adjustment area is an enlarged area that includes the precise target area, and this 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 and cannot reflect the situation of the non-target areas in the target adjustment area. The initial cropping area includes the target initial area (i.e., the precise target area) and the non-target initial area, and the index values of the initial cropping area can represent the index value situations of the target area and the non-target areas in the target adjustment area. Therefore, through the target comparison value, the overall distribution of the index values in the target adjustment area can be characterized from two dimensions: the mean change and the fluctuation change of the index values.

[0111] 109. Determine the target cropping area according to the target comparison value.

[0112] The implementation process of this step is as follows:

[0113] 109-1. For each non-first-frame grayscale image, expand the initial cropping area by one pixel point in each direction in turn, and determine the target area in each non-first-frame grayscale image according to the area after each expansion, the index comparison interval, and the target comparison value.

[0114] The target area in each non-first-frame grayscale image is obtained by expanding the initial cropping area around in all directions until the smallest area including the target area is obtained.

[0115] For any non-first-frame grayscale image i, determine its target area (i.e., the target adjustment area) through the following steps:

[0116] 201. Determine the index values of the pixel points covered by the initial cropping area in the grayscale image i.

[0117] In the case of multiple-frame grayscale images each time, although the position of the grayscale image acquisition device is relatively fixed, this kind of fixation will make the basic position of the target image unchanged in each frame of grayscale image. However, the area (i.e., size) of the target may change. For example, if the target is a balloon, as the balloon is inflated with gas, its basic position remains unchanged but its size changes. Another example is that if the target is a car and the car moves straight towards the grayscale image acquisition device, its basic position remains unchanged but its size changes.

[0118] 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.

[0119] In specific implementation, the initial cropping region can be used as a fixed region, and the target region (i.e., the target adjustment region) of the grayscale image i can be searched outward from this region.

[0120] In specific implementation, the pixel point identifiers covered by the initial cropping region in the first-frame grayscale image can be determined to form an identifier set. The region covering all the identifiers in the identifier set in the grayscale image i is determined as the region covered by the initial cropping region in the grayscale image i. The pixel points corresponding to each identifier in the identifier set are determined as the pixel points covered by the initial cropping region in the grayscale image i, and the index values of the pixel points corresponding to each identifier in the identifier set in the grayscale image i are determined as the index values of each pixel point covered by the initial cropping region in the grayscale image i.

[0121] 202. According to the index values of each pixel point covered by the initial cropping region in the grayscale image i, determine the number n4 of pixel points not located in the target index comparison interval, the mean value V4 and the standard deviation σ4 of the index values of all pixel points covered by the initial cropping region in the grayscale image i.

[0122] 203. Determine the region formed by all pixel points covered by the initial cropping region in the grayscale image i as the processing region.

[0123] For example, the processing region is the region formed by all pixel points covered by the initial cropping region in the grayscale image i, such as Figure 2 the region covered by the solid line frame shown.

[0124] It should be noted that Figure 2 the size and position of the solid line frame in are examples and do not represent the actual situation. In actual application, the size and position of the solid line frame are determined according to the actual situation.

[0125] 204. Select the direction with the highest priority as the expansion direction according to the preset direction priority.

[0126] The direction priority is preset and can be set by relevant personnel. If not set, it can be the default priority or randomly set the priority. For example, the priorities are from high to low as up, down, left, and right. It should be noted that up, down, left, and right here are relative to the coordinate system, where 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.

[0127] 205. Expand the current processing region by one pixel point in the current expansion direction in turn, and determine the expanded region according to each expanded region, n4, V4, σ4, the target index comparison interval, and the target comparison value.

[0128] For example, the expanded region is determined by the following method:

[0129] 205-1, Initialize the expansion times n5 = 1.

[0130] n5 represents the total number of pixels actually expanded by the current processing area in the current expansion direction.

[0131] 205-2, Determine the current processing area as the first area.

[0132] As Figure 2 The area covered by the solid line box in is the first area.

[0133] 205-3, Determine the area obtained by expanding the first area by 1 pixel in the current expansion direction as the second area.

[0134] For example, if the current expansion direction is upward, then Figure 2 the upper side of the area covered by the solid line box in (such as Figure 3 the solid line in) is expanded upward by 1 pixel to obtain Figure 3 the area covered by the dashed line box in, that is, the second area.

[0135] 205-4, Determine the index values of all pixel points covered by the first area and the second area respectively.

[0136] 205-5, Determine the expansion change degree according to the index values of all pixel points covered by the first area and the second area, n4, V4, σ4, the target index comparison interval, and the target comparison value.

[0137] The process of determining the expansion change degree is as follows:

[0138] ① According to the index values of all pixel points covered by the first area, determine the number of pixel points n61 that are not located in the target index comparison interval, the mean value V51 and the standard deviation σ51 of the index values of all pixel points covered by the first area.

[0139] ② According to the index values of all pixel points covered by the second area, determine the number of pixel points n62 that are not located in the target index comparison interval, the mean value V52 and the standard deviation σ52 of the index values of all pixel points covered by the second area.

[0140] ③ If n62 - n61 > 0, then determine the expansion change degree as the preset maximum value. If n62 - n61 ≤ 0, then determine the mean change value as |V52 - V51| / V4, determine the standard deviation change value as |σ52 - σ51| / σ4, and determine the expansion change degree according to the mean change value, the standard deviation change value, n4, and the target comparison value.

[0141] The change value of the number of points with abnormal index values in the area expanded by 1 pixel point in the current expansion direction (i.e., the pixel points in the second area whose index values are not within the target index comparison interval) is represented by n62 - n61. If n62 - n61 > 0, it indicates that the number of points with abnormal index values increases after expanding by 1 pixel point in the current expansion direction. Therefore, the expansion change degree is determined to be the preset maximum value. At this time, it shows that this change causes the index value of the second area to deteriorate. Then, the edge in the current expansion direction before expanding by 1 pixel point in the current expansion direction is the maximum position of the target adjustment area of the grayscale image i in this direction.

[0142] If n62 - n61 ≤ 0, it indicates that the number of points with abnormal index values remains unchanged or decreases after expanding by 1 pixel point in the current expansion direction. At this time, it may reach the maximum position of the target adjustment area of the grayscale image i in this direction, or may not reach the maximum position of the target adjustment area of the grayscale image i in this direction. Therefore, the expansion change degree will be determined according to 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.

[0143] Since the target comparison value includes the mean comparison value and the standard deviation comparison value, the process of determining the expansion change degree according to the mean change value, the standard deviation change value, n4, and the target comparison value is as follows:

[0144] If the mean change value > the mean comparison value × (1 + the preset mean adjustment ratio), or the standard deviation change value > the standard deviation comparison value × (1 + the preset standard deviation adjustment ratio), then the expansion change degree is determined to be the preset maximum value.

[0145] If the mean change value ≤ the mean comparison value × (1 + the preset mean adjustment ratio), and the standard deviation change value ≤ the standard deviation comparison value × (1 + the preset standard deviation adjustment ratio), then the expansion change degree is determined to be the cube root of the change value, where the change value is [(n62 - n61) / n4] × the mean change value × the standard deviation change value.

[0146] Among them, the preset standard deviation adjustment ratio is a value between 0 and 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. In this way, the mean comparison value × (1 + preset mean adjustment ratio) and the standard deviation comparison value × (1 + preset standard deviation adjustment ratio) will increase. 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 (i.e., the normal change ratio) for each region expansion. That is, if the mean change value before and after each region expansion > the mean comparison value × (1 + preset mean adjustment ratio), or the standard deviation change value > the standard deviation comparison value × (1 + preset standard deviation adjustment ratio), the region expansion will stop, and the expansion change degree will be directly determined as the preset maximum value. If the mean change value ≤ the mean comparison value × (1 + preset mean adjustment ratio), and the standard deviation change value ≤ the standard deviation comparison value × (1 + preset standard deviation adjustment ratio), it will further determine whether to stop the region expansion through the expansion change degree. That is to say, the accuracy of determining whether to stop the region expansion through the expansion change degree is higher than directly determining the expansion change degree as the preset maximum value. Therefore, the larger the preset standard deviation adjustment ratio, the lower the probability of satisfying the mean change value > the mean comparison value × (1 + preset mean adjustment ratio), or the standard deviation change value > the standard deviation comparison value × (1 + preset standard deviation adjustment ratio). The probability of further determining whether to stop the region expansion through the expansion change degree increases, that is, more fine-precision judgments will increase, so a more accurate judgment result will be obtained, and a more accurate target adjustment region will be obtained.

[0147] In addition, the mean change value is |V52 - V51| / V4. Among them, |V52 - V51| represents the change degree of the average index value in the region after expanding 1 pixel point in the current expansion direction compared with that before expansion. |V52 - V51| / V4 is the ratio of this change degree to the mean V4 of the index values of all pixel points covered by the initial cropped region in the grayscale image i. If this ratio is larger than the mean comparison value × (1 + 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 1 pixel point in the current expansion direction is abnormal. Therefore, the expansion change degree is determined as the preset maximum value. At this time, it indicates that this change has caused a large fluctuation in the average index value. Then, the edge in the current expansion direction before expanding 1 pixel point in the current expansion direction is the maximum position of the target adjustment region of the grayscale image i in this direction.

[0148] The standard deviation change value is |σ52 - σ51| / σ4. Here, |σ52 - σ51| represents the degree of change in the index value (i.e., the standard deviation of the index value) in the area after expanding by 1 pixel in the current expanding direction compared to that before expansion. |σ52 - σ51| / σ4 is the proportion of this degree of change to the standard deviation σ4 of all pixel points covered by the initial cropped area in the grayscale image i. If this ratio is greater than the standard deviation comparison value × (1 + the preset standard deviation adjustment ratio), it means that the standard deviation change degree of the average index value after expanding by 1 pixel in the current expanding direction is abnormal, that is, the index value fluctuates abnormally. Therefore, the expansion change degree is determined to be the preset maximum value. At this time, it indicates that this change has caused a large fluctuation in the index value. Then, the edge in the current expanding direction before expanding by 1 pixel in the current expanding direction is the maximum position of the target adjustment area of the grayscale image i in this direction.

[0149] If the mean change value ≤ the mean comparison value × (1 + the preset mean adjustment ratio), and the standard deviation change value ≤ the standard deviation comparison value × (1 + the preset standard deviation adjustment ratio), it means that both the change in the average value and the standard deviation of the index value after expanding by 1 pixel in the current expanding direction are normal. Then, take the cube root of [(n62 - n61) / n4] × the mean change value × the standard deviation change value as the expansion change degree, and subsequently determine whether to stop expanding in this direction based on the expansion change degree.

[0150] 205 - 6. If the expansion change degree is greater than the preset change degree threshold, then determine the first area as the expanded area. If the expansion change degree is not greater than the preset change degree threshold, then update n5 to n5 + 1. If n5 is equal to the preset change threshold, then determine the first area as the expanded area. If n5 is less than the preset change threshold, then update the first area to the second area, and repeat the step of determining the area obtained by expanding the first area by 1 pixel in the current expanding direction as the second area (i.e., step 205 - 3) and subsequent steps.

[0151] The change degree threshold is a pre - set value. This value can be an empirical value or, based on a large amount of sample data, obtain the normal change ratio brought by expanding the target image area by one pixel value in each direction through a big data learning model. The determination process of the change degree threshold is an existing process and will not be elaborated here.

[0152] If the expansion change degree is greater than the preset change degree threshold, it means that the change brought about by expanding by 1 pixel in the current expanding direction exceeds the normal change. Then, the edge in the current expanding direction before expanding by 1 pixel in the current expanding direction is the maximum position of the target adjustment area of the grayscale image i in this direction. Therefore, determine the first area as the expanded area.

[0153] 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.

[0154] 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.

[0155] 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.

[0156] 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.

[0157] 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 .

[0158] 206. Update the processing area to the enlarged area, update the enlargement direction to the direction with a priority only lower than the current enlargement direction, and re-execute the step of sequentially enlarging the current processing area by one pixel point in the current enlargement direction. Determine the step of enlarging the area (i.e., step 205) and subsequent steps based on the area after each enlargement, n4, V4, σ4, the target index comparison interval, and the target comparison value until all directions are selected.

[0159] When entering step 206, the enlarged area is an area that reaches the maximum position in the current enlargement direction. In step 206, other directions will be enlarged on this basis (i.e., repeat steps 205 and 206) so as to enlarge downward while keeping the upper position unchanged, then enlarge leftward while keeping the upper and lower positions unchanged, and finally enlarge rightward while keeping the upper, lower, and left positions unchanged) to find the maximum positions in other directions. The enlarged area obtained after all four directions are executed is the target area in the grayscale image i.

[0160] 207. Determine the current enlarged area as the target area in the grayscale image i.

[0161] In step 102, the target area of the first-frame grayscale image (i.e., the initial cropping area) is obtained. In step 109-1, the target areas in other non-first-frame grayscale images (i.e., the target adjustment areas) will be determined. That is to say, each grayscale image will have a target area. Only the target area of the first-frame grayscale image is named the initial cropping area, and the target areas of non-first-frame grayscale images are named target adjustment areas. The target adjustment areas correspond one by one to the non-first-frame grayscale images.

[0162] 109-2. Determine the obtained target area as the target adjustment area.

[0163] This target area is also the target adjustment area in the grayscale image i.

[0164] The target area is an area that is enlarged in each direction based on the initial cropping area according to the index comparison interval and the target comparison value, and is the smallest area containing the target area. Since the initial cropping area, the index comparison interval, and the target comparison value can accurately represent the true situation of the target image in the currently collected multiple grayscale images, the target adjustment area also relatively accurately contains the entire target image and is the smallest area containing non-target images. That is to say, the target adjustment area is the precise area with the least interference data.

[0165] 109-3. Determine the smallest area containing the initial cropping area and all target adjustment areas as the target cropping area.

[0166] The initial cropping region is the precise region with the least interference data in the first grayscale image among multiple grayscale images. Each target adjustment region is the precise region with the least interference data in its corresponding non-first grayscale image. Determining the smallest region that includes the initial cropping region and all target adjustment regions as the target cropping region makes the target cropping regions of each grayscale image the same and includes the precise region with the least interference data.

[0167] 110, Crop the grayscale images based on the target cropping region to obtain multiple target grayscale images.

[0168] In step 110, the non-target cropping regions will be cropped off from each grayscale image, leaving the target cropping region, and the remaining target cropping region is the target grayscale image.

[0169] This 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 grayscale images and transmit the multiple grayscale images to the grayscale image processing device through the communication connection; each grayscale image includes the image of the target; the grayscale image processing device is used to obtain the target region in the first grayscale image and determine the obtained region as the target initial region; determine the minimum bounding rectangle containing the target initial region as the initial cropping region; determine the index comparison interval according to the target initial region; determine the mean value V1 and standard deviation σ1 of the index values of all pixel points covered by the initial cropping region; determine the mean value V2 and standard deviation σ2 of the index values of all pixel points covered by the target initial region; determine the mean comparison value as |V1 - V2| / V1 and the standard deviation comparison value as |σ1 - σ2| / σ1; determine both the mean comparison value and the standard deviation comparison value as the target comparison value; determine the target cropping region according to the target comparison value; crop the grayscale images based on the target cropping region to obtain multiple target grayscale images, such that the multiple target grayscale images are the most precise regions including the accurate target image.

[0170] Based on the same inventive concept of the grayscale image processing system, this embodiment provides a grayscale image processing device, which is the grayscale image processing device in the grayscale image processing system.

[0171] Among them, the grayscale image processing device includes: a memory and a processor.

[0172] The memory is used to store the computer program involved in the grayscale image acquisition device.

[0173] The processor is used to execute the computer program stored in the memory.

[0174] Specifically, there is a communication connection between the grayscale image processing device and the grayscale image acquisition device.

[0175] The computer program involved in the grayscale image processing device can obtain multiple frames of grayscale images collected by the grayscale image acquisition device through the communication connection. Among them, each frame of grayscale image includes the image of the target. Obtain the target area in the first frame of grayscale image, and determine the obtained area as the target initial area. Determine the minimum bounding rectangle containing the target initial area as the initial cropping area. Determine the index comparison interval according to the target initial area. Determine the mean value V1 and standard deviation σ1 of the index values of all pixel points covered by the initial cropping area. Determine the mean value V2 and standard deviation σ2 of the index values of all pixel points covered by the target initial area. Determine the mean comparison value as |V1 - V2| / V1, and the standard deviation comparison value as |σ1 - σ2| / σ1. Determine both the mean comparison value and the standard deviation comparison value as the target comparison value. Determine the target cropping area according to the target comparison value. Crop the grayscale image based on the target cropping area to obtain multiple frames of target grayscale images.

[0176] Optionally, determining the target cropping area according to the target comparison value includes:

[0177] For each non-first-frame grayscale image, expand the initial cropping area by one pixel point in each direction in turn. According to each expanded area, the index comparison interval, and the target comparison value, determine the target area in each non-first-frame grayscale image.

[0178] Determine the obtained target area as the target adjustment area.

[0179] Determine the smallest area containing the initial cropping area and all target adjustment areas as the target cropping area.

[0180] Optionally, determining the index comparison interval according to the target initial area includes:

[0181] Determine the index values of each pixel point covered by the target initial area.

[0182] Determine the maximum value max1, minimum value min1, mean value V3, and standard deviation σ3 of the index values of all pixel points.

[0183] Determine the adjustment coefficient δ1 according to max1, min1, V3, and σ3.

[0184] Determine the initial comparison interval as [min1×(1 - δ1), max1×(1 + δ1)].

[0185] Determine the index comparison interval as (the preset target index value standard interval ∪ the initial comparison interval) ∩ the preset target index value maximum interval.

[0186] Optionally, determining the adjustment coefficient δ1 according to max1, min1, V3, and σ3 includes:

[0187] Determine the adjusted mean as (max1 + min1 + V3) / 3.

[0188] Determine the first adjustment degree as the adjusted mean / σ3.

[0189] Among the index values of all pixel points covered by the target initial region, determine the number n1 of pixel points greater than the maximum value of the target index value standard interval, the number n2 of pixel points less than the minimum value of the target index value standard interval, and the total number n3 of all pixel points covered by the target initial region.

[0190] Determine the second adjustment degree as 1 - [(n1 × n1) + (n2 × n2) + (n3 - n1 - n2) × (n3 - n1 - n2)] / (n3 × n3).

[0191] Determine δ1 = max{the first adjustment degree, the second adjustment degree}. Where max{} is the maximum value function.

[0192] Optionally, for each non-first-frame grayscale image, expand the initial cropped region by one pixel point in each direction in turn, and determine the target region in each non-first-frame grayscale image according to the region after each expansion, the index comparison interval, and the target comparison value, including:

[0193] For any non-first-frame grayscale image i, determine its target region through the following steps:

[0194] Determine the index values of the pixel points covered by the initial cropped region in the grayscale image i.

[0195] According to the index values of the pixel points covered by the initial cropped region in the grayscale image i, determine the number n4 of pixel points not located in the target index comparison interval, the mean V4 and the standard deviation σ4 of the index values of all pixel points covered by the initial cropped region in the grayscale image i.

[0196] Determine the region formed by all pixel points covered by the initial cropped region in the grayscale image i as the processing region.

[0197] Select the direction with the highest priority as the expansion direction according to the preset direction priority.

[0198] Expand the current processing region by one pixel point in the current expansion direction in turn, and determine the expanded region according to the region after each expansion, n4, V4, σ4, the target index comparison interval, and the target comparison value.

[0199] Update the processing area to the enlarged area, update the enlargement direction to the direction with a priority only lower than the current enlargement direction, and re - execute the step of sequentially enlarging the current processing area by one pixel point in the current enlargement direction. Determine the steps for the enlarged area and subsequent steps based on the areas after each enlargement, n4, V4, σ4, the target index comparison interval, and the target comparison value until all directions are selected.

[0200] Determine the target area in the grayscale image i as the current enlarged area.

[0201] Optionally, sequentially enlarge the current processing area by one pixel point in the current enlargement direction, and determine the enlarged area based on the areas after each enlargement, n4, V4, σ4, the target index comparison interval, and the target comparison value, including:

[0202] Initialize the enlargement times n5 = 1.

[0203] Determine the current processing area as the first area.

[0204] Determine the area obtained by enlarging the first area by 1 pixel in the current enlargement direction as the second area.

[0205] Respectively determine the index values of all pixel points covered by the first area and the second area.

[0206] Determine the enlargement change degree based on the index values of all pixel points covered by the first area and the second area, n4, V4, σ4, the target index comparison interval, and the target comparison value.

[0207] If the enlargement change degree is greater than the preset change degree threshold, determine the first area as the enlarged area. If the enlargement change degree is not greater than the preset change degree threshold, update n5 to n5 + 1. If n5 is equal to the preset change threshold, determine the first area as the enlarged area. If n5 is less than the preset change threshold, update the first area to the second area, and repeat the steps of determining the area obtained by enlarging the first area by 1 pixel in the current enlargement direction and subsequent steps.

[0208] Optionally, determine the enlargement change degree based on the index values of all pixel points covered by the first area and the second area, n4, V4, σ4, the target index comparison interval, and the target comparison value, including:

[0209] Based on the index values of all pixel points covered by the first area, determine the number of pixel points n61 not located in the target index comparison interval, the mean value V51 and the standard deviation σ51 of the index values of all pixel points covered by the first area.

[0210] Determine the number n62 of pixel points not located in the target index comparison interval, the mean value V52 and the standard deviation σ52 of the index values of all pixel points covered by the second region, according to the index values of all pixel points covered by the second region.

[0211] If n62 - n61 > 0, determine that the expansion change degree is the preset maximum value.

[0212] If n62 - n61 ≤ 0, determine that the mean change value is |V52 - V51| / V4, determine that the standard deviation change value is |σ52 - σ51| / σ4, and determine the expansion change degree according to the mean change value, the standard deviation change value, n4 and the target comparison value.

[0213] Optionally, the target comparison value includes a mean comparison value and a standard deviation comparison value.

[0214] Determining the expansion change degree according to the mean change value, the standard deviation change value, n4 and the target comparison value includes:

[0215] If the mean change value > the mean comparison value × (1 + the preset mean adjustment ratio), or the standard deviation change value > the standard deviation comparison value × (1 + the preset standard deviation adjustment ratio), determine that the expansion change degree is the preset maximum value.

[0216] If the mean change value ≤ the mean comparison value × (1 + the preset mean adjustment ratio), and the standard deviation change value ≤ the standard deviation comparison value × (1 + the preset standard deviation adjustment ratio), determine that the expansion change degree is the cube root of the change value, where the change value is [(n62 - n61) / n4] × the mean change value × the standard deviation change value.

[0217] The grayscale image processing device provided in this embodiment acquires the target region in the first-frame grayscale image, and determines the acquired region as the target initial region; determines the smallest circumscribed rectangle containing the target initial region as the initial cropping region; determines the index comparison interval according to the target initial region; determines the mean value V1 and the standard deviation σ1 of the index values of all pixel points covered by the initial cropping region; determines the mean value V2 and the standard deviation σ2 of the index values of all pixel points covered by the target initial region; 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 the target comparison value; determines the target cropping region according to the target comparison value; and crops the grayscale image based on the target cropping region to obtain multiple frames of target grayscale images, such that the multiple frames of target grayscale images are the most accurate regions including the accurate target image.

[0218] 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 for implementing the grayscale image processing device is stored.

[0219] Specifically, there is a communication connection between the grayscale image processing device and the grayscale image acquisition device.

[0220] The computer program involved in the grayscale image processing device can obtain multiple frames of grayscale images collected by the grayscale image acquisition device through the communication connection. Among them, each frame of grayscale image includes the image of the target. Obtain the target area in the first frame of grayscale image, and determine the obtained area as the target initial area. Determine the smallest circumscribed rectangle containing the target initial area as the initial cropping area. Determine the index comparison interval according to the target initial area. Determine the mean value V1 and standard deviation σ1 of the index values of all pixel points covered by the initial cropping area. Determine the mean value V2 and standard deviation σ2 of the index values of all pixel points covered by the target initial area. Determine the mean comparison value as |V1 - V2| / V1, and the standard deviation comparison value as |σ1 - σ2| / σ1. Determine both the mean comparison value and the standard deviation comparison value as the target comparison value. Determine the target cropping area according to the target comparison value. Crop the grayscale image based on the target cropping area to obtain multiple frames of target grayscale images.

[0221] Optionally, determining the target cropping area according to the target comparison value includes:

[0222] For each non-first-frame grayscale image, expand the initial cropping area by one pixel point in each direction in turn, and determine the target area in each non-first-frame grayscale image according to the area after each expansion, the index comparison interval, and the target comparison value.

[0223] Determine the obtained target area as the target adjustment area.

[0224] Determine the smallest area containing the initial cropping area and all target adjustment areas as the target cropping area.

[0225] Optionally, determining the index comparison interval according to the target initial area includes:

[0226] Determine the index values of each pixel point covered by the target initial area.

[0227] Determine the maximum value max1, minimum value min1, mean value V3, and standard deviation σ3 of the index values of all pixel points.

[0228] Determine the adjustment coefficient δ1 according to max1, min1, V3, and σ3.

[0229] Determine the initial comparison interval as [min1×(1 - δ1), max1×(1 + δ1)].

[0230] Determine the index comparison interval as (the preset target index value standard interval ∪ the initial comparison interval) ∩ the preset target index value maximum interval.

[0231] Optionally, determining an adjustment coefficient δ1 according to max1, min1, V3, and σ3 includes:

[0232] Determine the adjusted mean as (max1 + min1 + V3) / 3.

[0233] Determine the first adjustment degree as the adjusted mean / σ3.

[0234] Among the index values of all pixel points covered by the target initial region, determine the number n1 of pixel points greater than the maximum value of the target index value standard interval, the number n2 of pixel points less than the minimum value of the target index value standard interval, and the total number n3 of all pixel points covered by the target initial region.

[0235] Determine the second adjustment degree as 1 - [(n1×n1) + (n2×n2) + (n3 - n1 - n2)×(n3 - n1 - n2)] / (n3×n3).

[0236] Determine δ1 = max{the first adjustment degree, the second adjustment degree}. Where max{} is the maximum value function.

[0237] Optionally, for each non-first-frame grayscale image, expand the initial cropped region by one pixel point in each direction in turn, and determine the target region in each non-first-frame grayscale image according to the region after each expansion, the index comparison interval, and the target comparison value, including:

[0238] For any non-first-frame grayscale image i, determine its target region through the following steps:

[0239] Determine the index values of the pixel points covered by the initial cropped region in the grayscale image i.

[0240] According to the index values of the pixel points covered by the initial cropped region in the grayscale image i, determine the number n4 of pixel points not located in the target index comparison interval, the mean V4 and the standard deviation σ4 of the index values of all pixel points covered by the initial cropped region in the grayscale image i.

[0241] Determine the region formed by all pixel points covered by the initial cropped region in the grayscale image i as the processing region.

[0242] Select the direction with the highest priority as the expansion direction according to the preset direction priority.

[0243] Expand the current processing region by one pixel point in the current expansion direction in turn, and determine the expanded region according to the region after each expansion, n4, V4, σ4, the target index comparison interval, and the target comparison value.

[0244] Update the processing area to the enlarged area, update the enlargement direction to the direction with a priority only lower than the current enlargement direction, and re - execute the step of sequentially enlarging the current processing area by one pixel point in the current enlargement direction. Determine the steps for the enlarged area and subsequent steps based on the areas after each enlargement, n4, V4, σ4, the target index comparison interval, and the target comparison value until all directions are selected.

[0245] Determine the target area in the grayscale image i as the current enlarged area.

[0246] Optionally, sequentially enlarge the current processing area by one pixel point in the current enlargement direction. Determine the enlarged area based on the areas after each enlargement, n4, V4, σ4, the target index comparison interval, and the target comparison value, including:

[0247] Initialize the enlargement times n5 = 1.

[0248] Determine the current processing area as the first area.

[0249] Determine the area obtained by enlarging the first area by 1 pixel in the current enlargement direction as the second area.

[0250] Respectively determine the index values of all pixel points covered by the first area and the second area.

[0251] Determine the enlargement change degree based on the index values of all pixel points covered by the first area and the second area, n4, V4, σ4, the target index comparison interval, and the target comparison value.

[0252] If the enlargement change degree is greater than the preset change degree threshold, determine the first area as the enlarged area. If the enlargement change degree is not greater than the preset change degree threshold, update n5 to n5 + 1. If n5 is equal to the preset change threshold, determine the first area as the enlarged area. If n5 is less than the preset change threshold, update the first area to the second area, and repeat the steps of determining the area obtained by enlarging the first area by 1 pixel in the current enlargement direction and subsequent steps.

[0253] Optionally, determine the enlargement change degree based on the index values of all pixel points covered by the first area and the second area, n4, V4, σ4, the target index comparison interval, and the target comparison value, including:

[0254] Based on the index values of all pixel points covered by the first area, determine the number of pixel points n61 not located in the target index comparison interval, the mean value V51 and the standard deviation σ51 of the index values of all pixel points covered by the first area.

[0255] Determine the number n62 of pixel points not located in the target index comparison interval, the mean value V52 and the standard deviation σ52 of the index values of all pixel points covered by the second region, according to the index values of all pixel points covered by the second region.

[0256] If n62 - n61 > 0, determine that the expansion variation degree is the preset maximum value.

[0257] If n62 - n61 ≤ 0, determine that the mean value change is |V52 - V51| / V4, determine that the standard deviation change is |σ52 - σ51| / σ4, and determine the expansion variation degree according to the mean value change, the standard deviation change, n4 and the target comparison value.

[0258] Optionally, the target comparison value includes a mean value comparison value and a standard deviation comparison value.

[0259] Determining the expansion variation degree according to the mean value change, the standard deviation change, n4 and the target comparison value includes:

[0260] If the mean value change > the mean value comparison value × (1 + the preset mean value adjustment ratio), or the standard deviation change > the standard deviation comparison value × (1 + the preset standard deviation adjustment ratio), determine that the expansion variation degree is the preset maximum value.

[0261] If the mean value change ≤ the mean value comparison value × (1 + the preset mean value adjustment ratio), and the standard deviation change ≤ the standard deviation comparison value × (1 + the preset standard deviation adjustment ratio), determine that the expansion variation degree is the cube root of the variation value, where the variation value is [(n62 - n61) / n4] × the mean value change × the standard deviation change.

[0262] The computer-readable storage medium provided in this embodiment, on which the computer program is executed by a processor to obtain the target region in the first-frame grayscale image, and determine the obtained region as the target initial region; determine the minimum bounding rectangle containing the target initial region as the initial cropping region; determine the index comparison interval according to the target initial region; determine the mean value V1 and the standard deviation σ1 of the index values of all pixel points covered by the initial cropping region; determine the mean value V2 and the standard deviation σ2 of the index values of all pixel points covered by the target initial region; determine the mean value comparison value as |V1 - V2| / V1, and the standard deviation comparison value as |σ1 - σ2| / σ1; determine both the mean value comparison value and the standard deviation comparison value as the target comparison value; determine the target cropping region according to the target comparison value; crop the grayscale image based on the target cropping region to obtain multiple frames of target grayscale images, such that the multiple frames of target grayscale images are the most accurate regions including the accurate target image.

[0263] It should be clear that the present invention is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known systems are 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 steps after understanding the spirit of the present invention.

[0264] 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 executed in the order mentioned in the embodiments, or different from the order in the embodiments, or several steps can be executed simultaneously.

[0265] 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 them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate 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 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; 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)]; Determine the index comparison interval as (preset target index value standard interval ∪ initial comparison interval) ∩ preset target index value maximum interval; 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.

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 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.

4. The system according to claim 3, 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.

5. The system according to claim 4, 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.

6. The system according to claim 5, 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.

7. 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 6; 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.

8. 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 6 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