Region-of-interest determination method and device, electronic equipment and storage medium

By setting thresholds and performing morphological processing in image processing, the area of ​​interest is automatically identified and extracted, which solves the problem of low manual setting efficiency in the existing technology, achieves efficient and accurate determination of the area of ​​interest, and is suitable for diverse materials. detection.

CN118762169APending Publication Date: 2024-10-11SHENZHEN FII-LUSTER LIGHTTECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411109279.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-13
Publication Date
2024-10-11

AI Technical Summary

Technical Problem

In the existing technology, manually setting the area of ​​interest in the image is inefficient and cannot meet the demand for customized and personalized material detection in large-scale automated production.

Method used

By acquiring the target image, setting the preset ratio, determining the first threshold and the second threshold that meet the preset conditions, dividing the pixel area, determining the area of ​​interest based on these areas, and using morphological processing and connected domain analysis to achieve the area of ​​interest. Automatic identification and extraction.

Benefits of technology

The efficiency and accuracy of determining the area of ​​interest are improved, and the area of ​​interest can be extracted simultaneously from light and dark areas in the target image, making it suitable for diversified material detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118762169A_ABST
    Figure CN118762169A_ABST
Patent Text Reader

Abstract

The invention discloses a region-of-interest determination method and device, electronic equipment and a storage medium, and the method comprises the steps: obtaining a target image, and setting a preset proportion; determining a first threshold value and a second threshold value which meet a preset condition; wherein the first threshold value and the second threshold value are gray values used for dividing pixel areas, the first threshold value is smaller than the second threshold value, the pixel points with the gray values smaller than the first threshold value in the target image form a first pixel area, and the pixel points with the gray values larger than the second threshold value in the target image form a second pixel area; the preset condition is that the gray difference between the first pixel region and the second pixel region is maximum and the sum of the proportions of the first pixel region and the second pixel region in the target image is a preset proportion; and determining a region of interest in the target image based on the first pixel region and the second pixel region. According to the invention, automatic identification of the region of interest is realized, the efficiency of determining the region of interest is improved, and the accuracy of determining the region of interest is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and more specifically, to a method and device for determining a region of interest, an electronic device, and a storage medium. Background Art

[0002] In machine vision and image processing, the area to be processed is outlined from the image to be processed in the form of a box, circle, ellipse, irregular polygon, etc., which is called the Region of Interest (ROI).

[0003] In recent years, efficient and high-precision visual inspection technology has been increasingly used in large-scale automated production. With the development of the economy, the demand for customization and personalization is constantly increasing, requiring inspection equipment to be able to produce and process more diverse materials. Before the inspection equipment processes the material, it is necessary to set the region of interest (ROI) in the image.

[0004] In the related art, the region of interest is manually set in the image, and a lot of time is required to set the region of interest one by one for each material, and the efficiency of setting the region of interest is low.

[0005] Therefore, how to improve the efficiency of determining the region of interest is a technical problem that those skilled in the art need to solve. Summary of the invention

[0006] The purpose of the present application is to provide a method and device for determining a region of interest, an electronic device and a computer-readable storage medium, which realize automatic identification of a region of interest, improve the efficiency of determining a region of interest, optimize the extraction effect of a region of interest, and improve the accuracy of determining a region of interest.

[0007] To achieve the above objectives, the present application provides a method for determining a region of interest, comprising:

[0008] Get the target image and set the preset ratio;

[0009] Determine a first threshold and a second threshold that meet a preset condition; wherein the first threshold and the second threshold are grayscale values ​​used to divide pixel areas, the first threshold is less than the second threshold, pixels in the target image whose grayscale values ​​are less than the first threshold constitute a first pixel area, and pixels in the target image whose grayscale values ​​are greater than the second threshold constitute a second pixel area; the preset condition is that the grayscale difference between the first pixel area and the second pixel area is the largest and the sum of the proportions of the first pixel area and the second pixel area in the target image is the preset proportion;

[0010] A region of interest in the target image is determined based on the first pixel region and the second pixel region.

[0011] The step of determining the first threshold value and the second threshold value that meet the preset conditions includes:

[0012] constructing a grayscale value difference characterization function of the first pixel region and the second pixel region based on the sum of the first product and the second product, and determining a first threshold and a second threshold of the grayscale value when the grayscale value difference characterization function is a maximum value;

[0013] Among them, the first product is the product of the square of the difference between the first grayscale average value and the third grayscale average value and the first pixel ratio, the second product is the product of the square of the difference between the second grayscale average value and the third grayscale average value and the second pixel ratio, the first grayscale average value is the grayscale average value of the pixels in the first pixel area, the second grayscale average value is the grayscale average value of the pixels in the second pixel area, the third grayscale average value is the grayscale average value of the pixels in the first pixel area and the second pixel area, the first pixel ratio is the ratio of the pixels in the first pixel area to the pixels in the target image, the second pixel ratio is the ratio of the pixels in the second pixel area to the pixels in the target image, and the sum of the first pixel ratio and the second pixel ratio is the preset ratio.

[0014] Wherein, the gray value difference characterization function is:

[0015] ;

[0016] in, is the first threshold, is the second threshold, is the first pixel ratio, is the second pixel ratio, is the first grayscale average value, is the second grayscale average value, is the third grayscale average value, , P is the preset ratio, A value representing the difference in grayscale values ​​between the first pixel region and the second pixel region.

[0017] After determining the first threshold and the second threshold that meet the preset conditions, the method further includes:

[0018] The pixel points in the target image are binarized based on the first threshold value and the second threshold value; wherein the grayscale values ​​of the pixel points in the first pixel area and the second pixel area are set to a first preset value, and the grayscale values ​​of the pixel points in the area other than the first pixel area and the second pixel area in the target image are set to a second preset value.

[0019] Wherein, determining the region of interest in the target image based on the first pixel region and the second pixel region includes:

[0020] Morphological processing is performed on the connected domains included in the first pixel region and the second pixel region to obtain candidate connected domains, and a region of interest in the target image is determined based on the candidate connected domains.

[0021] Wherein, determining the region of interest in the target image based on the candidate connected domain includes:

[0022] Extracting multiple connectivity parameters of the candidate connected domain, and weighting the multiple connectivity parameters based on weights corresponding to different connectivity parameters to obtain a connected domain score;

[0023] A first preset number of candidate connected domains with the largest connected domain scores are selected as regions of interest in the target image.

[0024] After extracting the plurality of connectivity parameters of the candidate connected domain, the method further includes:

[0025] Normalizing the connectivity parameters according to the grayscale value and gradient value of the candidate connected domain;

[0026] The step of weighting the plurality of connectivity parameters based on weights corresponding to different connectivity parameters to obtain a connectivity domain score includes:

[0027] The connected domain score is obtained by weighting the multiple normalized connected parameters based on the weights corresponding to the different connected parameters.

[0028] The normalizing process of the connectivity parameter according to the grayscale value and the gradient value of the candidate connected domain includes:

[0029] The connectivity parameters are normalized using a normalization formula; wherein the normalization formula is: F=(G×f+D×f) / 2, G is the grayscale value of the candidate connected domain, D is the gradient value of the candidate connected domain, f is the connectivity parameter, and F is the connectivity parameter after normalization.

[0030] Wherein, determining the region of interest in the target image based on the candidate connected domain includes:

[0031] Constructing a distance vector corresponding to the candidate connected domain based on the position of the morphological center point of the candidate connected domain; wherein the distance vector includes the distance value between the morphological center point of the candidate connected domain and the morphological center points of adjacent candidate connected domains, the adjacent candidate connected domains include a second preset number of candidate connected domains whose morphological center points are closest to the morphological center point of the candidate connected domain, and the second preset number of distance values ​​in the distance vector are sorted from small to large;

[0032] Cluster analysis is performed on the distance vectors corresponding to the plurality of candidate connected domains to eliminate the candidate connected domains corresponding to the outlier distance vectors to obtain the region of interest in the target image.

[0033] Wherein, determining the region of interest in the target image based on the candidate connected domain includes:

[0034] Determining the morphological center point of the candidate connected domain as the first morphological center point;

[0035] Re-determining the morphological center point of the candidate connected domain as the second morphological center point according to the grayscale values ​​of the pixel points at the corresponding positions of the candidate connected domain in the target image;

[0036] The position of the candidate connected domain is corrected based on the positional relationship between the second morphological center point and the first morphological center point, and the corrected candidate connected domain is used as the region of interest in the target image.

[0037] To achieve the above object, the present application provides a device for determining a region of interest, comprising:

[0038] An acquisition module is used to acquire a target image and set a preset ratio;

[0039] A first determination module is used to determine a first threshold and a second threshold that meet a preset condition; wherein the first threshold and the second threshold are grayscale values ​​used to divide pixel areas, the first threshold is less than the second threshold, the pixel points in the target image whose grayscale value is less than the first threshold constitute a first pixel area, and the pixel points in the target image whose grayscale value is greater than the second threshold constitute a second pixel area; the preset condition is that the grayscale difference between the first pixel area and the second pixel area is the largest and the sum of the proportions of the first pixel area and the second pixel area in the target image is the preset proportion;

[0040] The second determining module is used to determine a region of interest in the target image based on the first pixel region and the second pixel region.

[0041] To achieve the above objectives, the present application provides an electronic device, including:

[0042] Memory for storing computer programs;

[0043] A processor is used to implement the steps of the above-mentioned method for determining a region of interest when executing the computer program.

[0044] To achieve the above objectives, the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned method for determining a region of interest are implemented.

[0045] It can be seen from the above scheme that a method for determining a region of interest provided in the present application includes: acquiring a target image and setting a preset ratio; determining a first threshold and a second threshold that meet preset conditions; wherein the first threshold and the second threshold are grayscale values ​​used to divide pixel areas, the first threshold is less than the second threshold, and the pixels in the target image whose grayscale values ​​are less than the first threshold constitute a first pixel area, and the pixels in the target image whose grayscale values ​​are greater than the second threshold constitute a second pixel area; the preset condition is that the grayscale difference between the first pixel area and the second pixel area is the largest and the sum of the proportions of the first pixel area and the second pixel area in the target image is the preset ratio; the region of interest in the target image is determined based on the first pixel area and the second pixel area.

[0046] The method for determining a region of interest provided by the present application determines a region of interest based on a pixel region whose grayscale value is less than a first threshold and whose grayscale value is greater than a second threshold, thereby realizing automatic identification of the region of interest and improving the efficiency of determining the region of interest. In addition, the present application solves the first threshold and the second threshold of the grayscale value, determines the first pixel region of highlight in the target image based on the second threshold of the grayscale value, and determines the second pixel region of low-light in the target image based on the first threshold of the grayscale value, thereby realizing simultaneous extraction of the region of interest from bright and dark regions in the target image, and is applicable to the situation where the region of interest exists in both bright and dark regions in the target image, thereby optimizing the extraction effect of the region of interest and improving the accuracy of determining the region of interest. The present application also discloses a device for determining a region of interest, an electronic device, and a computer-readable storage medium, which can also achieve the above technical effects.

[0047] It should be understood that the foregoing general description and the following detailed description are exemplary only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following is a brief introduction to the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. The drawings are used to provide a further understanding of the present disclosure and constitute a part of the specification. Together with the following specific implementation methods, they are used to explain the present disclosure, but do not constitute a limitation to the present disclosure. In the drawings:

[0049] Figure 1 This is a flow chart of a method for determining a region of interest according to an exemplary embodiment;

[0050] Figure 2 This is a flow chart of another method for determining a region of interest according to an exemplary embodiment;

[0051] Figure 3 is a structural diagram of a device for determining a region of interest according to an exemplary embodiment;

[0052] Figure 4 The figure is a structural diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION

[0053] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application. In addition, in the embodiments of the present application, "first", "second", etc. are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0054] The embodiment of the present application discloses a method for determining a region of interest, which realizes automatic recognition of a region of interest, improves the efficiency of determining a region of interest, optimizes the extraction effect of a region of interest, and improves the accuracy of determining a region of interest.

[0055] See also Figure 1 , according to an exemplary embodiment, a flowchart of a method for determining a region of interest is shown, such as Figure 1 As shown, including:

[0056] S101: Acquire a target image and set a preset ratio;

[0057] The purpose of this embodiment is to determine the region of interest in the target image. In this step, the target image and a preset ratio are obtained, and the preset ratio is the ratio of the finally determined region of interest to the target image that is preset artificially.

[0058] As an optional implementation, after acquiring the target image, the method further includes: performing noise reduction on the target image. In a specific implementation, the acquired target image is subjected to noise reduction, and the specific method of noise reduction is not limited here, for example, a noise reduction method of filtering processing can be used.

[0059] S102: Determine a first threshold and a second threshold that meet a preset condition; wherein the first threshold and the second threshold are grayscale values ​​used to divide pixel areas, the first threshold is less than the second threshold, the pixels in the target image whose grayscale values ​​are less than the first threshold constitute a first pixel area, and the pixels in the target image whose grayscale values ​​are greater than the second threshold constitute a second pixel area; the preset condition is that the grayscale difference between the first pixel area and the second pixel area is the largest and the sum of the proportions of the first pixel area and the second pixel area in the target image is the preset proportion;

[0060] In this embodiment, the ultimately determined region of interest includes two parts, namely a first pixel region and a second pixel region. The first pixel region is a pixel region composed of pixel points whose grayscale values ​​are less than a first threshold, and the second pixel region is a pixel region composed of pixel points whose grayscale values ​​are greater than a second threshold. The preset conditions satisfied by the first threshold and the second threshold are that the grayscale difference between the first pixel region and the second pixel region is the largest and the sum of the proportions of the first pixel region and the second pixel region in the target image is the preset proportion in the previous step.

[0061] As a feasible implementation manner, the determining of the first threshold and the second threshold that meet the preset conditions includes: constructing a grayscale value difference characterization function of the first pixel area and the second pixel area based on the sum of the first product and the second product, and determining the first threshold and the second threshold of the grayscale value when the grayscale value difference characterization function is at the maximum value; wherein the first product is the product of the square of the difference between the first grayscale average value and the third grayscale average value and the first pixel point ratio, the second product is the product of the square of the difference between the second grayscale average value and the third grayscale average value and the second pixel point ratio, the first grayscale average value is the grayscale average value of the pixel points in the first pixel area, the second grayscale average value is the grayscale average value of the pixel points in the second pixel area, the third grayscale average value is the grayscale average value of the pixel points in the first pixel area and the pixel points in the second pixel area, the first pixel point ratio is the ratio of the pixel points in the first pixel area to the pixel points in the target image, the second pixel point ratio is the ratio of the pixel points in the second pixel area to the pixel points in the target image, and the sum of the first pixel point ratio and the second pixel point ratio is the preset ratio.

[0062] In a specific implementation, the grayscale value of each pixel in the target image after noise reduction processing is determined, and the grayscale histogram is statistically analyzed to obtain the number of pixels of each grayscale value. Based on the grayscale histogram, multiple groups of candidate first thresholds and second thresholds that meet the condition that "the sum of the proportions of the first pixel area and the second pixel area in the target image is a preset proportion" can be determined.

[0063] Furthermore, a grayscale value difference characterization function between the first pixel region and the second pixel region is constructed. Specifically, the grayscale value difference characterization function is:

[0064] ;

[0065] in, is the first threshold, is the second threshold, is the first pixel ratio, is the second pixel ratio, is the first grayscale average value, is the second grayscale average value, is the third grayscale average value, , P is the preset ratio, A value representing the difference in grayscale values ​​between the first pixel region and the second pixel region.

[0066] Furthermore, the gray value difference characterization function is solved to determine The first threshold at the maximum value and the second threshold Alternatively, multiple sets of candidate first thresholds and second thresholds may be sequentially substituted into the gray value difference characterization function to determine The first threshold at the maximum value and the second threshold .

[0067] As a feasible implementation, after determining the first threshold and the second threshold that meet the preset conditions, it also includes: binarizing the pixels in the target image based on the first threshold and the second threshold; wherein the grayscale values ​​of the pixels in the first pixel area and the second pixel area are set to the first preset value, and the grayscale values ​​of the pixels in the target image other than the first pixel area and the second pixel area are set to the second preset value. In a specific implementation, the pixels in the target image are binarized based on the first threshold and the second threshold, that is, the grayscale values ​​of the pixels in the first pixel area and the second pixel area are set to the first preset value, such as 255, and the grayscale values ​​of the pixels in other areas are set to the second preset value, such as 0. After the binarization, the first pixel area and the second pixel area contain multiple highlighted connected domains. That is, according to the solved first threshold and the second threshold Binarization will satisfy The grayscale value of the pixel is set to 255. Represents the grayscale value of the pixel with coordinates (x, y), and the grayscale values ​​of other pixels are set to 0.

[0068] It can be seen that by solving the gray value difference characterization function, the first threshold and the second threshold can be determined simultaneously in one process, which improves the processing efficiency and further improves the efficiency of determining the region of interest.

[0069] S103: Determine a region of interest in the target image based on the first pixel region and the second pixel region.

[0070] In a specific implementation, the first pixel region and the second pixel region divided based on the first threshold and the second threshold are pixel regions composed of multiple connected domains, and the region of interest in the target image can be determined based on the connected domains included in the first pixel region and the second pixel region.

[0071] As a preferred implementation, determining the region of interest in the target image based on the first pixel region and the second pixel region includes: performing morphological processing on a connected domain contained in the first pixel region and the second pixel region to obtain a candidate connected domain, and determining the region of interest in the target image based on the candidate connected domain.

[0072] In a specific implementation, morphological processing is performed on multiple connected domains contained in the first pixel region and the second pixel region, such as corrosion, expansion, opening operation and closing operation, etc. Morphological processing is beneficial to improving the quality of the binary image. Based on the candidate connected domain obtained by morphological processing, the region of interest in the target image is determined.

[0073] The method for determining the region of interest provided in the embodiment of the present application determines the region of interest based on the pixel region whose grayscale value is less than the first threshold and whose grayscale value is greater than the second threshold, thereby realizing automatic recognition of the region of interest and improving the efficiency of determining the region of interest. In addition, the present application solves the first threshold and the second threshold of the grayscale value, determines the first highlighted pixel region in the target image according to the second threshold of the grayscale value, and determines the second dark pixel region in the target image according to the first threshold of the grayscale value, thereby realizing the simultaneous extraction of the region of interest in the bright and dark regions in the target image, and is suitable for the situation where the region of interest exists in both bright and dark regions in the target image, thereby optimizing the extraction effect of the region of interest and improving the accuracy of determining the region of interest.

[0074] It should be noted that directly using the candidate connected domain after morphological processing as the final region of interest may not conform to the expected shape or characteristics. Therefore, the candidate connected domain after morphological processing can be screened to determine the final region of interest.

[0075] As a feasible implementation manner, determining the region of interest in the target image based on the candidate connected domain includes: extracting multiple connectivity parameters of the candidate connected domain, weighting the multiple connectivity parameters based on weights corresponding to different connectivity parameters to obtain a connected domain score; and selecting a first preset number of candidate connected domains with the largest connected domain scores as the region of interest in the target image.

[0076] In a specific implementation, multiple connectivity parameters are extracted for each candidate connected domain after morphological processing, which may include shape, size, position, etc., and corresponding weights are assigned to different connectivity parameters. The connectivity score of the candidate connected domain is obtained by weighted synthesis of the multiple connectivity parameters of the candidate connected domain, and a first preset number of candidate connected domains with the largest connectivity scores are selected as the region of interest in the target image.

[0077] As an optional implementation, after extracting multiple connectivity parameters of the candidate connected domain, it also includes: normalizing the connectivity parameters according to the grayscale value and gradient value of the candidate connected domain; weighting the multiple connectivity parameters based on the weights corresponding to different connectivity parameters to obtain a connected domain score, including: weighting the multiple normalized connectivity parameters based on the weights corresponding to different connectivity parameters to obtain a connected domain score.

[0078] In a specific implementation, before weighting multiple connectivity parameters, the connectivity parameters are normalized according to the grayscale value and gradient value of the candidate connected domain. The specific normalization method is not limited here. As a feasible implementation, the connectivity parameters are normalized using a normalization formula; wherein the normalization formula is: F=(G×f+D×f) / 2, G is the grayscale value of the connected domain, D is the gradient value of the connected domain, f is the connectivity parameter before normalization, and F is the connectivity parameter after normalization. The calculation formula for the connected domain score is: , score is the score of the connected domain, , , They represent the normalized connectivity parameters, , , is the corresponding weight.

[0079] As another feasible implementation manner, determining the region of interest in the target image based on the candidate connected domain includes: constructing a distance vector corresponding to the candidate connected domain based on the position of the morphological center point of the candidate connected domain; wherein the distance vector includes the distance value between the morphological center point of the candidate connected domain and the morphological center point of an adjacent candidate connected domain, the adjacent candidate connected domain includes a second preset number of candidate connected domains whose morphological center points are closest to the morphological center point of the candidate connected domain, and the second preset number of distance values ​​in the distance vector are sorted from small to large; and clustering analysis is performed on the distance vectors corresponding to the multiple candidate connected domains to eliminate the candidate connected domains corresponding to the outlier distance vectors to obtain the region of interest in the target image.

[0080] In a specific implementation, the position of the morphological center point of each candidate connected domain after morphological processing is determined, and for each candidate connected domain, the second preset number of adjacent candidate connected domains closest to its morphological center point is determined, and a distance vector is constructed based on the distance between the morphological center point of each candidate connected domain and the second preset number of adjacent candidate connected domains closest to it, and the second preset number of distance values ​​in the distance vector are sorted from small to large. Further, cluster analysis is performed on the distance vectors corresponding to all candidate connected domains, and the specific clustering method is not limited here, such as K-means clustering. Cluster analysis of distance vectors can determine outlier distance vectors, eliminate candidate connected domains corresponding to outlier distance vectors, and use the remaining candidate connected domains as regions of interest in the target image.

[0081] As another feasible implementation manner, determining the region of interest in the target image based on the candidate connected domain includes: determining the morphological center point of the candidate connected domain as the first morphological center point; re-determining the morphological center point of the candidate connected domain as the second morphological center point according to the grayscale values ​​of the pixel points at the corresponding positions of the candidate connected domain in the target image; performing position correction on the candidate connected domain based on the positional relationship between the second morphological center point and the first morphological center point, and using the corrected candidate connected domain as the region of interest in the target image.

[0082] In a specific implementation, for each candidate connected domain after morphological processing, its morphological center point in the image after binarization processing is the first morphological center point, and then the position of the candidate connected domain is determined in the original target image, and the morphological center point determined according to the grayscale value of the pixel points in the candidate connected domain in the original target image is the second morphological center point, and the candidate connected domain is positionally corrected according to the positional relationship between the second morphological center point and the first morphological center point. For example, the second morphological center point is two pixels to the right of the first morphological center point, then the candidate connected domain is translated to the right by two pixels as a whole as the corrected candidate connected domain, and the corrected candidate connected domain is used as the region of interest in the target image.

[0083] The embodiment of the present application discloses a method for determining a region of interest. Compared with the previous embodiment, this embodiment further illustrates and optimizes the technical solution. Specifically:

[0084] See also Figure 2 , a flowchart of another method for determining a region of interest according to an exemplary embodiment is shown, such as Figure 2 As shown, including:

[0085] S201: Acquire a target image, perform noise reduction processing on the target image, and set a preset ratio;

[0086] In a specific implementation, a target image is acquired, noise reduction is performed on the target image through image preprocessing, and then a preset ratio of the region of interest is determined.

[0087] S202: Determine a first threshold and a second threshold that meet a preset condition; wherein the first threshold and the second threshold are grayscale values ​​used to divide pixel areas, the first threshold is less than the second threshold, the pixel points in the target image whose grayscale values ​​are less than the first threshold form a first pixel area, and the pixel points in the target image whose grayscale values ​​are greater than the second threshold form a second pixel area; the preset condition is that the grayscale difference between the first pixel area and the second pixel area is the largest and the sum of the proportions of the first pixel area and the second pixel area in the target image is the preset proportion;

[0088] In a specific implementation, the ultimately determined region of interest includes two parts, namely a first pixel region and a second pixel region. The first pixel region is a pixel region composed of pixel points whose grayscale values ​​are less than a first threshold, and the second pixel region is a pixel region composed of pixel points whose grayscale values ​​are greater than a second threshold. The sum of the proportions of the first pixel region and the second pixel region in the target image is the preset proportion in the previous step.

[0089] S203: Binarizing the pixels in the target image based on the first threshold and the second threshold; wherein the grayscale values ​​of the pixels in the first pixel region and the second pixel region are set to a first preset value, and the grayscale values ​​of the pixels in the region other than the first pixel region and the second pixel region in the target image are set to a second preset value;

[0090] In a specific implementation, the pixels in the target image are binarized based on the first threshold and the second threshold, that is, the grayscale values ​​of the pixels in the first pixel area and the second pixel area are set to a first preset value, such as 255, and the grayscale values ​​of the pixels in other areas are set to a second preset value, such as 0. After the binarization process, the first pixel area and the second pixel area contain multiple highlighted connected domains.

[0091] S204: performing morphological processing on the connected domains included in the first pixel region and the second pixel region to obtain a first candidate connected domain;

[0092] In a specific implementation, morphological processing is performed on multiple connected domains contained in the first pixel region and the second pixel region, such as corrosion, expansion, opening operation and closing operation, to obtain a first candidate connected domain. Morphological processing is conducive to improving the quality of binary images.

[0093] S205: extracting multiple connectivity parameters of the first candidate connected domain, weighting the multiple connectivity parameters based on weights corresponding to different connectivity parameters to obtain a connected domain score, and selecting a first preset number of first candidate connected domains with the largest connected domain scores as second candidate connected domains;

[0094] In a specific implementation, for each first candidate connected domain after morphological processing, multiple connectivity parameters are extracted, which may include shape, size, position, etc., and corresponding weights are assigned to different connectivity parameters. The connected domain score of the first candidate connected domain is obtained by weighting and synthesizing the multiple connectivity parameters of the first candidate connected domain, and the first preset number of first candidate connected domains with the largest connected domain scores are selected as the second candidate connected domain. For example, the number N of regions of interest that need to be determined in the end can be preset, and the first preset number is set to N (1+10%).

[0095] S206: constructing a distance vector corresponding to the second candidate connected domain based on the position of the morphological center point of the second candidate connected domain; wherein the distance vector includes the distance value between the morphological center point of the second candidate connected domain and the morphological center point of the adjacent first candidate connected domain, the adjacent second candidate connected domain includes a second preset number of second candidate connected domains whose morphological center points are closest to the morphological center point of the second candidate connected domain, and the second preset number of distance values ​​in the distance vector are sorted from small to large;

[0096] S207: performing cluster analysis on the distance vectors corresponding to the plurality of second candidate connected components to eliminate the second candidate connected components corresponding to the outlier distance vectors to obtain a third candidate connected component;

[0097] In a specific implementation, the position of the morphological center point of the second candidate connected domain is determined, and for each second candidate connected domain, the second preset number of adjacent second candidate connected domains closest to its morphological center point is determined, and a distance vector is constructed based on the distance between the morphological center point of each second candidate connected domain and the second preset number of adjacent second candidate connected domains closest to it, and the second preset number of distance values ​​in the distance vector are sorted from small to large. Further, cluster analysis is performed on the distance vectors corresponding to all second candidate connected domains, and the specific clustering method is not limited here, such as K-means clustering. Cluster analysis of distance vectors can determine outlier distance vectors, eliminate the second candidate connected domains corresponding to the outlier distance vectors, and use the remaining second candidate connected domains as third candidate connected domains.

[0098] S208: Determine the morphological center point of the third candidate connected domain as the first morphological center point, re-determine the morphological center point of the third candidate connected domain as the second morphological center point according to the grayscale value of the pixel point at the corresponding position of the third candidate connected domain in the target image, perform position correction on the third candidate connected domain based on the positional relationship between the second morphological center point and the first morphological center point to obtain a corrected third candidate connected domain, and use the corrected third candidate connected domain as the region of interest in the target image.

[0099] In a specific implementation, for each third candidate connected domain, its morphological center point in the image after binarization processing is the first morphological center point, and then the position of the third candidate connected domain is determined in the original target image, and the morphological center point determined according to the grayscale value of the pixel points in the third candidate connected domain in the original target image is the second morphological center point, and the position of the third candidate connected domain is corrected according to the positional relationship between the second morphological center point and the first morphological center point, and the corrected third candidate connected domain is used as the region of interest in the target image.

[0100] It can be seen that this embodiment screens the connected domains after morphological processing, determines the final region of interest, and removes the connected domains that do not meet the expected morphology or characteristics, thereby further optimizing the extraction effect of the region of interest and further improving the accuracy of determining the region of interest.

[0101] The following is an application example provided by this application. In the application scenario of industrial inspection, it is necessary to regularly inspect the equipment in the factory. The basis of the inspection equipment is to identify the location of the equipment in the factory. In the specific implementation, first take a target image in the factory, and then determine the location of the equipment in the target image, that is, the area of ​​interest. The specific steps are as follows:

[0102] Step 1: Perform noise reduction processing on the captured target image, and set the area corresponding to the device in the target image to a preset ratio of the target image;

[0103] Step 2: Determine a first threshold and a second threshold that meet preset conditions; wherein the first threshold and the second threshold are grayscale values ​​used to divide pixel areas, the first threshold is less than the second threshold, the pixels in the target image whose grayscale values ​​are less than the first threshold constitute the first pixel area, and the pixels in the target image whose grayscale values ​​are greater than the second threshold constitute the second pixel area; the preset condition is that the grayscale difference between the first pixel area and the second pixel area is the largest and the sum of the proportions of the first pixel area and the second pixel area in the target image is a preset proportion;

[0104] Step 3: Binarizing the pixels in the target image based on the first threshold and the second threshold; wherein the grayscale values ​​of the pixels in the first pixel region and the second pixel region are set to 255, and the grayscale values ​​of the pixels in the region other than the first pixel region and the second pixel region in the target image are set to 0;

[0105] Step 4: Perform morphological processing on the connected domains included in the first pixel region and the second pixel region to obtain a first candidate connected domain;

[0106] Step 5: extract multiple connectivity parameters of the first candidate connected domain, weight the multiple connectivity parameters based on the weights corresponding to different connectivity parameters to obtain a connected domain score, and select a first preset number of first candidate connected domains with the largest connected domain scores as second candidate connected domains;

[0107] Step 6: constructing a distance vector corresponding to the second candidate connected domain based on the position of the morphological center point of the second candidate connected domain; wherein the distance vector includes the distance value between the morphological center point of the second candidate connected domain and the morphological center point of the adjacent first candidate connected domain, the adjacent second candidate connected domain includes a second preset number of second candidate connected domains whose morphological center points are closest to the morphological center point of the second candidate connected domain, and the second preset number of distance values ​​in the distance vector are sorted from small to large;

[0108] Step 7: performing cluster analysis on the distance vectors corresponding to the plurality of second candidate connected domains to eliminate the second candidate connected domains corresponding to the outlier distance vectors to obtain the third candidate connected domain;

[0109] Step 8: Determine the morphological center point of the third candidate connected domain as the first morphological center point, re-determine the morphological center point of the third candidate connected domain as the second morphological center point according to the grayscale value of the pixel point at the corresponding position of the third candidate connected domain in the target image, perform position correction on the third candidate connected domain based on the positional relationship between the second morphological center point and the first morphological center point to obtain a corrected third candidate connected domain, and use the corrected third candidate connected domain as the location of the device in the target image.

[0110] A device for determining a region of interest provided in an embodiment of the present application is introduced below. The device for determining a region of interest described below and the method for determining a region of interest described above may refer to each other.

[0111] See also Figure 3 , according to an exemplary embodiment, a structural diagram of a device for determining a region of interest is shown, such as Figure 3 As shown, including:

[0112] The acquisition module 301 is used to acquire the target image and set a preset ratio;

[0113] The first determination module 302 is used to determine a first threshold and a second threshold that meet a preset condition; wherein the first threshold and the second threshold are grayscale values ​​used to divide pixel areas, the first threshold is less than the second threshold, the pixels in the target image whose grayscale values ​​are less than the first threshold constitute a first pixel area, and the pixels in the target image whose grayscale values ​​are greater than the second threshold constitute a second pixel area; the preset condition is that the grayscale difference between the first pixel area and the second pixel area is the largest and the sum of the proportions of the first pixel area and the second pixel area in the target image is the preset proportion;

[0114] The second determining module 303 is configured to determine a region of interest in the target image based on the first pixel region and the second pixel region.

[0115] The device for determining the region of interest provided in the embodiment of the present application determines the region of interest based on the pixel region whose grayscale value is less than the first threshold and whose grayscale value is greater than the second threshold, thereby realizing automatic recognition of the region of interest and improving the efficiency of determining the region of interest. In addition, the present application solves the first threshold and the second threshold of the grayscale value, determines the first highlighted pixel region in the target image according to the second threshold of the grayscale value, and determines the second dark pixel region in the target image according to the first threshold of the grayscale value, thereby realizing the simultaneous extraction of the region of interest in the bright and dark regions in the target image, being suitable for the situation where the region of interest exists in both bright and dark regions in the target image, optimizing the extraction effect of the region of interest and improving the accuracy of determining the region of interest.

[0116] Based on the above embodiment, as an optional implementation manner, the first determining module 302 is specifically used to: construct a gray value difference characterization function between the first pixel area and the second pixel area based on the sum of the first product and the second product, and determine a first threshold value and a second threshold value of the gray value when the gray value difference characterization function is at a maximum value;

[0117] Among them, the first product is the product of the square of the difference between the first grayscale average value and the third grayscale average value and the first pixel ratio, the second product is the product of the square of the difference between the second grayscale average value and the third grayscale average value and the second pixel ratio, the first grayscale average value is the grayscale average value of the pixels in the first pixel area, the second grayscale average value is the grayscale average value of the pixels in the second pixel area, the third grayscale average value is the grayscale average value of the pixels in the first pixel area and the second pixel area, the first pixel ratio is the ratio of the pixels in the first pixel area to the pixels in the target image, the second pixel ratio is the ratio of the pixels in the second pixel area to the pixels in the target image, and the sum of the first pixel ratio and the second pixel ratio is the preset ratio.

[0118] Based on the above embodiment, as an optional implementation manner, the gray value difference characterization function is:

[0119] ;

[0120] in, is the first threshold, is the second threshold, is the first pixel ratio, is the second pixel ratio, is the first grayscale average value, is the second grayscale average value, is the third grayscale average value, , P is the preset ratio, A value representing the difference in grayscale values ​​between the first pixel region and the second pixel region.

[0121] Based on the above embodiment, as an optional implementation manner, it also includes:

[0122] The pixel points in the target image are binarized based on the first threshold value and the second threshold value; wherein the grayscale values ​​of the pixel points in the first pixel area and the second pixel area are set to a first preset value, and the grayscale values ​​of the pixel points in the area other than the first pixel area and the second pixel area in the target image are set to a second preset value.

[0123] Based on the above embodiment, as an optional implementation, the second determination module 303 is specifically used to: perform morphological processing on the connected domains contained in the first pixel area and the second pixel area to obtain candidate connected domains, and determine the region of interest in the target image based on the candidate connected domains.

[0124] Based on the above embodiment, as an optional implementation, the second determination module 303 is specifically used to: extract multiple connectivity parameters of the candidate connected domain, weight the multiple connectivity parameters based on the weights corresponding to different connectivity parameters to obtain a connected domain score; and select a first preset number of candidate connected domains with the largest connected domain scores as the region of interest in the target image.

[0125] Based on the above embodiment, as an optional implementation, the second determination module 303 is specifically used to: extract multiple connectivity parameters of the candidate connected domain, normalize the connectivity parameters according to the grayscale value and gradient value of the candidate connected domain; weight the multiple normalized connectivity parameters based on the weights corresponding to different connectivity parameters to obtain a connected domain score; select a first preset number of candidate connected domains with the largest connected domain scores as the region of interest in the target image.

[0126] Based on the above embodiment, as an optional implementation, the second determination module 303 uses a normalization processing formula to normalize the connectivity parameter; wherein, the normalization processing formula is: F=(G×f+D×f) / 2, G is the grayscale value of the candidate connected domain, D is the gradient value of the candidate connected domain, f is the connectivity parameter, and F is the connectivity parameter after normalization.

[0127] On the basis of the above embodiment, as an optional implementation manner, the second determination module 303 is specifically used to: construct a distance vector corresponding to the candidate connected domain based on the position of the morphological center point of the candidate connected domain; wherein the distance vector includes the distance value between the morphological center point of the candidate connected domain and the morphological center point of an adjacent candidate connected domain, the adjacent candidate connected domain includes a second preset number of candidate connected domains whose morphological center points are closest to the morphological center point of the candidate connected domain, and the second preset number of distance values ​​in the distance vector are sorted from small to large; cluster analysis is performed on the distance vectors corresponding to the multiple candidate connected domains to eliminate the candidate connected domains corresponding to the outlier distance vectors to obtain the region of interest in the target image.

[0128] On the basis of the above embodiment, as an optional implementation manner, the second determination module 303 is specifically used to: determine the morphological center point of the candidate connected domain as the first morphological center point; re-determine the morphological center point of the candidate connected domain as the second morphological center point according to the grayscale value of the pixel point at the corresponding position of the candidate connected domain in the target image; perform position correction on the candidate connected domain based on the positional relationship between the second morphological center point and the first morphological center point, and use the corrected candidate connected domain as the region of interest in the target image.

[0129] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0130] Based on the hardware implementation of the above program module, and in order to implement the method of the embodiment of the present application, the embodiment of the present application also provides an electronic device, Figure 4 FIG. 1 is a structural diagram of an electronic device according to an exemplary embodiment. Figure 4 As shown, the electronic equipment includes:

[0131] Communication interface 1, capable of exchanging information with other devices such as network devices;

[0132] The processor 2 is connected to the communication interface 1 to implement information exchange with other devices, and is used to execute the method for determining the region of interest provided by one or more technical solutions when running a computer program. The computer program is stored in the memory 3.

[0133] Of course, in actual application, the various components in the electronic device are coupled together through the bus system 4. It can be understood that the bus system 4 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 4 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, Figure 4Various buses are labeled as bus system 4.

[0134] The memory 3 in the embodiment of the present application is used to store various types of data to support the operation of the electronic device. Examples of such data include: any computer program used to operate on the electronic device.

[0135] It can be understood that the memory 3 can be a volatile memory or a non-volatile memory, and can also include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM); the magnetic surface memory can be a disk memory or a tape memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), synchronous static random access memory (SSRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM, SyncLink Dynamic Random Access Memory), and direct RAMbus random access memory (DRRAM, Direct Rambus Random Access Memory).The memory 3 described in the embodiments of the present application is intended to include but is not limited to these and any other suitable types of memories.

[0136] The method disclosed in the above embodiment of the present application can be applied to the processor 2, or implemented by the processor 2. The processor 2 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit in the processor 2 or the instruction in the form of software. The above processor 2 may be a general-purpose processor, a DSP, or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The processor 2 can implement or execute the methods, steps and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor may be a microprocessor or any conventional processor, etc. In combination with the steps of the method disclosed in the embodiment of the present application, it can be directly embodied as a hardware decoding processor to execute, or it can be executed by a combination of hardware and software modules in the decoding processor. The software module may be located in a storage medium, which is located in the memory 3, and the processor 2 reads the program in the memory 3 and completes the steps of the above method in combination with its hardware.

[0137] When the processor 2 executes the program, the corresponding processes in the various methods of the embodiments of the present application are implemented, which will not be repeated here for the sake of brevity.

[0138] In an exemplary embodiment, the present application also provides a storage medium, namely a computer storage medium, specifically a computer-readable storage medium, for example, a memory 3 storing a computer program, and the computer program can be executed by a processor 2 to complete the steps of the aforementioned method. The computer-readable storage medium can be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface storage, optical disk, CD-ROM, etc.

[0139] A person of ordinary skill in the art can understand that: all or part of the steps of implementing the above-mentioned method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium, which, when executed, executes the steps of the above-mentioned method embodiment; and the aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, disks or optical disks.

[0140] Alternatively, if the above-mentioned integrated unit of the present application is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application can essentially or in other words, the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium and includes a number of instructions for an electronic device (which can be a personal computer, server, network device, etc.) to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, disks or optical disks.

[0141] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A method for determining a region of interest, characterized in that: include: Get the target image and set the preset ratio; Determine a first threshold and a second threshold that meet a preset condition; wherein the first threshold and the second threshold are grayscale values ​​used to divide pixel areas, the first threshold is less than the second threshold, pixels in the target image whose grayscale values ​​are less than the first threshold constitute a first pixel area, and pixels in the target image whose grayscale values ​​are greater than the second threshold constitute a second pixel area; the preset condition is that the grayscale difference between the first pixel area and the second pixel area is the largest and the sum of the proportions of the first pixel area and the second pixel area in the target image is the preset proportion; A region of interest in the target image is determined based on the first pixel region and the second pixel region.

2. The method for determining a region of interest according to claim 1, characterized in that: The determining of the first threshold and the second threshold that meet the preset conditions includes: constructing a grayscale value difference characterization function of the first pixel region and the second pixel region based on the sum of the first product and the second product, and determining a first threshold and a second threshold of the grayscale value when the grayscale value difference characterization function is a maximum value; Among them, the first product is the product of the square of the difference between the first grayscale average value and the third grayscale average value and the first pixel ratio, the second product is the product of the square of the difference between the second grayscale average value and the third grayscale average value and the second pixel ratio, the first grayscale average value is the grayscale average value of the pixels in the first pixel area, the second grayscale average value is the grayscale average value of the pixels in the second pixel area, the third grayscale average value is the grayscale average value of the pixels in the first pixel area and the second pixel area, the first pixel ratio is the ratio of the pixels in the first pixel area to the pixels in the target image, the second pixel ratio is the ratio of the pixels in the second pixel area to the pixels in the target image, and the sum of the first pixel ratio and the second pixel ratio is the preset ratio.

3. The method for determining a region of interest according to claim 2, characterized in that: The gray value difference characterization function is: ; in, is the first threshold, is the second threshold, is the first pixel ratio, is the second pixel ratio, is the first grayscale average value, is the second grayscale average value, is the third grayscale average value, , P is the preset ratio, A value representing the difference in grayscale values ​​between the first pixel region and the second pixel region.

4. The method for determining a region of interest according to claim 1, characterized in that: After determining the first threshold and the second threshold that meet the preset conditions, the method further includes: The pixel points in the target image are binarized based on the first threshold value and the second threshold value; wherein the grayscale values ​​of the pixel points in the first pixel area and the second pixel area are set to a first preset value, and the grayscale values ​​of the pixel points in the area other than the first pixel area and the second pixel area in the target image are set to a second preset value.

5. The method for determining a region of interest according to claim 1, characterized in that: The determining the region of interest in the target image based on the first pixel region and the second pixel region comprises: Morphological processing is performed on the connected domains included in the first pixel region and the second pixel region to obtain candidate connected domains, and a region of interest in the target image is determined based on the candidate connected domains.

6. The method for determining a region of interest according to claim 5, characterized in that: The determining the region of interest in the target image based on the candidate connected domain comprises: Extracting multiple connectivity parameters of the candidate connected domain, and weighting the multiple connectivity parameters based on weights corresponding to different connectivity parameters to obtain a connected domain score; A first preset number of candidate connected domains with the largest connected domain scores are selected as regions of interest in the target image.

7. The method for determining a region of interest according to claim 6, characterized in that: After extracting a plurality of connectivity parameters of the candidate connected domain, the method further includes: Normalizing the connectivity parameters according to the grayscale value and gradient value of the candidate connected domain; The step of weighting the plurality of connectivity parameters based on weights corresponding to different connectivity parameters to obtain a connectivity domain score includes: The connected domain score is obtained by weighting the multiple normalized connected parameters based on the weights corresponding to the different connected parameters.

8. The method for determining a region of interest according to claim 7, characterized in that: The normalizing the connectivity parameter according to the grayscale value and the gradient value of the candidate connected domain includes: The connectivity parameters are normalized using a normalization formula; wherein the normalization formula is: F=(G×f+D×f) / 2, G is the grayscale value of the candidate connected domain, D is the gradient value of the candidate connected domain, f is the connectivity parameter, and F is the connectivity parameter after normalization.

9. The method for determining a region of interest according to claim 5, characterized in that: The determining the region of interest in the target image based on the candidate connected domain comprises: Constructing a distance vector corresponding to the candidate connected domain based on the position of the morphological center point of the candidate connected domain; wherein the distance vector includes the distance value between the morphological center point of the candidate connected domain and the morphological center points of adjacent candidate connected domains, the adjacent candidate connected domains include a second preset number of candidate connected domains whose morphological center points are closest to the morphological center point of the candidate connected domain, and the second preset number of distance values ​​in the distance vector are sorted from small to large; Cluster analysis is performed on the distance vectors corresponding to the plurality of candidate connected domains to eliminate the candidate connected domains corresponding to the outlier distance vectors to obtain the region of interest in the target image.

10. The method for determining a region of interest according to claim 5, characterized in that: The determining the region of interest in the target image based on the candidate connected domain comprises: Determining the morphological center point of the candidate connected domain as the first morphological center point; Re-determining the morphological center point of the candidate connected domain as the second morphological center point according to the grayscale values ​​of the pixel points at the corresponding positions of the candidate connected domain in the target image; The position of the candidate connected domain is corrected based on the positional relationship between the second morphological center point and the first morphological center point, and the corrected candidate connected domain is used as the region of interest in the target image.

11. A device for determining a region of interest, characterized in that: include: An acquisition module is used to acquire a target image and set a preset ratio; A first determination module is used to determine a first threshold and a second threshold that meet a preset condition; wherein the first threshold and the second threshold are grayscale values ​​used to divide pixel areas, the first threshold is less than the second threshold, the pixel points in the target image whose grayscale value is less than the first threshold constitute a first pixel area, and the pixel points in the target image whose grayscale value is greater than the second threshold constitute a second pixel area; the preset condition is that the grayscale difference between the first pixel area and the second pixel area is the largest and the sum of the proportions of the first pixel area and the second pixel area in the target image is the preset proportion; The second determining module is used to determine a region of interest in the target image based on the first pixel region and the second pixel region.

12. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the method for determining a region of interest as claimed in any one of claims 1 to 10 when executing the computer program.

13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed, the steps of the method for determining a region of interest according to any one of claims 1 to 10 are implemented.

Citation Information

Cited By

  • Method for automatically drawing region of interest and related product

    CN120726075A

  • Brightness adjustment method, and scanning device

    WO2026184514A1