Target area determination method, electronic device, chip system and storage medium
By receiving the user's circle selection operation in the circle selection mode of the electronic device and determining the target area, the tracking error problem caused by inaccurate target area in the prior art is solved, and precise tracking is achieved.
Patent Information
- Application Number
- CN202411929796.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-06-06
- Estimated Expiration
- 2044-12-26
AI Technical Summary
When determining the target area, the object that the user wants to track and the object actually tracked by the electronic device in the prior art is inconsistent due to the fixed crop size, resulting in tracking errors.
By receiving the user's circle selection operation in the circle selection mode, the circle selection area in the first image is determined, and the target area is determined for single-target tracking based on the circle selection area and the first image. This method gives instructions that contain both size and position information through circle selection, realizing accurate initialization and precise focus pursuit.
Through this method, the target area can be determined more accurately, tracking errors can be reduced, and precise tracking can be achieved.
Smart Images

Figure CN119364180B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computers, and in particular to a target area determination method, an electronic device, a chip system, and a storage medium. Background Art
[0002] The single target tracking algorithm has been widely used in camera applications of major mobile phone brands. The application scenario of this target tracking algorithm is, for example: after the user selects an object, the electronic device automatically tracks the object and continues to focus on the object during the tracking process.
[0003] The existing method of determining the target area (the area corresponding to the object to be tracked) is usually: after the user clicks on the location of an object on the screen, the electronic device cuts out a fixed-size area centered on the clicked location as the target area for tracking. However, due to the fixed size of the cutout, this determination method will cause the object that the user wants to track to be inconsistent with the object actually tracked by the electronic device, that is, the determined target area is inaccurate, which further leads to tracking errors. Summary of the invention
[0004] The present application provides a target area determination method, electronic device, chip system and storage medium, which can more accurately determine the target area and thus achieve precise tracking.
[0005] In a first aspect, some embodiments of the present application provide a method for determining a target area. The method for determining a target area may include: in a circle selection mode, receiving a circle selection operation input by a user in a camera preview interface; in response to the circle selection operation, determining a circle selection area in a first image, where the first image is an image frame in the camera preview interface during the process in which the circle selection operation acts on the camera preview interface; based on the circle selection area and the first image, determining a target area in the first image, where the target area is used for single target tracking.
[0006] Through the above method, when there is a need for precise focus tracking, instructions containing both size information and position information can be given by circling, so as to achieve the purpose of precise initialization and precise focus tracking, more accurately determine the target, and realize precise tracking.
[0007] In a possible embodiment, determining a circled area in a first image includes: determining a first coordinate in the first image, the first coordinate being the coordinate of a position selected by a user in the first image; determining a second coordinate in a second image, the second image being an image frame other than the first image in a camera preview interface during a circle selection operation on the camera preview interface, and the second coordinate being the coordinate of a position selected by the user in the second image; determining the circled area in the first image based on the first coordinate and the second coordinate.
[0008] Through the above manner, in the circle selection operation, the circled area is accurately determined by the first coordinate and the second coordinate.
[0009] In a possible embodiment, determining the circled area in the first image based on the first coordinate and the second coordinate includes: determining the third coordinate based on the second coordinate, the third coordinate being the coordinate mapping the second coordinate to the coordinate in the first image; and determining the circled area in the first image based on the first coordinate and the three coordinates.
[0010] In the above manner, in the circle selection operation, by mapping the second coordinates in the second image to the first image, the problem of inconsistent coordinates in different images due to different view frames during the circle drawing process is avoided.
[0011] In a possible embodiment, determining the third coordinate based on the second coordinate includes: determining the homography matrix corresponding to the first image and the second image based on the first image and the second image; and determining the third coordinate based on the homography matrix and the second coordinate.
[0012] In the above manner, the third coordinates can be accurately obtained by mapping through the homography matrix between the first image and the second image.
[0013] In a possible embodiment, the first image is the first image frame in the camera preview interface during the process of the circle selection operation being performed on the camera preview interface; determining the circled area in the first image includes: determining a fourth coordinate in the first image, the fourth coordinate being the angular coordinate of the rectangular box in the first image; determining a fifth coordinate in the third image, the third image is the last image frame in the camera preview interface during the process of the circle selection operation being performed on the camera preview interface, and the fifth coordinate is the angular coordinate of the rectangular box in the third image; based on the fourth coordinate and the fifth coordinate, determining the circled area in the first image.
[0014] In the above manner, under the frame-drawing operation, the circled area in the first image can be accurately determined through the first image frame and the last image frame.
[0015] In a possible embodiment, determining the circled area in the first image based on the fourth coordinate and the fifth coordinate includes: determining the sixth coordinate based on the fifth coordinate, the sixth coordinate being the coordinate mapping the fifth coordinate to the coordinate in the first image; and determining the circled area in the first image based on the fourth coordinate and the sixth coordinate.
[0016] In the above manner, in the circle selection operation, by mapping the fifth coordinate in the third image to the first image, the problem of inconsistent coordinates in different images due to different view frames during the frame selection process is avoided.
[0017] In a possible embodiment, determining a target area based on a selected area and a first image includes: compressing the resolution of the first image; changing the resolution of the selected area to be the same as the resolution of the compressed first image; and inputting the selected area with changed resolution and the compressed first image into a segmentation model to obtain the target area.
[0018] In a second aspect, the present application provides a target area determination device, which may be an electronic device, or a device in an electronic device, or a device that can be used in combination with an electronic device; wherein the target area determination device may also be a chip system, and the target area determination device may execute the method executed by the electronic device in the first aspect. The functions of the target area determination device may be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more units corresponding to the above functions. The unit may be software and / or hardware. The operations and beneficial effects performed by the target area determination device may refer to the methods and beneficial effects described in the first aspect above, and the repeated parts will not be repeated.
[0019] In a third aspect, the present application provides an electronic device, comprising one or more processors and one or more memories. The one or more memories are coupled to the one or more processors, and the one or more memories are used to store computer program codes, and the computer program codes include computer instructions, and when the one or more processors execute the computer instructions, the electronic device executes the target area determination method in any possible implementation of the first aspect.
[0020] In a fourth aspect, the present application provides a chip system, which includes a processor and an interface, and the processor and the interface are coupled; the interface is used to receive or output signals, and the processor is used to execute code instructions to execute the target area determination method in any possible implementation of the first aspect above.
[0021] In a fifth aspect, the present application provides a computer-readable storage medium storing a computer program / instructions. When the computer program product runs on a computer, the computer executes the target area determination method in any possible implementation of the first aspect.
[0022] In a sixth aspect, the present application provides a computer program product, which, when executed on a computer, enables the computer to execute the target area determination method in any possible implementation of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 A schematic diagram of a circled interface provided in an embodiment of the present application;
[0024] Figure 2 A flowchart of a method for determining a target area provided in an embodiment of the present application;
[0025] Figure 3A A schematic diagram of an interface for entering a circle selection mode provided in an embodiment of the present application;
[0026] Figure 3B A schematic diagram of another interface in a circle selection mode provided in an embodiment of the present application;
[0027] Figure 3C A schematic diagram of an interface in another circle selection mode provided in an embodiment of the present application;
[0028] Figure 3D A schematic diagram of an interface in another circle selection mode provided in an embodiment of the present application;
[0029] Figure 4 A schematic diagram of a flow chart of another target area determination method provided in an embodiment of the present application;
[0030] Figure 5 A flowchart of another target area determination method provided in an embodiment of the present application;
[0031] Figure 6 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;
[0032] Figure 7 A schematic diagram of the software structure of an electronic device provided in an embodiment of the present application;
[0033] Figure 8 A flowchart of another target area determination method provided in an embodiment of the present application;
[0034] Fig. 9 A schematic diagram of the structure of a target area determination device provided in an embodiment of the present application;
[0035] Fig.10 A schematic diagram of the structure of a chip provided in an embodiment of the present application. DETAILED DESCRIPTION
[0036] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in the text is only a description of the association relationship of the associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.
[0037] It should be understood that the terms "first", "second", etc. in the specification, claims and drawings of the present application are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products or devices.
[0038] Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described in this application may be combined with other embodiments.
[0039] In order to better understand the process grouping method provided by this application, the professional terms involved in this application are introduced below:
[0040] Single target tracking: Single target tracking is a computer vision technology that allows an initial area to be selected in a video, and the initial area can be tracked in all subsequent frames of the video. This single target tracking is now widely used in camera applications of major mobile phone brands. However, the method used by existing electronic devices (such as mobile phones) to determine the target area (the area corresponding to the object to be tracked) is usually: after the user clicks on the location of an object on the screen, the electronic device uses the clicked location as the center and crops a fixed-size area as the target area for tracking. However, this determination method, due to reasons such as the fixed size of the crop, will cause the object the user wants to track and the object actually tracked by the electronic device to be inconsistent, that is, the determined target area is inaccurate, which further leads to tracking errors.
[0041] For example, Figure 1 As shown, in the preview interface of the camera, the user clicks on the vase in the picture with his finger, and the electronic device responds to the click operation and generates a target area 102 based on the position 101 clicked by the user according to a preset size (for example, 15 cm*20 cm). Figure 1 As can be seen from the right figure, the target area 102 includes not only the vase but also the kettle, that is, the target area 102 contains two objects. When a single target is subsequently tracked based on the target area 102, the electronic device may determine the kettle as the target to be tracked, which is inconsistent with the target that the user actually wants to track, thereby causing a tracking error.
[0042] In order to avoid the above-mentioned problems, the present application provides a target area determination method, which allows the user to independently circle the object to be tracked. For example, the user can circle the target area on the screen of the electronic device with his finger to provide more precise instructions, so that the electronic device can understand the user's intention more accurately. In other words, the object actually tracked by the electronic device and the object that the user device wants to track are more consistent, thereby achieving more accurate target determination and precise tracking.
[0043] Combine the following Figure 2 This paper introduces the target area determination method provided by this application. Figure 2 As shown, Figure 2 A flowchart of a target area determination method provided in an embodiment of the present application is provided. The target area determination method includes the following steps 201 to 203. Figure 2 The method shown may be performed by an electronic device. Figure 2 The execution subject of the method shown may be a chip or a chip system in an electronic device, which is not limited in the embodiments of the present application. Figure 2 The following is an example of an electronic device being used as the execution subject of the method.
[0044] 201. The electronic device receives a circle selection operation input by a user on a camera preview interface in a circle selection mode.
[0045] Optionally, the circle selection mode is a mode in the camera of the electronic device. In the circle selection mode, the electronic device can recognize and receive the user's circle selection operation. In other words, the user can circle the object he wants to track in the circle selection mode.
[0046] In a possible embodiment, the electronic device may enter the circle selection mode in the following manner: the electronic device receives an operation to pull up a menu option; the electronic device displays an icon corresponding to the circle selection mode in the menu option; and the electronic device enters the circle selection mode in response to the operation of clicking the icon corresponding to the circle selection mode.
[0047] For example, Figure 3A As shown, after the user clicks the button corresponding to the pull-up menu option, the electronic device displays the menu option, which includes an icon 301 corresponding to the circle selection mode. After the user clicks the icon 301 corresponding to the circle selection mode, the electronic device enters the circle selection mode. Subsequent user operations on the screen can be identified as circle selection related operations (for example, the user uses the knuckles to draw a circle around an object).
[0048] Optionally, the electronic device may enter the circle selection mode in the following manner: the electronic device enters the circle selection mode in response to clicking a switch button corresponding to the circle selection mode. The switch button corresponding to the circle selection mode may be a button located on the camera preview interface.
[0049] It should be noted that this application does not limit the method of entering the circle selection mode.
[0050] Optionally, the camera preview interface displays a picture captured by the camera, and the circle selection operation may be, but is not limited to, the following operations: a circle drawing operation and a frame dragging operation.
[0051] Optionally, the circle drawing operation may be an operation in which the user draws a circle around an object using a finger joint, and the frame drawing operation may be an operation in which the user draws a frame along a diagonal line of a rectangle.
[0052] 202. The electronic device determines a circled area in a first image in response to a circle selection operation, where the first image is an image frame in a camera preview interface during a process in which the circle selection operation is performed on the camera preview interface.
[0053] Optionally, the circled area is a closed and connected area.
[0054] Optionally, the first image includes only one closed and connected region.
[0055] Optionally, the first image may be the first image frame in the camera preview interface during the process of the circle selection operation being applied to the camera preview interface. The first image frame may be understood as the image at the moment when the user's knuckle touches the screen in the circle selection mode.
[0056] Due to the different circle selection operations, the subsequent methods for determining the circled area are also different. It should be noted that the present application is not limited to the following two circle selection operations. The following is an introduction to the methods for determining the circled area in the first image under the two circle selection operations provided by the present application. Among them:
[0057] (1) Determine the circled area in the first image under the circle operation.
[0058] In a possible embodiment, an electronic device determines a circled area in a first image, including: the electronic device determines a first coordinate in the first image, the first coordinate being the coordinate of a position selected by a user in the first image; determining a second coordinate in a second image, the second image being an image frame other than the first image in a camera preview interface during a circle selection operation on the camera preview interface, and the second coordinate being the coordinate of a position selected by the user in the second image; and determining the circled area in the first image based on the first coordinate and the second coordinate.
[0059] Optionally, if the circling operation is performed on the camera preview interface, the camera preview interface includes ten image frames, and if the first image is the first image frame of the ten image frames, the second image may be the second image frame, or the third image frame, etc.
[0060] Optionally, the images in the first image and the second image may be the same or different. The first image and the second image may be different in the following cases: there is a moving object in the first image, and since the first image and the second image are images of the preview interface at different times, the state and position of the moving object in the first image are different from the state and position of the moving object in the second image. Or the viewfinder of the first image and the viewfinder of the second image are different, and the difference in the viewfinder may be caused by hand shaking of the user.
[0061] For example, the first coordinate and the second coordinate are further described in different scenes of the viewfinder. Figure 3B As shown, assuming Figure 3B 3-3 is the first image. Figure 3B 3-4 is the second image. Position 302 indicates the position clicked by the user in the first image 3-3, and the coordinates of the position 302 are the first coordinates. Position 303 indicates the position clicked by the user in the second image 3-4, and the coordinates of the position 303 are the second coordinates.
[0062] Through the above Figure 3B It can be seen that during the actual circle drawing process, the preview image is not static due to different view frames caused by user hand shaking or the presence of moving objects. In other words, the image of each frame in the circle drawing process is different. Even if it is the same position, the corresponding coordinates in different image frames may be different. For example Figure 3B In the figure, the coordinates of the position 302 on the left flower in the first image 3-3 and the coordinates corresponding to the position on the left flower in the second image 3-4 are obviously different.
[0063] Therefore, in order to avoid the problem of inconsistent coordinates of different image frames, the present application proposes that the coordinates of points in other frames can be uniformly mapped to a certain image frame.
[0064] In a possible embodiment, the electronic device determines the circled area in the first image based on the first coordinate and the second coordinate, including: the electronic device determines the third coordinate based on the second coordinate, the third coordinate being the coordinate mapping the second coordinate to the coordinate in the first image; and determines the circled area in the first image based on the first coordinate and the third coordinate.
[0065] Optionally, since the second image and the first image may be the same, when the second image and the first image are the same, the second coordinate and the third coordinate are also the same.
[0066] Optionally, in most cases, the second image and the first image are different due to problems such as different viewfinders. In this case, the coordinates of the same position in the second image are different from those in the first image, that is, the second coordinates and the third coordinates are different.
[0067] For example, Figure 3C As shown, Figure 3C 30 is a first image 30, which is the first image frame in the camera preview interface during the process of the circle selection operation being performed on the camera preview interface. Figure 3C The second frame image 31 is the second image frame in the camera preview interface during the process of the circle selection operation being performed on the camera preview interface. Figure 3C The third frame image 32 in the figure is the third image frame in the camera preview interface during the process of the circle selection operation acting on the camera preview interface. The second frame image 31 and the third frame image 32 can both be referred to as second images.
[0068] At a first moment, the user clicks on point 304 on the screen, and the electronic device obtains the coordinates of point 304 in the first image, assuming that the coordinates are (x0, y0).
[0069] At the second moment, the finger of the user sliding on the screen stops at point 311 in the second frame image 31. Assuming that the coordinates of point 311 are (x1, y1), the coordinates of point 311 can be called the second coordinates. Figure 3C It can be seen that compared with the first image 30, the second frame image 31 is tilted to the left. Therefore, in order to more accurately determine the circled area later, the point 311 in the second frame image 31 is mapped to the first image 30 to obtain the mapped point 312. Assume that the coordinates of the point 312 are (x2, y2).
[0070] At the third moment, the finger of the user sliding on the screen stops at point 321 in the third frame image 32. Assuming that the coordinates of point 321 are (x3, y3), the coordinates of point 321 can be called the second coordinates. Figure 3C It can be seen that compared with the first image 30, the third frame image 32 is tilted to the right. Therefore, in order to more accurately determine the circled area later, the point 321 in the third frame image 32 is mapped to the first image 30 to obtain the mapped point 322. Assume that the coordinates of the point 322 are (x4, y4).
[0071] By analogy, until the user's finger leaves the screen, or the electronic device determines that the points can be combined into a closed connected figure, the points mapped in the first image 30 are connected together to obtain a circled area 33. The circled area 33 can also be called a circled selection box.
[0072] In a possible embodiment, the electronic device determines the third coordinate based on the second coordinate, including: the electronic device determines the homography matrix corresponding to the first image and the second image based on the first image and the second image; the electronic device determines the third coordinate based on the homography matrix and the second coordinate.
[0073] Optionally, the electronic device determines the homography matrix corresponding to the first image and the second image based on the first image and the second image, including: the electronic device extracts the first key point in the first image; the electronic device extracts the second key point in the second image; and matches the first key point and the second key point to obtain the homography matrix.
[0074] Optionally, the electronic device may use algorithms such as SIFT, SURF, or ORB to obtain key points (and / or feature descriptors) in the first image.
[0075] Optionally, the electronic device matches the first key point with the second key point by: using brute force matching or FLANN algorithm to match the key points, and filtering out false matches through bidirectional matching and nearest neighbor distance ratio test.
[0076] Optionally, a RANSAC algorithm is used for matching the filtered key points to determine a homography matrix, which is used to describe the perspective transformation relationship between the two images.
[0077] Optionally, in the method (1), the first image may be the first image frame, the first image may be the last image frame, or the first image may be an image frame in the middle. In other words, the coordinates of other images may be mapped to the first image frame, the coordinates of other images may be mapped to the last image frame, or the coordinates of other images may be mapped to an image frame in the middle.
[0078] (2) Determine the circled area in the first image by dragging a frame.
[0079] In a possible embodiment, the first image is the first image frame in the camera preview interface during the process of the circling operation being applied to the camera preview interface; the electronic device determines the circled area in the first image, including: the electronic device determines a fourth coordinate in the first image, the fourth coordinate is the angular coordinate of a rectangular box in the first image; the electronic device determines a fifth coordinate in the third image, the third image is the last image frame in the camera preview interface during the process of the circling operation being applied to the camera preview interface, and the fifth coordinate is the angular coordinate of the rectangular box in the third image; the electronic device determines the circled area in the first image based on the fourth coordinate and the fifth coordinate.
[0080] Optionally, the fourth coordinate may be the angular coordinates of four corners of the rectangular frame in the first image, or may be the angular coordinates of two opposite corners of the rectangle in the first image.
[0081] Optionally, the fifth coordinate may be the angular coordinates of four corners of the rectangular frame in the third image, or may be the angular coordinates of two opposite corners of the rectangle in the third image.
[0082] Optionally, if the fourth coordinate is the angular coordinate of the four corners of the rectangular frame in the first image, the fifth coordinate is the angular coordinate of the four corners of the rectangular frame in the third image. If the fourth coordinate is the angular coordinate of the two corners of the rectangle, the fifth coordinate is the angular coordinate of the two corners of the rectangle in the third image.
[0083] For example, Figure 3D As shown, Figure 3D The image on the left is the first image, and the image on the right is the third image. The fourth coordinates are the coordinates of point 341 and point 342 in the first image. The user enlarges the rectangle along the diagonal line of the rectangle to the rectangle in the third image on the right, and the fifth coordinates are the coordinates of point 343 and point 344 in the third image. Based on the coordinates of point 341, point 342, point 343, and point 344, the circled area in the first image is determined.
[0084] Through the above Figure 3D It can be seen that in the actual frame-drawing process of the user, the preview image is not static due to different frame-drawing caused by user hand shaking or the presence of moving objects. That is to say, the frame-drawing of the first image frame and the last image frame in the frame-drawing process are different, and the position of the object in these two image frames may also be different. In order to avoid the problem of inconsistent coordinates of different image frames, the present application proposes that the coordinates of the points in the last image frame can be mapped to the first image frame.
[0085] In a possible embodiment, the electronic device determines the circled area in the first image based on the fourth coordinate and the fifth coordinate, including: the electronic device determines the sixth coordinate based on the fifth coordinate, the sixth coordinate being the coordinate mapping the fifth coordinate to the first image; the electronic device determines the circled area in the first image based on the fourth coordinate and the sixth coordinate.
[0086] In a possible embodiment, the electronic device determines the sixth coordinate based on the fifth coordinate, including: the electronic device determines the homography matrix corresponding to the first image and the third image based on the first image and the third image; the electronic device determines the sixth coordinate based on the homography matrix and the fifth coordinate.
[0087] Optionally, the electronic device determines the homography matrix corresponding to the first image and the third image based on the first image and the third image, including: the electronic device extracts the third key point in the first image; the electronic device extracts the fourth key point in the third image; and matches the third key point with the fourth key point to obtain the homography matrix.
[0088] Optionally, the electronic device may use algorithms such as SIFT, SURF, or ORB to obtain key points in the first image and key points (and / or feature descriptors) in the third image.
[0089] Optionally, the electronic device matches the third key point with the fourth key point by using brute force matching or FLANN algorithm to match the key points, and filtering out false matches through bidirectional matching and nearest neighbor distance ratio test.
[0090] Optionally, a RANSAC algorithm is used for matching the filtered key points to determine a homography matrix, which is used to describe the perspective transformation relationship between the two images.
[0091] Optionally, the electronic device determines the circled area in the first image based on the fourth coordinate and the fifth coordinate, including: the electronic device determines the seventh coordinate based on the fourth coordinate, the seventh coordinate being the coordinate mapping the fourth coordinate to the coordinate in the third image; the electronic device determines the circled area in the third image based on the seventh coordinate and the sixth coordinate.
[0092] In a possible embodiment, in the first image frame, there may be only one point, which is the point when the user just touches the screen. Figure 3D In the first image, there may be only point 341. At this time, the fourth coordinate may only have the coordinate of point 341.
[0093] 203. The electronic device determines a target area in the first image based on the circled area and the first image, where the target area is used for single target tracking.
[0094] Optionally, the target area is a more precisely circled area. Since the operation accuracy of the hand is limited, after obtaining the circled area, it is necessary to refine the circled area to obtain the target area. It can be understood that the target area is more in line with the object to be tracked. In other words, the shape, size, and dimensions of the target area are closer to the object to be tracked.
[0095] The following is an introduction on how to process the selected area precisely:
[0096] In a possible embodiment, the electronic device determines a target area based on a selected area and a first image, including: the electronic device compresses the resolution of the first image; the electronic device changes the resolution of the selected area to be the same as the resolution of the compressed first image; and the electronic device inputs the selected area with changed resolution and the compressed first image into a segmentation model to obtain the target area.
[0097] Optionally, when inputting the segmentation model, the resolution of the first image is usually compressed in order to enable the model to process data faster. Through the above step 201, a circled area can be obtained, and in order to supplement the high-resolution information of the key position, the resolution of the circled area is changed to the same as the resolution of the compressed first image.
[0098] Optionally, the changed resolution of the selected area may be greater than the original resolution of the selected area, or may be smaller than the original resolution of the selected area.
[0099] In a possible embodiment, the electronic device inputs the selected area with changed resolution and the compressed first image into a segmentation model to obtain a target area, including: inputting a segmentation model based on coordinates corresponding to the first image and the selected area to obtain the target area.
[0100] Optional, such as Figure 4 As shown in the figure, the encoder extracts the image features in the original image (first image) and the circled area. Then the electronic device performs positional encoding on the coordinate sequence of the circled area to obtain a positional encoding vector. The positional encoding vector is fused with the image features, and finally the segmented Mask is obtained by the decoder, and the bounding rectangle is calculated from the Mask. The bounding rectangle is the target area of the single target tracking model.
[0101] Optionally, the position coding may use sine and cosine function coding methods to convert the coordinate sequence into a position coding vector.
[0102] Combine the following Figure 5 The whole process of the target area determination method is further introduced below. Figure 5 :
[0103] First, the user selects the circle selection precision tracking mode. The selection method of the circle selection precision tracking mode can be seen above. Figure 3A Optionally, when the user does not select the circle selection precise tracking mode, the user can also use the existing method of determining the target area (cropping to a fixed size).
[0104] When the user circles a target on the screen, the electronic device needs to save the first image, that is, the electronic device saves the first frame image for subsequent mapping.
[0105] During the user's selection process, the electronic device determines the coordinates of the selection. If it is (1) a selection operation, the coordinates in each frame image (the second image) need to be input into the registration module. If it is (2) a frame selection operation, only the coordinates in the last frame image (the third image) need to be input into the registration module.
[0106] The coordinates in the second image / third image are mapped to the first image through the registration module. For details, please refer to the above introduction, and this application will not elaborate on it here.
[0107] Determine the circled area in the first image, and then input the first image and the circled area into the segmentation model to obtain the target area. This process can be referred to the introduction in the above step 202, and this application will not repeat it here.
[0108] The target area is input into the single target tracking module for single target tracking.
[0109] Through the above method, when there is a need for precise focus tracking, an indication containing both size information and position information can be given by circling or drawing a rectangular frame, thereby achieving the purpose of precise initialization and precise focus tracking.
[0110] The following is an introduction to the hardware structure of electronic equipment:
[0111] See also Figure 6 , Figure 6 1 is a schematic diagram of the hardware structure of the electronic device 100 provided in the embodiment of the present application. The electronic device 100 may be an electronic device corresponding to the training phase, or may be an electronic device corresponding to the application phase.
[0112] The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0113] It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or separate some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0114] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0115] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
[0116] A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. Repeated access is avoided, the waiting time of the processor 110 is reduced, and the efficiency of the system is improved. The processor 110 calls the instructions or data stored in the memory, so that the electronic device 100 executes the shooting method executed by the electronic device in the following method embodiment.
[0117] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0118] The charging management module 140 is used to receive charging input from a charger, where the charger can be a wireless charger or a wired charger.
[0119] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 to power the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, and the wireless communication module 160. In some other embodiments, the power management module 141 can also be set in the processor 110.
[0120] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0121] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0122] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.
[0123] The modulation and demodulation processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After being processed by the baseband processor, the low-frequency baseband signal is transmitted to the application processor.
[0124] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as Wi-Fi networks), bluetooth (BT), BLE broadcast, global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and filters it, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0125] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, so that electronic device 100 can communicate with the network and other devices through wireless communication technology.
[0126] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
[0127] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1. The display screen 194 may include an OLED screen.
[0128] Optionally, the display screen 194 may further include: an OLED glass layer, an OLED light-emitting unit, a fingerprint recognition sensor, a microlens array, etc. The display screen 194 supports optical under-screen fingerprint recognition.
[0129] The electronic device 100 can realize the shooting function through the ISP, the camera 193, the video codec, the GPU, the display screen 194 and the application processor. The ISP is used to process the data fed back by the camera 193. The camera 193 is used to capture static images or videos. The camera 193 may include a front camera and a rear camera, the front camera is located in the display area of the screen, and the rear camera is located in the back area of the screen. The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. The video codec is used to compress or decompress digital videos. The electronic device 100 may support one or more video codecs.
[0130] NPU is a neural-network (NN) computing processor. It draws on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, to quickly process input information and can also continuously self-learn.
[0131] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 via the external memory interface 120 to implement a data storage function.
[0132] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function), etc. The data storage area may store data (such as audio data) created during the use of the electronic device 100, etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as a flash memory device, etc.
[0133] The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0134] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110.
[0135] Speaker 170A, also known as "speaker", is used to convert audio electrical signals into sound signals. Receiver 170B, also known as "earpiece", is used to convert audio electrical signals into sound signals. Microphone 170C, also known as "microphone" and "microphone", is used to convert sound signals into electrical signals. Headphone interface 170D is used to connect wired headphones. Pressure sensor 180A is used to sense pressure signals and can convert pressure signals into electrical signals. In some embodiments, pressure sensor 180A can be set on display screen 194. Gyroscope sensor 180B can be used to determine the motion posture of electronic device 100. Air pressure sensor 180C is used to measure air pressure. Magnetic sensor 180D includes Hall sensor. Acceleration sensor 180E can detect the magnitude of acceleration of electronic device 100 in various directions (generally three axes). Distance sensor 180F is used to measure distance. Proximity light sensor 180G can include, for example, light emitting diode (LED) and light detector. Ambient light sensor 180L is used to sense ambient light brightness. Fingerprint sensor 180H is used to collect fingerprints. The temperature sensor 180J is used to detect the temperature. The touch sensor 180K is also called a "touch panel". The touch sensor 180K can be set on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen". The touch sensor 180K is used to detect touch operations acting on or near it. The bone conduction sensor 180M can obtain vibration signals. The buttons 190 include a power button, a volume button, etc. The motor 191 can generate vibration prompts. The indicator 192 can be an indicator light, which can be used to indicate the charging status, power changes, and can also be used to indicate messages, missed calls, notifications, etc. The SIM card interface 195 is used to connect a SIM card.
[0136] In addition, an operating system is running on the above components. For example, operating systems such as iOS and Android. The operating system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system of the layered architecture as an example to illustrate the software structure of the electronic device 100. It should be noted that although the embodiment of the present application is described by taking the Android system as an example, its basic principles are also applicable to electronic devices of other operating systems.
[0137] The software structure of the electronic device 100 is introduced below:
[0138] Figure 7A schematic diagram of the software structure of an electronic device 100 provided in an embodiment of the present application. The software structure adopts a layered architecture, which divides the software into several layers, and each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In an embodiment of the present application, the operating system (taking the Android system, the Android system running on the AP as an example) can be divided into 4 layers, from top to bottom, respectively, the application layer (application, APP), the application framework layer (framework, FWK), the hardware abstraction layer (hardware abstraction layer, HAL) and the kernel layer (Kernal).
[0139] The application layer may include a series of application packages. Figure 7 As shown, the application package may include applications such as a camera and a gallery. In the embodiment of the present application, the camera refers to a camera application. The camera application may include a camera interface module (which may be called CameraApi2Module), etc. The gallery refers to a gallery application, which is used to store images and videos taken by an electronic device. The gallery application is also used to provide a playback function for users, and users can watch historically taken images and videos in the gallery application.
[0140] The application framework layer provides application developers with an application programming interface (API) framework and various services and management tools for accessing core functions, including interface management, data access, application layer messaging, application package management, phone management, location management, etc. The application framework layer includes some predefined functions. Figure 7 As shown, the application framework layer may include but is not limited to a camera service CameraService and a display framework.
[0141] The camera service CameraServicee is responsible for the startup process scheduling of the camera application, the creation and management of processes, the creation and management of windows, etc.
[0142] The hardware abstraction layer is an interface layer between the operating system kernel and the hardware circuit. Its purpose is to abstract the hardware. It hides the hardware interface details of a specific platform and can provide a virtual hardware platform for the operating system. Figure 7 As shown, the hardware abstraction layer may include a segmentation model, a registration module, and a single target tracking module.
[0143] The kernel layer is responsible for managing the system's hardware resources and providing necessary services to applications. The kernel layer includes drivers for various hardware devices, which are responsible for controlling and operating the hardware devices. Figure 7 As shown, the kernel layer includes: camera driver, display driver, etc.
[0144] The camera driver is responsible for managing the core components of the mobile phone camera.
[0145] The display driver is the core component responsible for managing the mobile phone screen display. The display driver is responsible for receiving image data from the processor and converting this image data into a model output that the screen can recognize.
[0146] Based on the above software structure, the interaction between the various modules of the target area determination method provided in the embodiment of the present application is further introduced. Figure 8 The process of the target area determination method based on software architecture is introduced.
[0147] 801. In the circle selection mode, the touch screen driver determines coordinate A in image A.
[0148] The image A is the first image frame in the camera preview interface during the process of the circle selection operation being performed on the camera preview interface.
[0149] Optionally, the image A may be the first image mentioned above, and the coordinate A may be the first coordinate mentioned above.
[0150] Optionally, before or after sending the coordinate A, the camera driver sends the image A to the camera, and the camera sends the image A to the registration module. Furthermore, the camera sends the image A to the segmentation model.
[0151] After the touch screen driver determines the coordinate A in the image A, the touch screen driver sends the coordinate A to the registration module. Correspondingly, the registration module receives the coordinate A sent by the touch screen driver.
[0152] 802. In the circle selection mode, the touch screen driver determines coordinate B in image B.
[0153] Optionally, the image B is an image frame in the camera preview interface during the process of the circle selection operation being performed on the camera preview interface.
[0154] Alternatively, the image B is the last image frame in the camera preview interface during the process in which the circle selection operation is performed on the camera preview interface.
[0155] After the touch screen driver determines the coordinate B in the image B, the touch screen driver sends the coordinate B to the registration module. Correspondingly, the registration module receives the coordinate B sent by the touch screen driver.
[0156] 803. The registration module maps coordinate B to image A to obtain coordinate C in image A.
[0157] The image B in the registration module may be sent by the camera, and the image B in the camera may be sent by the camera driver, and the sending process of the image A may be referred to.
[0158] Optionally, the mapping process may refer to the introduction in the above step 201. This application will not elaborate on this process.
[0159] After obtaining the coordinate C in the image A, the registration module sends the coordinate C to the segmentation model, and correspondingly, the segmentation model receives the coordinate C sent by the registration module.
[0160] 804. The segmentation model determines the target area based on the coordinates A and C.
[0161] Optionally, the segmentation model first determines a circled area based on the coordinates A and C, and then determines a target area based on the circled area and the image A sent in advance by the camera.
[0162] Optionally, the method of determining the target area based on the circled area and image A can refer to the introduction in the above step 202, and this application will not elaborate on it here.
[0163] After the segmentation model determines the target area, the target area is sent to the single target tracking module.
[0164] 805. The single target tracking module performs single target tracking.
[0165] Among them, the single target tracking module performs single target tracking on the target area.
[0166] See also Fig. 9 , Fig. 9 A schematic diagram of the structure of a target area determination device 900 provided in an embodiment of the present application. Fig. 9 The target area determination device shown may be an electronic device, or a device in an electronic device, or a device that can be used in conjunction with an electronic device. Fig. 9 The target area determination device shown may include an acquisition unit 901 and a processing unit 902. Among them:
[0167] The acquisition unit 901 is used to receive a circle selection operation input by the user on the camera preview interface in the circle selection mode;
[0168] A processing unit 902 is used to determine a circled area in a first image in response to a circle selection operation, where the first image is an image frame in a camera preview interface during a process in which the circle selection operation is performed on the camera preview interface;
[0169] The processing unit 902 is further configured to determine a target area in the first image based on the circled area and the first image, where the target area is used for single target tracking.
[0170] In a possible implementation, the processing unit 902 is further used to determine a first coordinate in the first image, where the first coordinate is the coordinate of a position selected by the user in the first image; determine a second coordinate in the second image, where the second image is an image frame other than the first image in the camera preview interface during the process of the circling operation being performed on the camera preview interface, and the second coordinate is the coordinate of the position selected by the user in the second image; and determine the circled area in the first image based on the first coordinate and the second coordinate.
[0171] In a possible implementation, the processing unit 902 is further configured to determine a third coordinate based on the second coordinate, where the third coordinate is a coordinate obtained by mapping the second coordinate to the coordinate in the first image; and determine a circled area in the first image based on the first coordinate and the three coordinates.
[0172] In a possible implementation, the processing unit 902 is further configured to determine, based on the first image and the second image, a homography matrix corresponding to the first image and the second image; and determine a third coordinate based on the homography matrix and the second coordinate.
[0173] In a possible implementation, the processing unit 902 is further used to determine a fourth coordinate in the first image, where the fourth coordinate is the angular coordinate of the rectangular box in the first image; determine a fifth coordinate in the third image, where the third image is the last image frame in the camera preview interface during the process in which the circling operation is performed on the camera preview interface, and the fifth coordinate is the angular coordinate of the rectangular box in the third image; and determine the circled area in the first image based on the fourth coordinate and the fifth coordinate.
[0174] In a possible implementation, the processing unit 902 is further configured to determine a sixth coordinate based on the fifth coordinate, where the sixth coordinate is a coordinate obtained by mapping the fifth coordinate to the first image; and determine a circled area in the first image based on the fourth coordinate and the sixth coordinate.
[0175] In a possible implementation, the processing unit 902 is further used to compress the resolution of the first image; change the resolution of the selected area to be the same as the resolution of the compressed first image; and input the selected area with changed resolution and the compressed first image into the segmentation model to obtain the target area.
[0176] For the case where the target region determination device may be a chip or a chip system, see Fig.10 Schematic diagram of the chip structure shown. Fig.10 The chip 1000 shown includes a processor 1001 and an interface 1002. Optionally, it may also include a memory 1003. The number of the processors 1001 may be one or more, and the number of the interfaces 1002 may be multiple.
[0177] For the case where the chip is used to implement the electronic device in the embodiment of the present application:
[0178] The interface 1002 is used to receive or output signals;
[0179] The processor 1001 is used to execute data processing operations of the electronic device.
[0180] 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 aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.
[0181] It is understandable that some optional features in the embodiments of the present application may be implemented independently in certain scenarios without relying on other features, such as the solution on which they are currently based, to solve corresponding technical problems and achieve corresponding effects. They may also be combined with other features according to needs in certain scenarios. Accordingly, the target area determination device provided in the embodiments of the present application may also implement these features or functions accordingly, which will not be elaborated here.
[0182] It should be understood that the processor in the embodiment of the present application can be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method embodiment can be completed by an integrated logic circuit of hardware in the processor or an instruction in the form of software. The above processor can be a general-purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
[0183] It can be understood that the memory in the embodiments of the present application can be a volatile memory or a non-volatile memory, or can 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), or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM bus RAM (DR RAM). It should be noted that the memory of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0184] The present application also provides a computer-readable storage medium, in which a computer program is stored. The computer program includes program instructions. When the program instructions are executed on an electronic device, the functions of any of the above method embodiments are implemented.
[0185] The present application also provides a computer program product. When the computer program product is executed on a computer, the computer can implement the functions of any of the above method embodiments.
[0186] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a digital video disc (DVD)), or a semiconductor medium (eg, a solid state disk (SSD)).
[0187] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present 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 target area, characterized in that: The method comprises: In the circle selection mode, receive the circle selection operation input by the user on the camera preview interface; In response to the circle selection operation, determining a circled area in a first image, the first image being an image frame in the camera preview interface during the process in which the circle selection operation is performed on the camera preview interface; the circled area in the first image is determined by a plurality of coordinates, the plurality of coordinates comprising the coordinates in the first image on which the circle selection operation is performed and the coordinates in the second image or the third image in the camera preview interface mapped to the coordinates in the first image through a homography matrix, the homography matrix being used to describe a perspective transformation relationship between the first image and the second image, or the homography matrix being used to describe a perspective transformation relationship between the first image and the third image, the second image being an image frame in the camera preview interface other than the first image during the process in which the circle selection operation is performed on the camera preview interface, and the third image being the last image frame in the camera preview interface during the process in which the circle selection operation is performed on the camera preview interface; compressing a resolution of the first image; Changing the resolution of the circled area to be the same as the resolution of the compressed first image; The selected area after the resolution is changed and the compressed first image are input into a segmentation model to obtain a target area.
2. The method according to claim 1, characterized in that: The step of determining the circled area in the first image includes: Determine first coordinates in the first image, where the first coordinates are coordinates of a position selected by a user in the first image; Determine second coordinates in a second image, where the second image is an image frame other than the first image in the camera preview interface during the process in which the circle selection operation is performed on the camera preview interface, and the second coordinates are coordinates of a position selected by the user in the second image; Based on the first coordinates and the second coordinates, a circled area in the first image is determined.
3. The method according to claim 2, characterized in that The step of determining the circled area in the first image based on the first coordinate and the second coordinate includes: Based on the second coordinate, determine a third coordinate, where the third coordinate is a coordinate obtained by mapping the second coordinate to the first image; Based on the first coordinate and the three coordinates, a circled area in the first image is determined.
4. The method according to claim 3, characterized in that The determining of the third coordinate based on the second coordinate comprises: Based on the first image and the second image, determining a homography matrix corresponding to the first image and the second image; Based on the homography matrix and the second coordinate, a third coordinate is determined.
5. The method according to claim 1, characterized in that: The first image is the first image frame in the camera preview interface during the process in which the circle selection operation is performed on the camera preview interface; The step of determining the circled area in the first image includes: Determine a fourth coordinate in the first image, where the fourth coordinate is a corner coordinate of a rectangular frame in the first image; Determine a fifth coordinate in a third image, wherein the third image is the last image frame in the camera preview interface during the process in which the circle selection operation is performed on the camera preview interface, and the fifth coordinate is a corner coordinate of a rectangular box in the third image; Based on the fourth coordinate and the fifth coordinate, a circled area in the first image is determined.
6. The method according to claim 5, characterized in that The step of determining the circled area in the first image based on the fourth coordinate and the fifth coordinate includes: Based on the fifth coordinate, determine a sixth coordinate, where the sixth coordinate is a coordinate obtained by mapping the fifth coordinate to the first image; Based on the fourth coordinate and the sixth coordinate, a circled area in the first image is determined.
7. An electronic device, comprising one or more memories and one or more processors, characterized in that: The memory is used to store a computer program; the processor is used to call the computer program so that the electronic device executes the method according to any one of claims 1 to 6.
8. A chip system, applied to electronic equipment, characterized in that: The chip system includes at least one processor and an interface, wherein the interface is used to receive instructions and transmit them to the at least one processor; the at least one processor executes the instructions so that the electronic device executes the method as described in any one of claims 1-6.
9. A computer-readable storage medium having a computer program / instruction stored thereon, characterized in that: When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
A target detection and tracking method based on a plurality of irregular ROI
CN108073930A