Image processing method, device, terminal and medium
By acquiring and filtering the initial corner points of the image in the terminal device, calculating the scaling coefficient and adjusting the image size, the problem of difficult to adjust the image display ratio is solved, and the image display effect and user experience are improved.
Patent Information
- Application Number
- CN202211301775.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-24
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2042-10-24
AI Technical Summary
In the document shooting mode of the terminal device, the image may be too large or too small, making it difficult for users to find the appropriate zoom ratio by manually adjusting, resulting in poor image display effect.
By obtaining multiple initial corner points of the current frame image of the target document, filtering the initial corner points within the preset polygon range to obtain available corner points, calculate the maximum distance in each direction to determine the scaling coefficient, and scale the image when the threshold condition is met.
It realizes dynamic adjustment of image display ratio, improves image display effect, simplifies user operations, and improves user experience.
Smart Images

Figure CN117974429B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and specifically provides an image processing method, device, terminal and medium. Background Art
[0002] With the popularization and development of the Internet, people's functional requirements for terminal devices are becoming more and more diverse. For example, in order to meet the user's need to view documents at any time in the terminal device, many terminal devices can support the document shooting function. For example, users can use the document shooting function to take pictures of documents to achieve functions such as searching for questions online or extracting text from pictures.
[0003] When the terminal device is in document shooting mode, the image it captures may be too large or too small, which is inconsistent with the actual needs of the user. At present, the image size is generally adjusted based on manual adjustment. However, when manually adjusting the image, it brings inconvenience to the user, and it is difficult to find a suitable zoom ratio, and the image display effect is still poor. Summary of the invention
[0004] In order to overcome the above-mentioned defects, the present invention is proposed to provide an image processing method, device, terminal and medium that solve or at least partially solve the technical problems that when manually adjusting the image, it is inconvenient for the user to use, it is difficult to find a suitable scaling ratio, and the image display effect is still poor.
[0005] In a first aspect, the present invention provides an image processing method, the image processing method comprising:
[0006] Obtain multiple initial corner points of the current frame image of the target document;
[0007] Filtering the plurality of initial corner points within a range formed by a preset polygon to obtain a plurality of available corner points of the current frame image; wherein the number of available corner points is the same as the number of corners of the preset polygon;
[0008] Determine a first distance between any two available corner points, and obtain the maximum distance in each direction corresponding to the preset polygon based on all the first distances; wherein each direction corresponding to the preset polygon is determined based on the extension direction of the edge of the preset polygon;
[0009] Determine the scaling factor in each direction according to the maximum distance in each direction;
[0010] If each scaling factor is greater than the corresponding coefficient threshold, the scaling factor of the current frame image is determined according to each scaling factor and its corresponding coefficient threshold, and the current frame image is scaled to obtain a target image.
[0011] Furthermore, in the above-mentioned image processing method, filtering the multiple initial corner points within the range formed by the preset polygon to obtain multiple available corner points of the current frame image includes:
[0012] Performing spatial domain median filtering on the multiple initial corner points within the range formed by the preset polygon to obtain multiple candidate corner points of the current frame image;
[0013] If the number of frames corresponding to the current frame image is greater than or equal to the preset number of frames, and the number of candidate corner points of the current frame image is the number of corners of the preset polygon, determine a second distance between each candidate corner point of the current frame image and a corresponding candidate corner point of the previous frame image;
[0014] If the maximum second distance is less than the preset distance, the candidate corner points of the multiple frame images are median filtered in the time domain within the range formed by the preset polygon to obtain multiple available corner points of the current frame image; wherein the multiple frame images include the current frame image and at least two frames of images before the current frame image.
[0015] Furthermore, the above-mentioned image processing method further includes:
[0016] If each scaling factor is greater than the corresponding factor threshold, the value corresponding to the candidate corner point of the current frame image is updated to the value corresponding to the multiple available corner points of the current frame image.
[0017] Furthermore, in the above-mentioned image processing method, determining the scaling factor of the current frame image according to each scaling factor and its corresponding coefficient threshold, and scaling the current frame image to obtain a target image includes:
[0018] The ratio of each coefficient threshold to the corresponding scaling coefficient is determined, and the minimum ratio is selected as the scaling coefficient of the current frame image, and the current frame image is scaled to obtain a target image.
[0019] Furthermore, the above-mentioned image processing method further includes:
[0020] The scaling factor of the current frame image is stored.
[0021] Furthermore, in the above-mentioned image processing method, obtaining a plurality of initial corner points of the current frame image includes:
[0022] Scaling the current frame image based on a scaling factor corresponding to a previous frame image or a preset scaling factor to obtain a scaled current frame image;
[0023] Based on a preset corner point detection algorithm, multiple initial corner points of the zoomed current frame image are obtained.
[0024] Furthermore, in the above-mentioned image processing method, determining the scaling factor in each direction according to the maximum distance in each direction includes:
[0025] The ratio of the maximum distance to the side length in the corresponding direction is used as the scaling factor in the corresponding direction.
[0026] In a second aspect, the present invention provides an image processing device, comprising a processor and a storage device, wherein the storage device is suitable for storing a plurality of program codes, and the program codes are suitable for being loaded and run by the processor to execute the image processing method according to any one of claims 1 to 7.
[0027] In a third aspect, a terminal is provided, the terminal comprising the image processing device as described above.
[0028] In a fourth aspect, a computer-readable storage medium is provided, wherein a plurality of program codes are stored in the computer-readable storage medium, wherein the program codes are suitable for being loaded and run by a processor to execute the image processing method described in any one of the above technical solutions.
[0029] The above one or more technical solutions of the present invention have at least one or more of the following beneficial effects:
[0030] In the technical solution for implementing the present invention, multiple initial corner points of the current frame image of the target document are obtained, and the multiple initial corner points are filtered within the range formed by the preset polygon to obtain multiple available corner points of the current frame image, and then the first distance between any two available corner points is determined, and based on all the first distances, the maximum distance in each direction corresponding to the preset polygon is obtained; then, based on the maximum distance in each direction, the zoom coefficient in each direction is determined, and when each zoom coefficient is greater than the corresponding coefficient threshold, a zoom coefficient is selected to zoom the current frame image to obtain the target image, thereby realizing dynamic adjustment of the image display ratio of the target document, bringing convenience to the user, and adjusting the image display ratio is more accurate than manual adjustment, thereby improving the image display effect and enhancing the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] The disclosure of the present invention will become more easily understood with reference to the accompanying drawings. It is easy for those skilled in the art to understand that these drawings are only for illustrative purposes and are not intended to limit the scope of protection of the present invention. In addition, similar numbers in the figures are used to represent similar components, among which:
[0032] Figure 1 is a schematic flow chart of main steps of an image processing method according to an embodiment of the present invention;
[0033] Figure 2It is a schematic diagram for determining the backup corner points of the current frame image of the target document;
[0034] Figure 3 It is a schematic diagram for determining available corner points of a current frame image of a target document;
[0035] Figure 4 is a schematic flow chart of main steps of an image processing method according to another embodiment of the present invention;
[0036] Figure 5 yes Figure 2 The image after adaptive adjustment corresponding to part (1);
[0037] Figure 6 is a main structural block diagram of an image processing device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0038] Some embodiments of the present invention are described below with reference to the accompanying drawings. It should be understood by those skilled in the art that these embodiments are only used to explain the technical principles of the present invention and are not intended to limit the protection scope of the present invention.
[0039] In the description of the present invention, "module" and "processor" may include hardware, software or a combination of the two. A module may include hardware circuits, various suitable sensors, communication ports, and memories, and may also include software parts, such as program codes, or a combination of software and hardware. The processor may be a central processing unit, a microprocessor, an image processor, a digital signal processor, or any other suitable processor. The processor has data and / or signal processing functions. The processor may be implemented in software, hardware, or a combination of the two. Non-temporary computer-readable storage media include any suitable medium that can store program codes, such as a magnetic disk, a hard disk, an optical disk, a flash memory, a read-only memory, a random access memory, and the like. The term "A and / or B" means all possible combinations of A and B, such as only A, only B, or A and B. The term "at least one A or B" or "at least one of A and B" has a similar meaning to "A and / or B", and may include only A, only B, or A and B. The singular terms "one" and "the" may also include plural forms.
[0040] When the terminal device is in document shooting mode, the image it captures may be too large or too small, which is inconsistent with the actual needs of the user. At present, the image size is generally adjusted based on manual adjustment. However, when manually adjusting the image, it brings inconvenience to the user, and it is difficult to find a suitable zoom ratio, and the image display effect is still poor.
[0041] Therefore, in order to solve the above technical problems, the present invention provides the following technical solutions:
[0042] See attached Figure 1 , Figure 1 FIG. 1 is a flow chart of the main steps of an image processing method according to an embodiment of the present invention. Figure 1 As shown, the control method of the smart home device in the embodiment of the present invention mainly includes the following steps 101 to 105.
[0043] Step 101, obtaining a plurality of initial corner points of a current frame image of a target document;
[0044] In a specific implementation process, after the camera of the terminal device enters the document mode, a sequence of frame images (0th, 1st, 2nd...N-1st, Nth, N+1st...frame images) of the target document can be obtained frame by frame. After obtaining the current frame image, multiple initial corner points of the current frame image can be obtained.
[0045] Specifically, the current frame image can be scaled based on the scaling factor corresponding to the previous frame image or the preset scaling factor to obtain the scaled current frame image, and multiple initial corner points of the scaled current frame image can be obtained based on the preset corner point detection algorithm. Among them, the scaling factor corresponding to the previous frame image is the coefficient used to scale the previous frame image. The preset scaling factor can be set manually, and usually, it can be 1, that is, the image is not scaled. The preset corner point detection algorithm can refer to the existing related technology to select the required method, and this embodiment does not make specific restrictions.
[0046] Step 102: Filter the multiple initial corner points within the range formed by the preset polygon to obtain multiple available corner points of the current frame image;
[0047] In a specific implementation process, a range formed by a preset polygon can be selected in the current frame image, and multiple initial corner points in the range can be filtered to obtain multiple available corner points of the current frame image. The number of available corner points is the same as the number of corners of the preset polygon. For example, the preset polygon can be a square, and the number of available corner points is 4.
[0048] Specifically, the implementation step can be implemented according to the following steps:
[0049] a. performing spatial domain median filtering on the multiple initial corner points within the range formed by the preset polygon to obtain multiple candidate corner points of the current frame image;
[0050] Figure 2 It is a schematic diagram for determining the backup corner points of the current frame image of the target document. Figure 2 Take the preset polygon as a square as an example. The current frame image has 4 spare corner points, which are respectively recorded as An, Bn, Cn, and Dn. Figure 2 Middle (2) part. Figure 2 Part (1) shows the four initial corner points An0, An1, An2 and An3 corresponding to the first backup corner point An of the current frame image. After the four initial corner points An0, An1, An2 and An3 are subjected to median filtering in the spatial domain, the first backup corner point An can be obtained. Similarly, the other backup corner points Bn, Cn and Dn can be obtained, which will not be listed one by one here. Figure 2 The middle boxes in parts (1) and (2) represent images, and the outer boxes represent preset squares.
[0051] b. If the number of frames corresponding to the current frame image is greater than or equal to the preset number of frames, and the number of candidate corner points of the current frame image is the number of corners of the preset polygon, determine a second distance between each candidate corner point of the current frame image and the corresponding candidate corner point of the previous frame image;
[0052] In a specific implementation process, the number of multiple candidate corner points of the current frame image may not actually be consistent with the number of corners of the preset polygon. Therefore, it is necessary to detect whether the number of multiple candidate corner points of the current frame image is equal to the number of corners of the preset polygon. In addition, when performing median filtering in the time domain, at least 3 frames of images are usually required. Therefore, it is also necessary to detect whether the number of frames corresponding to the current frame image is greater than or equal to the preset number of frames, where the preset number of frames may be greater than or equal to 3. Only when the number of frames corresponding to the current frame image is greater than or equal to the preset number of frames and the number of candidate corner points of the current frame image is the number of corners of the preset polygon, multiple available corner points of the current frame image can be further obtained.
[0053] Specifically, if the number of frames corresponding to the current frame image is greater than or equal to the preset number of frames, and the number of candidate corner points of the current frame image is the number of corners of the preset polygon, a second distance between each candidate corner point of the current frame image and the corresponding candidate corner point of the previous frame image may be determined;
[0054] For example, the candidate corner points of the previous frame image may be An-1, Bn-1, Cn-1, and Dn-1, then the second distance between each candidate corner point of the current frame image and the corresponding candidate corner point of the previous frame image may be recorded as |An An-1|, |BnBn-1|, |Cn Cn-1|, and |Dn Dn-1|.
[0055] It should be noted that if the frame number corresponding to the current frame image is less than the preset frame number, or the number of candidate corner points of the current frame image is not the number of corners of the preset polygon, the process may return to step 101 .
[0056] c. If the largest second distance is smaller than the preset distance, median filtering is performed in the time domain on the candidate corner points of the multiple frame images within the range formed by the preset polygon to obtain multiple available corner points of the current frame image.
[0057] In a specific implementation process, the maximum value among |An An-1|, |Bn Bn-1|, |Cn Cn-1|, and |Dn Dn-1| can be calculated and recorded as the maximum second distance maxDis, and then it is determined whether the maximum second distance maxDis is less than the preset distance TreDis. If the maximum second distance maxDis is less than the preset distance TreDis, the candidate corner points of the multiple frame images are subjected to time domain median filtering within the range formed by the preset polygon to obtain multiple available corner points of the current frame image. The multiple frame images include the current frame image and at least two frames of images before the current frame image.
[0058] Figure 3 is a schematic diagram for determining the available corner points of the current frame image of the target document. Figure 3 As shown, Figure 3 In part (1), the three backup corner points An-2, An-1, and An from the N-2th frame to the Nth frame are subjected to time domain median filtering, and we can obtain Figure 3 The first available corner point Ao in part (2) of the figure. Similarly, we can get Figure 3 Other available corner points in part (2) are Bo, Co, and Do.
[0059] It should be noted that if the maximum second distance is greater than or equal to the preset distance, the process may return to step 101 .
[0060] Step 103: determine the first distance between any two available corner points, and obtain the maximum distance in each direction corresponding to the preset polygon based on all the first distances;
[0061] In a specific implementation process, the first distance between any two available corner points can be determined, and the maximum distance in each direction corresponding to the preset polygon can be obtained based on all the first distances, wherein each direction corresponding to the preset polygon is determined based on the extension direction of the edge of the preset polygon.
[0062] Specifically, if the preset polygon is a square, the directions corresponding to the preset polygon are the length direction and the width direction. Figure 3, the first distances |AoBo|, |AoCo|, |CoDo|, |BoDo| between the available corner points can be calculated, and the maximum first distance in the width direction maxW=max(|AoBo|, |CoDo|) and the maximum first distance in the height direction maxH=max(|AoCo|, |BoDo|) can be calculated. If the preset polygon is a triangle, the directions corresponding to the preset polygon are the directions corresponding to the three sides, and examples are not given here one by one.
[0063] Step 104: Determine the scaling factor in each direction according to the maximum distance in each direction;
[0064] Specifically, the ratio of the maximum distance to the side length in the corresponding direction may be used as the scaling factor in the corresponding direction. Figure 3 , the width direction scaling factor rw=maxW / IW and the height direction scaling factor rh=maxH / IH can be calculated. Where IW is the width of the current image frame and IH is the length of the current image frame.
[0065] Step 105: If each scaling factor is greater than the corresponding coefficient threshold, determine the scaling factor of the current frame image according to each scaling factor and its corresponding coefficient threshold, and scale the current frame image to obtain a target image.
[0066] In a specific implementation process, it can be determined in turn whether each scaling factor is greater than the corresponding coefficient threshold. If each scaling factor is greater than the corresponding coefficient threshold, the scaling factor of the current frame image can be determined according to each scaling factor and its corresponding coefficient threshold, and the current frame image is scaled to obtain a target image. If at least one scaling factor is less than or equal to the corresponding coefficient threshold, the process can return to step 101.
[0067] In a specific implementation process, the ratio of each coefficient threshold to the corresponding zoom coefficient can be determined, and the minimum ratio is selected as the zoom coefficient of the current frame image, and the current frame image is zoomed to obtain the target image. In this way, it is avoided that the image is over-magnified, or the image is still large after being reduced, so that it can be more in line with the actual needs of users.
[0068] The image processing method of this embodiment obtains multiple initial corner points of the current frame image of the target document, and filters the multiple initial corner points within the range formed by the preset polygon to obtain multiple available corner points of the current frame image, then determines the first distance between any two available corner points, and obtains the maximum distance in each direction corresponding to the preset polygon based on all the first distances; then, based on the maximum distance in each direction, determines the zoom factor in each direction, and when each zoom factor is greater than the corresponding coefficient threshold, selects a zoom factor to zoom the current frame image to obtain the target image, thereby realizing dynamic adjustment of the image display ratio of the target document, bringing convenience to users, and adjusting the image display ratio is more accurate than manual adjustment, thereby improving image display effect and user experience.
[0069] In a specific implementation process, the scaling factor of the current frame image can also be stored, so that when the next frame image is obtained, the next frame image can be scaled according to the scaling factor of the current frame image to obtain multiple initial corner points of the next entire image.
[0070] In a specific implementation process, if each scaling coefficient is greater than the corresponding coefficient threshold, the numerical value corresponding to the alternative corner point of the current frame image is updated to the numerical value corresponding to multiple available corner points of the current frame image, so that when the next frame image is scaled, the alternative corner points of the current frame image can be used to perform median filtering on the next frame image.
[0071] Combine the following Figure 2 and Figure 3 The specific application of the processing method of the present invention is described.
[0072] Figure 4 FIG. 1 is a flow chart of main steps of an image processing method according to another embodiment of the present invention. Figure 4 As shown, the control method of the smart home device in the embodiment of the present invention mainly includes the following steps 401 to 411.
[0073] Step 401: The camera enters the document mode and obtains the current frame image of the target document;
[0074] Step 402: After scaling the current frame image according to a preset scaling factor, a plurality of initial corner points of the current frame image are obtained;
[0075] Step 403: Performing median filtering in the spatial domain on the multiple initial corner points within the range formed by the preset polygon to obtain multiple candidate corner points of the current frame image;
[0076] Step 404: determine whether the number of frames of the current frame image is less than 3, or whether the number of candidate corner points is not equal to 4; if so, return to step 402; if not, execute step 405;
[0077] Step 405: determining a second distance between each candidate corner point of the current frame image and a corresponding candidate corner point of the previous frame image, and determining a maximum second distance;
[0078] Step 406, determine whether the maximum second distance is less than the preset distance; if so, execute step 407, if not, return to step 402;
[0079] Step 407: Performing time-domain median filtering on candidate corner points of multiple frames of images within a range formed by a preset polygon to obtain multiple available corner points of the current frame of image;
[0080] Step 408: determine the first distance between any two available corner points, and obtain the maximum distance in the width direction and the maximum distance in the height direction according to all the first distances, and calculate the scaling factor in the width direction and the scaling factor in the height direction;
[0081] Step 409, determine whether the maximum distance in the width direction is greater than the coefficient threshold in the width direction and whether the maximum distance in the height direction is greater than the coefficient threshold in the height direction; if so, execute step 410; if not, return to step 402;
[0082] Step 410: determine the ratio of each coefficient threshold to the corresponding zoom coefficient, select the minimum ratio as the zoom coefficient of the current frame image, store the zoom coefficient of the current frame image, and update the value corresponding to the candidate corner point of the current frame image to the value corresponding to the multiple available corner points of the current frame image;
[0083] Step 411: Scale the current frame image according to the scaling factor of the current frame image to obtain a target image.
[0084] Figure 5 yes Figure 2 The image after adaptive adjustment corresponding to part (1). Figure 5 Part (1) is the original image of the current frame. Figure 5 Part (2) is the enlarged image of the current frame image.
[0085] It should be pointed out that although the various steps in the above embodiments are described in a specific order, those skilled in the art can understand that in order to achieve the effects of the present invention, different steps do not have to be performed in such an order. They can be performed simultaneously (in parallel) or in other orders. These changes are within the scope of protection of the present invention.
[0086] It is understood by those skilled in the art that the present invention implements all or part of the processes in the method of the above embodiment, and can also be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable storage medium may include: any entity or device, medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory, random access memory, electric carrier signal, telecommunication signal and software distribution medium that can carry the computer program code. It should be noted that the content contained in the computer-readable storage medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable storage media do not include electric carrier signals and telecommunication signals.
[0087] Furthermore, the present invention also provides an image processing device.
[0088] See attached Figure 6 , Figure 6 FIG. 1 is a main structural block diagram of an image processing device according to an embodiment of the present invention. Figure 6 As shown, the image processing device in the embodiment of the present invention may include a processor 60 and a storage device 61 .
[0089] The storage device 61 may be configured to store a program for executing the image processing method of the above method embodiment, and the processor 60 may be configured to execute the program in the storage device 61, which includes but is not limited to a program for executing the image processing method of the above method embodiment. For ease of explanation, only the part related to the embodiment of the present invention is shown, and for specific technical details not disclosed, please refer to the method part of the embodiment of the present invention. The image processing device may be a control device formed by various electronic devices.
[0090] Furthermore, the present invention also provides a terminal, comprising the image processing device described in the above embodiment.
[0091] Furthermore, the present invention also provides a computer-readable storage medium. In a computer-readable storage medium embodiment according to the present invention, the computer-readable storage medium can be configured to store a program for executing the image processing method of the above method embodiment, and the program can be loaded and run by the processor to implement the above image processing method. For ease of explanation, only the parts related to the embodiment of the present invention are shown. For specific technical details not disclosed, please refer to the method part of the embodiment of the present invention. The computer-readable storage medium can be a storage device formed by various electronic devices. Optionally, the computer-readable storage medium in the embodiment of the present invention is a non-temporary computer-readable storage medium.
[0092] Further, it should be understood that since the setting of each module is only for illustrating the functional units of the device of the present invention, the physical devices corresponding to these modules may be the processor itself, or a part of the software in the processor, a part of the hardware, or a part of the combination of software and hardware. Therefore, the number of each module in the figure is only schematic.
[0093] Those skilled in the art will appreciate that the modules in the device can be adaptively split or merged. Such splitting or merging of specific modules will not cause the technical solution to deviate from the principle of the present invention, and therefore, the technical solutions after splitting or merging will fall within the protection scope of the present invention.
[0094] So far, the technical solutions of the present invention have been described in conjunction with the preferred embodiments shown in the accompanying drawings. However, it is easy for those skilled in the art to understand that the protection scope of the present invention is obviously not limited to these specific embodiments. Without departing from the principle of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will fall within the protection scope of the present invention.
Claims
1. An image processing method, characterized in that: include: Obtain multiple initial corner points of the current frame image of the target document; Filtering the plurality of initial corner points within a range formed by a preset polygon to obtain a plurality of available corner points of the current frame image; wherein the number of available corner points is the same as the number of corners of the preset polygon; Determine a first distance between any two available corner points, and obtain the maximum distance in each direction corresponding to the preset polygon based on all the first distances; wherein each direction corresponding to the preset polygon is determined based on the extension direction of the edge of the preset polygon; Determine the scaling factor in each direction according to the maximum distance in each direction; If each scaling factor is greater than the corresponding coefficient threshold, the scaling factor of the current frame image is determined according to each scaling factor and its corresponding coefficient threshold, and the current frame image is scaled to obtain a target image; Wherein, determining the scaling factor in each direction according to the maximum distance in each direction includes: taking the ratio of the maximum distance to the side length in the corresponding direction as the scaling factor in the corresponding direction; Determining the scaling factor of the current frame image according to each scaling factor and its corresponding coefficient threshold comprises: determining a ratio of each coefficient threshold to the corresponding scaling factor, and selecting a minimum ratio as the scaling factor of the current frame image.
2. The image processing method according to claim 1, characterized in that: Filtering the multiple initial corner points within the range formed by the preset polygon to obtain multiple available corner points of the current frame image includes: Performing spatial domain median filtering on the multiple initial corner points within the range formed by the preset polygon to obtain multiple candidate corner points of the current frame image; If the number of frames corresponding to the current frame image is greater than or equal to the preset number of frames, and the number of candidate corner points of the current frame image is the number of corners of the preset polygon, determine a second distance between each candidate corner point of the current frame image and a corresponding candidate corner point of the previous frame image; If the maximum second distance is less than the preset distance, the candidate corner points of the multiple frame images are median filtered in the time domain within the range formed by the preset polygon to obtain multiple available corner points of the current frame image; wherein the multiple frame images include the current frame image and at least two frames of images before the current frame image.
3. The image processing method according to claim 2, characterized in that: Also includes: If each scaling factor is greater than the corresponding factor threshold, the value corresponding to the candidate corner point of the current frame image is updated to the value corresponding to the multiple available corner points of the current frame image.
4. The image processing method according to claim 1, characterized in that: Also includes: The scaling factor of the current frame image is stored.
5. The image processing method according to claim 1, characterized in that: Get multiple initial corner points of the current frame image, including: Scaling the current frame image based on a scaling factor corresponding to a previous frame image or a preset scaling factor to obtain a scaled current frame image; Based on a preset corner point detection algorithm, multiple initial corner points of the zoomed current frame image are obtained.
6. An image processing device, comprising a processor and a storage device, wherein the storage device is suitable for storing a plurality of program codes, characterized in that: The program code is suitable for being loaded and run by the processor to execute the image processing method according to any one of claims 1 to 5.
7. A terminal, characterized in that: Comprising the image processing device as claimed in claim 6.
8. A computer-readable storage medium storing a plurality of program codes, characterized in that: The program code is suitable for being loaded and run by a processor to execute the image processing method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Image display method and device, storage medium and electronic device
CN108737882A
Rapid monocular vision pose measurement method and measurement system based on cooperative target
CN110689579A