A method, apparatus, and device for determining a target region in an image.

By acquiring feature points and location information from images and using matrix transformations to determine the target region, the problem of high computational cost and low efficiency in existing technologies is solved, achieving fast and efficient target region determination.

CN114119735BActive Publication Date: 2025-10-28TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010883957.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-08-28
Publication Date
2025-10-28
Estimated Expiration
2040-08-28

AI Technical Summary

Technical Problem

Existing techniques are computationally intensive and inefficient when determining the rectangular region with the richest texture in an image, necessitating a method that can quickly determine the target region.

Method used

By acquiring feature points and their location information in the target image, the target matrix is ​​generated using initialization matrix assignment and integral difference matrix transformation, the target pixel points are determined, and the target region is determined based on preset region parameter information.

Benefits of technology

This reduces the amount of computation, lowers the processing pressure on equipment, and improves the efficiency of target area determination.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114119735B_ABST
    Figure CN114119735B_ABST
Patent Text Reader

Abstract

This application relates to a method, apparatus, and device for determining a target region in an image. The method includes: acquiring a target image; determining multiple feature points in the target image and the position information of each feature point in the target image; acquiring an initialized first matrix; assigning values ​​to the initialized first matrix based on the position information of each feature point in the target image to obtain an updated first matrix; performing an integral-difference matrix transformation on the updated first matrix based on preset region parameter information to generate a target matrix; determining target elements from the target matrix and determining target pixels in the target image corresponding to the target elements; and determining a target region in the target image based on the target pixels and the preset region parameter information. This application can reduce the computational load in the target region determination process and improve the efficiency of target region determination.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, and in particular to a method, apparatus and device for determining a target region in an image. Background Technology

[0002] In the process of image processing, it is usually necessary to find the target region in the image to be processed that has the most prominent features compared to other regions. For example, find the rectangular region with the richest texture in the image to be processed. The rectangular region with the richest texture refers to the rectangular region in the image to be processed that has the most feature points.

[0003] In existing technologies, determining the region with the richest texture generally involves an exhaustive approach. This involves drawing a rectangle of a specified size centered on each pixel in the image, counting the number of feature points within each rectangle, and then identifying the rectangle with the highest number of feature points as the region with the richest texture. This exhaustive method is computationally intensive and inefficient. Therefore, a faster method is needed to determine the region with the richest texture in an image. Summary of the Invention

[0004] The technical problem to be solved by this application is to provide a method, apparatus and device for determining a target region in an image, which can reduce the amount of computation in the process of determining the target region, thereby reducing the processing pressure on the device, and can quickly determine the target region, thereby improving the efficiency of target region determination.

[0005] To address the aforementioned technical problems, this application provides a method for determining a target region in an image, the method comprising:

[0006] Acquire a target image, determine multiple feature points in the target image, and the position information of each feature point in the target image;

[0007] An initial first matrix is ​​obtained, and values ​​are assigned to the initial first matrix based on the position information of each feature point in the target image to obtain an updated first matrix; wherein, each element in the initial first matrix corresponds one-to-one with each pixel in the target image;

[0008] Based on preset region parameter information, the updated first matrix is ​​subjected to integral difference matrix transformation to generate the target matrix;

[0009] Target elements are determined from the target matrix, and target pixels in the target image corresponding to the target elements are determined.

[0010] Based on the target pixels in the target image corresponding to the target element, and the preset region parameter information, a target region is determined in the target image.

[0011] On the other hand, this application provides an apparatus for determining a target region in an image, the apparatus comprising:

[0012] The feature information determination module is used to acquire a target image, determine multiple feature points in the target image, and the position information of each feature point in the target image;

[0013] The matrix update module is used to obtain an initialized first matrix, and assign values ​​to the initialized first matrix based on the position information of each feature point in the target image to obtain an updated first matrix; wherein, each element in the initialized first matrix corresponds one-to-one with each pixel in the target image;

[0014] The matrix transformation module is used to perform an integral difference matrix transformation on the updated first matrix based on preset region parameter information to generate a target matrix;

[0015] The target pixel point determination module is used to determine target elements from the target matrix and to determine the target pixels in the target image that correspond to the target elements;

[0016] The target region determination module is used to determine a target region in the target image based on the target pixels corresponding to the target element in the target image and the preset region parameter information.

[0017] On the other hand, this application provides an apparatus comprising a processor and a memory, the memory storing at least one instruction or at least one program, the at least one instruction or the at least one program being loaded and executed by the processor to implement the method for determining a target region in an image as described above.

[0018] On the other hand, this application provides a computer storage medium storing at least one instruction or at least one program, which is loaded by a processor and executed as described above in the method for determining a target region in an image.

[0019] Implementing the embodiments of this application has the following beneficial effects:

[0020] This application determines multiple feature points in the target image and their position information within the target image, assigning values ​​to an initialized first matrix to obtain an updated first matrix. Each element in the initialized first matrix corresponds one-to-one with a pixel in the target image. Based on preset region parameter information, an integral-difference matrix transformation is performed on the updated first matrix to generate a target matrix. Target elements and target pixels in the target image are determined from the target matrix. Based on the target pixels and preset region parameter information, a target region is determined in the target image. In this application, since the target image corresponds to a matrix, the processing of the target image is transformed into the processing of the corresponding matrix. After a series of matrix transformations, the target elements obtained correspond to the target pixels to be determined in the target image. Based on the determined target pixels, the corresponding target region can be determined. This application can directly determine the target pixels corresponding to the final target area, which is different from the method of exhaustively finding the area corresponding to each pixel and then determining the target area from it. This can reduce the amount of calculation in the process of determining the target area, thereby reducing the processing pressure on the device and quickly determining the target area, thus improving the efficiency of target area determination. Attached Figure Description

[0021] To more clearly illustrate the technical solutions and advantages in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0022] Figure 1 This is a schematic diagram of the implementation environment provided in the embodiments of this application;

[0023] Figure 2 This is a flowchart of a method for determining a target region in an image, provided in an embodiment of this application.

[0024] Figure 3 This is a flowchart of a method for determining image feature points provided in an embodiment of this application;

[0025] Figure 4 This is a flowchart of a method for assigning values ​​to a matrix based on the location information of feature points, provided in an embodiment of this application.

[0026] Figure 5 This is a flowchart of a target matrix generation method provided in an embodiment of this application;

[0027] Figure 6 This is a flowchart of the method for generating the first transformation matrix provided in an embodiment of this application;

[0028] Figure 7 This is a flowchart of the method for generating the second transformation matrix provided in an embodiment of this application;

[0029] Figure 8 This is a flowchart of the method for determining target pixels provided in an embodiment of this application;

[0030] Figure 9 This is a flowchart of the method for determining the target region provided in the embodiments of this application;

[0031] Figure 10 This is a schematic diagram of an apparatus for determining a target region in an image, provided in an embodiment of this application;

[0032] Figure 11 This is a schematic diagram of a device structure provided in an embodiment of this application. Detailed Implementation

[0033] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of this application, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.

[0034] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or server that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.

[0035] Please see Figure 1 The illustration shows an implementation environment provided in the embodiments of this application. The implementation environment may include at least one first terminal 110 and a second terminal 120, which can communicate with each other via a network.

[0036] Specifically, the user sends an image processing request to the second terminal 120 through the first terminal 110 according to their needs. The image processing request includes the image to be processed and the corresponding image processing requirements. The second terminal 120 performs the corresponding image processing according to the received image processing request and returns the corresponding image processing result to the first terminal 110. Alternatively, the first terminal 110 directly responds to the user's image processing request, processes the corresponding image according to the image processing request, and generates the corresponding image processing result. In this embodiment, the image to be processed can be a picture or a video. The image to be processed can be acquired in real time by the first terminal 110 through an image acquisition device, or it can be stored in advance in the memory of the first terminal 110.

[0037] The first terminal 110 can communicate with the second terminal 120 based on a browser / server (B / S) or client / server (C / S) model. The first terminal 110 may include physical devices such as smartphones, tablets, laptops, digital assistants, smart wearable devices, in-vehicle terminals, and servers, and may also include software running on the physical device, such as applications. The operating system running on the first terminal 110 in this embodiment may include, but is not limited to, Android, iOS, Linux, and Windows.

[0038] The second terminal 120 and the first terminal 110 can establish a communication connection via wired or wireless means. The second terminal 120 may include an independently operating server, a distributed server, or a server cluster consisting of multiple servers, wherein the server may be a cloud server.

[0039] To address the problems of high computational cost and low efficiency in existing technologies that use exhaustive methods to determine target regions in images, this application proposes a method for determining target regions in images. The executing entity can be either the first terminal or the second terminal described above, depending on the specific implementation. Please refer to [link to relevant documentation]. Figure 2 The method may specifically include:

[0040] S210. Acquire a target image, determine multiple feature points in the target image, and the position information of each feature point in the target image.

[0041] In image processing, feature points mainly refer to the ability to represent an image or target in a similar or at least very similar invariant form in other similar images containing the same scene or target. That is, for the same object or scene, if multiple images are taken from different angles, and the same areas can be identified as the same, then the points that are identified as the same are called feature points.

[0042] For specific methods on determining image feature points, please refer to [link / reference]. Figure 3 The method may include:

[0043] S310. Based on the pixel values ​​of each pixel in the target image, determine multiple feature points in the target image.

[0044] Based on the above description of feature points, the feature points in the embodiments of this application can be interpreted as follows: the pixel values ​​of feature points in a certain region of the image are significantly different from the pixel values ​​of non-feature points outside that region; thus, based on some feature point determination algorithms, multiple feature points in the target image can be determined.

[0045] S320. Generate a pixel matrix corresponding to the target image.

[0046] An image can be formed by a number of pixels arranged in an orderly manner and assigned corresponding color values. Thus, an image can be regarded as a pixel matrix. For a target image, a corresponding pixel matrix can be generated, and each pixel in the target image can correspond to an element in the pixel matrix.

[0047] S330. Determine the position information of the plurality of feature points in the pixel matrix.

[0048] S340. The position information of the plurality of feature points in the pixel matrix is ​​determined as the position information of the plurality of feature points in the target image.

[0049] In a matrix, the position of an element can be identified by its row and column identifiers. Since each pixel in the image corresponds to an element in the pixel matrix, the pixel matrix elements corresponding to multiple feature points can be determined, and then the position information of the pixel matrix elements corresponding to multiple feature points in the pixel matrix can be determined respectively. The position information of multiple feature points in the target image can be represented by the position information of the pixel matrix elements corresponding to the feature points in the pixel matrix.

[0050] By transforming the identification of the positional information of each feature point in the target image into the identification of the position of the element in the corresponding pixel matrix, the difficulty of identifying the position of feature points can be simplified, making the positional identification information clearer, more direct, and easier to understand.

[0051] S220. Obtain an initialized first matrix, and assign values ​​to the initialized first matrix based on the position information of each feature point in the target image to obtain an updated first matrix; wherein, each element in the initialized first matrix corresponds one-to-one with each pixel in the target image.

[0052] In this embodiment, the values ​​of all elements in the initialization matrix can be 0. Each element in the initialization matrix corresponds one-to-one with each pixel in the target image. The initialization matrix can be assigned values ​​based on the determined position information of each feature point in the target image. The position information of each feature point in the target image can be determined by a matrix corresponding to the target image, for example, through this embodiment. Figure 3 The method shown is used to obtain the location information of each feature point in the target image.

[0053] The process of assigning values ​​to the initial first matrix based on the location information of feature points can be found in [reference needed]. Figure 4 Specifically, it may include:

[0054] S410. Traverse the position information of each feature point in the target image.

[0055] S420. Based on the position information of each feature point in the target image, determine the feature elements in the initialized first matrix.

[0056] S430. Set the element values ​​of each feature element to 1 to obtain the updated first matrix.

[0057] The position information of each feature point in the target image is traversed. Based on the position information of each feature point, the feature element corresponding to the feature point in the initialized first matrix is ​​determined, and the element value of the feature element is set to 1. For example, if the position information of feature point X is (x, y), then the element in the x-th row and y-th column of the initialized first matrix can be set to 1, and so on, so as to obtain the updated first matrix.

[0058] S230. Based on the preset region parameter information, perform an integral difference matrix transformation on the updated first matrix to generate the target matrix.

[0059] In this embodiment, the target matrix is ​​obtained from the updated first matrix, which requires at least two matrix transformations: integral transformation and difference transformation. (See [link to relevant documentation]). Figure 5 It illustrates a method for generating a target matrix, which may include:

[0060] S510. Perform an integral transformation on the updated first matrix to generate a first transformation matrix.

[0061] S520. Based on the preset region parameter information, perform a differential transformation on the first transformation matrix to generate a second transformation matrix.

[0062] S530. The second transformation matrix is ​​determined as the target matrix.

[0063] In the process of generating the target matrix, the first step is to perform an integral transformation on the updated first matrix to generate a first transformation matrix. Then, combined with preset region parameter information, a difference transformation is performed on the first transformation matrix to generate a second transformation matrix, which can be the target matrix. In the embodiments of this application, the number of rows and columns of the initialized first matrix, the updated first matrix, the first transformation matrix, and the second transformation matrix are all the same.

[0064] For details on the method for generating the first transformation matrix, please refer to [link / reference needed]. Figure 6 The method may include:

[0065] S610. Obtain the initialized first matrix to be transformed, wherein the number of rows of the first matrix to be transformed is the same as the number of rows of the updated first matrix, and the number of columns of the first matrix to be transformed is the same as the number of columns of the updated first matrix.

[0066] S620. Determine each element in the first matrix to be transformed as the first element.

[0067] S630. For each first element, determine the first row identifier and the first column identifier of the first element in the first matrix to be transformed.

[0068] S640. In the updated first matrix, find the set of elements that meet the first preset condition corresponding to the first element; the row identifier and column identifier of each element in the set of elements that meet the first preset condition are less than or equal to the first row identifier and the first column identifier, respectively.

[0069] S650. Assign values ​​to each first element in the first matrix to be transformed based on the set of elements that meet the first preset conditions corresponding to each first element in the first matrix to be transformed.

[0070] S660. The first matrix to be transformed after being assigned a value is determined as the first transformation matrix.

[0071] For each first element in the first transformation matrix, the element value of the first element is calculated based on the element values ​​of each element in the set of elements that meet the first preset conditions. By analogy, the element values ​​of each first element can be calculated. The calculated element values ​​of each first element are then assigned to each first element to obtain the first transformation matrix.

[0072] For details on how to generate the second transformation matrix, please refer to [link / reference needed]. Figure 7 The method may include:

[0073] S710. Obtain the initialized second matrix to be transformed; the number of rows of the second matrix to be transformed is the same as the number of rows of the first transformation matrix, and the number of columns of the second matrix to be transformed is the same as the number of columns of the first transformation matrix.

[0074] S720. Determine each element in the second matrix to be transformed as the second element.

[0075] S730. For each second element, determine the second row identifier and the second column identifier of the second element in the second matrix to be transformed.

[0076] S740. In the first transformation matrix, determine the element that meets the second preset condition corresponding to the second element; the row identifier and column identifier of the element that meets the second preset condition are the same as the second row identifier and the second column identifier, respectively.

[0077] S750. Based on the preset region parameter information and the elements that meet the second preset conditions corresponding to the second element, generate the difference term corresponding to the second element.

[0078] For each second element in the second transformation matrix, the difference term corresponding to the second element is obtained based on the row and column identifiers of the elements that meet the second preset conditions and the preset region parameter information.

[0079] S760. Assign values ​​to each second element in the second matrix to be transformed based on the difference terms corresponding to each second element in the second matrix to be transformed.

[0080] S770. The second matrix to be transformed, after being assigned a value, is determined as the second transformation matrix.

[0081] For each second element in the second transformation matrix, the element value of the second element is calculated based on the difference term corresponding to the second element. Then, based on the calculated element values ​​of each second element, values ​​are assigned to each second element to generate the second transformation matrix.

[0082] By performing an integral transformation on the updated first matrix as described above, a first transformation matrix is ​​generated; then, a difference transformation is performed on the first transformation matrix to generate a second transformation matrix, thus obtaining the target matrix.

[0083] S240. Determine the target element from the target matrix, and determine the target pixel in the target image that corresponds to the target element.

[0084] In this embodiment, the target pixel is the reference pixel in the target image used to determine the target region. For the method of determining the target pixel, please refer to [reference needed]. Figure 8The method may specifically include:

[0085] S810. Traverse each element in the target matrix and obtain the element value of each element.

[0086] S820. Determine the element with the largest value in the target matrix as the target element.

[0087] S830. Based on the position information of the target element in the target matrix, determine the target pixel point in the target image corresponding to the target element.

[0088] As can be seen from the above content of the embodiments of this application, each pixel in the target image corresponds one-to-one with each element in the target matrix. Therefore, based on the position information of the target element in the target matrix, the target pixel with corresponding position information in the target image can be determined.

[0089] S250. Based on the target pixels in the target image corresponding to the target element and the preset region parameter information, determine the target region in the target image.

[0090] The preset region parameter information here includes region height and region width; the region height is a first unit length, and the region width is a second unit length, where the unit length is the distance between two adjacent pixels in the horizontal direction or the distance between two adjacent pixels in the vertical direction in the target image; therefore, the method for determining the target region can be found in [reference needed]. Figure 9 The method may include:

[0091] S910. In the target image, with the target pixel as the center, define a region with a height of the first number of units and a width of the second number of units.

[0092] S920. Define the bounded area as the target area.

[0093] Centered on the target pixel points determined above, the target region in the target image is determined based on the preset region parameter information.

[0094] This application determines multiple feature points in the target image and their position information within the target image, assigning values ​​to an initialized first matrix to obtain an updated first matrix. Each element in the initialized first matrix corresponds one-to-one with a pixel in the target image. Based on preset region parameter information, an integral-difference matrix transformation is performed on the updated first matrix to generate a target matrix. Target elements and target pixels in the target image are determined from the target matrix. Based on the target pixels and preset region parameter information, a target region is determined in the target image. In this application, since the target image corresponds to a matrix, the processing of the target image is transformed into the processing of the corresponding matrix. After a series of matrix transformations, the target elements obtained correspond to the target pixels to be determined in the target image. Based on the determined target pixels, the corresponding target region can be determined. This application can directly determine the target pixels corresponding to the final target area, which is different from the method of exhaustively finding the area corresponding to each pixel and then determining the target area from it. This can reduce the amount of calculation in the process of determining the target area, thereby reducing the processing pressure on the device and quickly determining the target area, thus improving the efficiency of target area determination.

[0095] The following specific example illustrates the implementation process of this application.

[0096] 1. Find feature points

[0097] The width of the target image is known to be pixels, height is For each pixel, when calculating feature points in the target image, existing related algorithms can be used to obtain fast feature points (Features from accelerated segment test), SIFT feature points (Scale-invariant feature transform), or SURF feature points (Speeded up robust features), and the pixel coordinates of each feature point on the target image can be recorded. .

[0098] Get one OK The first initialization matrix of the column Its elements are all 0, matrix The coordinates of the elements in the image correspond one-to-one with the pixel coordinates in the target image. Traverse... The pixel coordinates of each feature point are used to construct the matrix corresponding to the pixel coordinates. The values ​​of the elements in the matrix are set to 1, resulting in the updated first matrix. .

[0099] 2. Integral matrix

[0100] According to the updated first matrix Calculations are performed to obtain the integral matrix. That is, the first transformation matrix ,matrix Too OK For the integral matrix The Middle Line number The expression for calculating the elements of the column is as follows:

[0101] (1)

[0102] by The element in the first row and second column of the matrix For example, the calculation process is as follows:

[0103] (2)

[0104] In the above formula (2) That is to be with The corresponding set of elements that meet the first preset condition.

[0105] Using the same calculation method, the matrix can be obtained. The element values ​​of each element in the table.

[0106] In addition, in the specific calculation matrix When calculating the element values ​​of each element, a fast calculation algorithm can be used, such as a double loop, iteration, recursion, etc. This application does not impose specific limitations on the embodiments, and the appropriate algorithm can be selected according to the specific implementation needs.

[0107] 3. Difference Matrix

[0108] According to the matrix The difference matrix can be calculated from the element values ​​of each element in the matrix. That is, the second transformation matrix ,matrix Too OK Columns, for matrices The Middle Line number The expression for calculating the elements of the column is as follows:

[0109] (3)

[0110] in, It is the height of the target rectangle. It is the width of the target rectangle, that is, the final determined target area has a height of Width is The rectangular area; in the above formula (3):

[0111]

[0112] That is, with elements The corresponding difference term.

[0113] Using the same calculation method, the matrix can be obtained. The element values ​​of each element in the table.

[0114] 4. Determining the target area

[0115] Calculated Then, traverse A matrix is ​​used to find and record the element with the largest value. and the coordinates of that element. .

[0116] Corresponding to the target image, with Centered on the pixel corresponding to the point, with a height of Width is The rectangular frame can be identified as the area with the richest texture. Here... and All of these are distances between two adjacent pixels in the horizontal direction or integer multiples of the distances between two adjacent pixels in the vertical direction in the target image. In specific implementation processes... and Odd numbers can be used in the calculation. and The value is determined by rounding down to the nearest integer.

[0117] For a scheme that uses an exhaustive search method to determine the target region, the computational cost is... However, the computational cost of the target area determination method proposed in this application is... As can be seen, compared with the exhaustive method, the method provided in this application embodiment can significantly reduce the amount of computation and improve the efficiency of target area determination.

[0118] This application can be applied to scenarios where it is necessary to find the rectangular region with the richest texture; for example, finding a tree in a picture with a grassland background; or in augmented reality scenarios, determining the trajectory of a mobile device by identifying the rectangular region with the richest texture in an image taken by the mobile device; that is, the target region determination method provided by this application can quickly find the region with the most information in an image.

[0119] This embodiment also provides an apparatus for determining a target region in an image; please refer to [link to relevant documentation]. Figure 10 The device may specifically include:

[0120] The feature information determination module 1010 is used to acquire a target image, determine multiple feature points in the target image, and the position information of each feature point in the target image;

[0121] The matrix update module 1020 is used to obtain an initialized first matrix, and assign values ​​to the initialized first matrix based on the position information of each feature point in the target image to obtain an updated first matrix; wherein, each element in the initialized first matrix corresponds one-to-one with each pixel in the target image;

[0122] The matrix transformation module 1030 is used to perform an integral difference matrix transformation on the updated first matrix based on preset region parameter information to generate a target matrix.

[0123] The target pixel point determination module 1040 is used to determine target elements from the target matrix and to determine target pixels in the target image that correspond to the target elements;

[0124] The target region determination module 1050 is used to determine a target region in the target image based on the target pixels corresponding to the target element in the target image and the preset region parameter information.

[0125] The feature information determination module 1010 includes:

[0126] The feature point determination module is used to determine multiple feature points in the target image based on the pixel values ​​of each pixel in the target image;

[0127] A pixel matrix generation module is used to generate a pixel matrix corresponding to the target image;

[0128] The first determining module is used to determine the position information of the plurality of feature points in the pixel matrix;

[0129] The second determining module is used to determine the position information of the plurality of feature points in the pixel matrix as the position information of the plurality of feature points in the target image.

[0130] Matrix update module 1020 includes:

[0131] The first traversal module is used to traverse the position information of each feature point in the target image;

[0132] The third determining module is used to determine the feature elements in the initialized first matrix based on the position information of each feature point in the target image;

[0133] The first assignment module is used to set the element value of each feature element to 1 to obtain the updated first matrix.

[0134] The matrix transformation module 1030 includes:

[0135] The integral transformation module is used to perform an integral transformation on the updated first matrix to generate a first transformation matrix.

[0136] The differential transformation module is used to perform a differential transformation on the first transformation matrix based on the preset region parameter information to generate a second transformation matrix;

[0137] The fourth determining module is used to determine the second transformation matrix as the target matrix.

[0138] The integral transform module includes:

[0139] The first acquisition module is used to acquire the initialized first matrix to be transformed, wherein the number of rows of the first matrix to be transformed is the same as the number of rows of the updated first matrix, and the number of columns of the first matrix to be transformed is the same as the number of columns of the updated first matrix.

[0140] The fifth determining module is used to determine each element in the first matrix to be transformed as the first element;

[0141] The sixth determining module is used to determine, for each first element, the first row identifier and the first column identifier of the first element in the first matrix to be transformed;

[0142] The element search module is used to search for a set of elements in the updated first matrix that meet the first preset conditions corresponding to the first element; the row identifier and column identifier of each element in the set of elements that meet the first preset conditions are less than or equal to the first row identifier and the first column identifier, respectively.

[0143] The second assignment module is used to assign values ​​to each first element in the first matrix to be transformed based on the set of elements that meet the first preset conditions corresponding to each first element in the first matrix to be transformed.

[0144] The first transformation matrix determination module is used to determine the first transformation matrix as the first transformation matrix after the first matrix to be transformed has been assigned a value.

[0145] The differential transform module includes:

[0146] The second acquisition module is used to acquire the initialized second matrix to be transformed; the number of rows of the second matrix to be transformed is the same as the number of rows of the first transformation matrix, and the number of columns of the second matrix to be transformed is the same as the number of columns of the first transformation matrix;

[0147] The seventh determining module is used to determine each element in the second matrix to be transformed as the second element;

[0148] The eighth determining module is used to determine, for each second element, the second row identifier and the second column identifier of the second element in the second matrix to be transformed;

[0149] The ninth determining module is used to determine, in the first transformation matrix, the element that meets the second preset condition corresponding to the second element; the row identifier and column identifier of the element that meets the second preset condition are the same as the second row identifier and the second column identifier, respectively;

[0150] The difference term generation module is used to generate a difference term corresponding to the second element based on the preset region parameter information and the element that meets the second preset condition corresponding to the second element.

[0151] The third assignment module is used to assign values ​​to each second element in the second matrix to be transformed based on the difference terms corresponding to each second element in the second matrix to be transformed.

[0152] The second transformation matrix determination module is used to determine the second transformation matrix as the second transformation matrix after the assignment.

[0153] The target pixel determination module 1040 includes:

[0154] The second traversal module is used to traverse each element in the target matrix and obtain the element value of each element;

[0155] The target element determination module is used to determine the element with the largest element value in the target matrix as the target element.

[0156] The tenth determining module is used to determine the target pixel point in the target image corresponding to the target element based on the position information of the target element in the target matrix.

[0157] The preset region parameter information includes region height and region width; the region height is a first unit length, the region width is a second unit length, and the unit length is the distance between two adjacent pixels in the horizontal direction or the distance between two adjacent pixels in the vertical direction in the target image; the target region determination module 1050 includes:

[0158] The region definition module is used to define a region in the target image, centered on the target pixel, with a height of the first number of units and a width of the second number of units.

[0159] The eleventh determination module is used to determine the framed area as the target area.

[0160] The apparatus provided in the above embodiments can execute the methods provided in any embodiment of this application, and has the corresponding functional modules and beneficial effects for executing the method. Technical details not described in detail in the above embodiments can be found in the methods provided in any embodiment of this application.

[0161] This application also provides a computer-readable storage medium storing at least one instruction or at least one program, which is loaded by a processor and executed as any of the methods described in this embodiment.

[0162] This application also provides a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform any of the methods described in this embodiment.

[0163] This embodiment also provides a device, the structural diagram of which can be found in the following figure. Figure 11 The device 1100 can vary significantly in configuration or performance, and may include one or more central processing units (CPUs) 1122 (e.g., one or more processors) and memory 1132, and one or more storage media 1130 (e.g., one or more mass storage devices) for storing applications 1142 or data 1144. The memory 1132 and storage media 1130 may be temporary or persistent storage. The program stored in the storage media 1130 may include one or more modules (not shown), each module including a series of instruction operations on the device. Furthermore, the CPU 1122 may be configured to communicate with the storage media 1130 and execute the series of instruction operations in the storage media 1130 on the device 1100. The device 1100 may also include one or more power supplies 1126, one or more wired or wireless network interfaces 1150, one or more input / output interfaces 1158, and / or one or more operating systems 1141, such as Windows Server. TM Mac OS X TM Unix TMLinux TM FreeBSD TM Etc. Any of the methods described above in this embodiment can be based on... Figure 11 The equipment shown is used for implementation.

[0164] This specification provides the operational steps of the methods described in the embodiments or flowcharts, but more or fewer operational steps may be included based on conventional or non-inventive labor. The steps and order listed in the embodiments are merely one possible execution order among many steps and do not represent the only execution order. In actual system or interrupt product execution, the methods shown in the embodiments or drawings can be executed sequentially or in parallel (e.g., in a parallel processor or multi-threaded processing environment).

[0165] The structure shown in this embodiment is only a partial structure related to the solution of this application and does not constitute a limitation on the device to which the solution of this application is applied. Specific devices may include more or fewer components than shown, or combinations of certain components, or arrangements of different components. It should be understood that the methods, apparatuses, etc., disclosed in this embodiment can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For example, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection between devices or unit modules through some interfaces.

[0166] Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0167] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed in this specification can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of each example have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0168] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for determining a target region in an image, characterized in that, include: Acquire a target image, determine multiple feature points in the target image, and the position information of each feature point in the target image; An initial first matrix is ​​obtained, and values ​​are assigned to the initial first matrix based on the position information of each feature point in the target image to obtain an updated first matrix; wherein, each element in the initial first matrix corresponds one-to-one with each pixel in the target image; Based on preset region parameter information, the updated first matrix is ​​subjected to integral difference matrix transformation to generate the target matrix; Target elements are determined from the target matrix, and target pixels in the target image corresponding to the target elements are determined. Based on the target pixels in the target image corresponding to the target element, and the preset region parameter information, a target region is determined in the target image.

2. The method for determining a target region in an image according to claim 1, characterized in that, The determination of multiple feature points in the target image, and the position information of each feature point in the target image, includes: Based on the pixel values ​​of each pixel in the target image, multiple feature points in the target image are determined; Generate a pixel matrix corresponding to the target image; Determine the position information of the plurality of feature points in the pixel matrix; The position information of the multiple feature points in the pixel matrix is ​​determined as the position information of the multiple feature points in the target image.

3. The method for determining a target region in an image according to claim 1, characterized in that, The value of each element in the initialized first matrix is ​​0; The process of obtaining the initialized first matrix, and assigning values ​​to the initialized first matrix based on the position information of each feature point in the target image to obtain the updated first matrix, includes: Iterate through the position information of each feature point in the target image; Based on the position information of each feature point in the target image, the feature elements in the initialized first matrix are determined; The element values ​​of each feature element are set to 1 to obtain the updated first matrix.

4. The method for determining a target region in an image according to claim 1, characterized in that, The step of performing an integral difference matrix transformation on the updated first matrix based on preset region parameter information to generate the target matrix includes: Perform an integral transformation on the updated first matrix to generate a first transformation matrix; Based on the preset region parameter information, the first transformation matrix is ​​subjected to a differential transformation to generate a second transformation matrix; The second transformation matrix is ​​determined as the target matrix.

5. The method for determining a target region in an image according to claim 4, characterized in that, The step of performing an integral transformation on the updated first matrix to generate the first transformation matrix includes: Obtain the initial first matrix to be transformed, wherein the number of rows of the first matrix to be transformed is the same as the number of rows of the updated first matrix, and the number of columns of the first matrix to be transformed is the same as the number of columns of the updated first matrix; Each element in the first matrix to be transformed is determined to be the first element; For each first element, determine the first row identifier and the first column identifier of the first element in the first matrix to be transformed; In the updated first matrix, find the set of elements that meet the first preset condition corresponding to the first element; the row identifier and column identifier of each element in the set of elements that meet the first preset condition are less than or equal to the first row identifier and the first column identifier, respectively. Each first element in the first matrix to be transformed is assigned a value based on the set of elements that meet the first preset conditions corresponding to each first element in the first matrix to be transformed. The first matrix to be transformed, after being assigned a value, is determined as the first transformation matrix.

6. The method for determining a target region in an image according to claim 4, characterized in that, The step of performing a difference transformation on the first transformation matrix based on the preset region parameter information to generate a second transformation matrix includes: Obtain the initialized second matrix to be transformed; the number of rows of the second matrix to be transformed is the same as the number of rows of the first transformation matrix, and the number of columns of the second matrix to be transformed is the same as the number of columns of the first transformation matrix; Each element in the second matrix to be transformed is determined to be the second element; For each second element, determine the second row identifier and the second column identifier of the second element in the second matrix to be transformed; In the first transformation matrix, determine the element that meets the second preset condition corresponding to the second element; the row identifier and column identifier of the element that meets the second preset condition are the same as the second row identifier and the second column identifier, respectively; Based on the preset region parameter information and the elements that meet the second preset conditions corresponding to the second element, a difference term corresponding to the second element is generated; Based on the difference terms corresponding to each second element in the second matrix to be transformed, assign values ​​to each second element in the second matrix to be transformed; The second matrix to be transformed, after being assigned a value, is determined as the second transformation matrix.

7. The method for determining a target region in an image according to claim 1, characterized in that, The steps of determining the target element from the target matrix and determining the target pixel in the target image corresponding to the target element include: Iterate through each element in the target matrix and obtain the element value of each element; The element with the largest value in the target matrix is ​​determined as the target element; Based on the position information of the target element in the target matrix, the target pixel point in the target image corresponding to the target element is determined.

8. The method for determining a target region in an image according to claim 1, characterized in that, The preset region parameter information includes region height and region width; the region height is a first unit length, the region width is a second unit length, and the unit length is the distance between two adjacent pixels in the horizontal direction or the distance between two adjacent pixels in the vertical direction in the target image; The step of determining the target region in the target image based on the target pixels corresponding to the target element in the target image and the preset region parameter information includes: In the target image, a region with a height of the first number of units and a width of the second number of units is defined with the target pixel as the center. The defined area is designated as the target area.

9. An apparatus for determining a target region in an image, characterized in that, include: The feature information determination module is used to acquire a target image, determine multiple feature points in the target image, and the position information of each feature point in the target image; The matrix update module is used to obtain an initialized first matrix, and assign values ​​to the initialized first matrix based on the position information of each feature point in the target image to obtain an updated first matrix; wherein, each element in the initialized first matrix corresponds one-to-one with each pixel in the target image; The matrix transformation module is used to perform an integral difference matrix transformation on the updated first matrix based on preset region parameter information to generate a target matrix; The target pixel point determination module is used to determine target elements from the target matrix and to determine the target pixels in the target image that correspond to the target elements; The target region determination module is used to determine a target region in the target image based on the target pixels corresponding to the target element in the target image and the preset region parameter information.

10. A device, characterized in that, The device includes a processor and a memory, the memory storing at least one instruction or at least one program, the at least one instruction or the at least one program being loaded and executed by the processor to implement the method for determining a target region in an image as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Method for increasing number of feature points in weak texture region of image

    CN106960451A

  • A moving vehicle detection method based on aerial video of unmanned aerial vehicle

    CN109376641A