Image processing method, device, electronic device and storage medium
By obtaining the target direction vector of the target image and determining the size of the personalized processing frame, combined with the dark channel prior algorithm, the image blur problem under the influence of weather fog is solved, the image defogging effect is improved, and the distortion is reduced. It is suitable for many applications. Objects and scenes at different distances.
Patent Information
- Application Number
- CN202111439412.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-29
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2041-11-29
AI Technical Summary
Due to the high fuzziness of images collected when the weather is foggy, it is difficult for existing technology to effectively remove fog, resulting in low image quality, and the use of fixed-size processing frames can easily cause distortion during the image defogging process.
By obtaining the target direction vector of the target image, the personalized processing frame size is determined based on the position and direction vector of the target pixel, combined with the dark channel prior algorithm for image defogging, and the processing frame is dynamically adjusted to adapt to the distance and angle of different objects. Reduce distortion.
It improves the quality of the image after dehazing, reduces the degree of distortion, is suitable for scenes with multiple objects and different distances, and enhances the accuracy and effect of image processing.
Smart Images

Figure CN114119419B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to computer vision technology and image defogging technology. More specifically, the present disclosure provides an image processing method, device, electronic device and storage medium. Background Art
[0002] When capturing images, the image quality will be affected by the shooting environment, such as weather. For example, when the weather is foggy, the object in the image will be blurry and the image quality will be low. In related technologies, the image can be processed to remove the fog in the image to improve the image quality. Summary of the invention
[0003] The present disclosure provides an image processing method, apparatus, device and storage medium.
[0004] According to a first aspect, an image processing method is provided, the method comprising: obtaining a target direction vector corresponding to a target image; and determining the size of a processing box corresponding to the target pixel according to the position of the target pixel in the target image and the target direction vector, so as to perform image processing.
[0005] According to the second aspect, an image processing device is provided, which includes: an acquisition module for acquiring a target direction vector corresponding to a target image; and a determination module for determining the size of a processing box corresponding to the target pixel based on the position of the target pixel in the target image and the target direction vector, so as to perform image processing.
[0006] According to a third aspect, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method provided according to the present disclosure.
[0007] According to a fourth aspect, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause a computer to execute the method provided according to the present disclosure.
[0008] According to a fifth aspect, a computer program product is provided, comprising a computer program, which implements the method provided according to the present disclosure when executed by a processor.
[0009] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0011] Figure 1A is a schematic diagram of an exemplary system architecture to which an image processing method and apparatus can be applied according to an embodiment of the present disclosure;
[0012] Figure 1B is a schematic diagram of an exemplary application scenario in which the image processing method and device can be applied according to an embodiment of the present disclosure
[0013] Figure 2 is a flowchart of an image processing method according to an embodiment of the present disclosure;
[0014] Figure 3 is a flowchart of an image processing method according to another embodiment of the present disclosure;
[0015] Figure 4A is a schematic diagram of an image processing method according to an embodiment of the present disclosure;
[0016] Figure 4B is a schematic diagram of a target image according to another embodiment of the present disclosure;
[0017] Figure 5 is a block diagram of an image processing apparatus according to an embodiment of the present disclosure; and
[0018] Figure 6 is a block diagram of an electronic device to which an image processing method can be applied according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0019] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0020] A method for image defogging using a dark channel prior algorithm can obtain a grayscale image of an original image. In the grayscale image, a processing frame (window) of a predetermined size is determined with each pixel as the center. The minimum grayscale value of the pixels in each processing frame is replaced with the grayscale value of the central pixel to obtain a dark channel image, and then image defogging is performed based on the dark channel image.
[0021] In the image defogging process, the size of the processing box will directly affect the defogging effect of the image. The camera on one side of the road can use a certain viewing angle to collect images. Moreover, the collected image can contain multiple objects. These objects are at different distances from the camera and at different angles to the camera. In the collected image, due to the existence of areas corresponding to fog, the areas near the objects farther from the camera are more blurred. If the same size of processing box is used, the image obtained after image defogging will have a certain degree of distortion.
[0022] Figure 1A is a schematic diagram of an exemplary system architecture to which an image processing method and apparatus can be applied according to an embodiment of the present disclosure. It should be noted that: Figure 1A What is shown is merely an example of a system architecture to which the embodiments of the present disclosure can be applied, in order to help those skilled in the art understand the technical content of the present disclosure, but it does not mean that the embodiments of the present disclosure cannot be used in other devices, systems, environments or scenarios.
[0023] like Figure 1A As shown, the system architecture 100 according to this embodiment may include multiple terminal devices 101, a network 102 and a server 103. The network 102 is used to provide a medium for a communication link between the terminal device 101 and the server 103. The network 102 may include various connection types, such as wired and / or wireless communication links, etc.
[0024] The user can use the terminal device 101 to interact with the server 103 through the network 102 to receive or send messages, etc. The terminal device 101 can be various electronic devices, including but not limited to smart phones, tablet computers, laptop computers, etc.
[0025] The image processing method provided in the embodiment of the present disclosure can generally be executed by the server 103. Accordingly, the image processing apparatus provided in the embodiment of the present disclosure can generally be set in the server 103. The image processing method provided in the embodiment of the present disclosure can also be executed by a server or a server cluster that is different from the server 103 and can communicate with the terminal device 101 and / or the server 103. Accordingly, the image processing apparatus provided in the embodiment of the present disclosure can also be set in a server or a server cluster that is different from the server 103 and can communicate with the terminal device 101 and / or the server 103.
[0026] Figure 1B is a schematic diagram of an exemplary application scenario in which the image processing method and apparatus can be applied according to an embodiment of the present disclosure. It should be noted that: Figure 1B The examples shown are merely examples of application scenarios to which the embodiments of the present disclosure can be applied, so as to help those skilled in the art understand the technical content of the present disclosure, but do not mean that the embodiments of the present disclosure cannot be used in other environments or scenarios.
[0027] like Figure 1B As shown, multiple roadside cameras 104 arranged on both sides of the road can collect images of vehicles 105. The roadside cameras 104 are located above the vehicles 105 and can collect images of at least one vehicle 105 from a bird's-eye view. When the weather is foggy, rainy or snowy, the roadside cameras 104 can also collect images containing the vehicles 105. However, there are a lot of blurred areas in the images.
[0028] Figure 2 is a flowchart of an image processing method according to an embodiment of the present disclosure.
[0029] like Figure 2 As shown, the method 200 may include operations S210 to S220.
[0030] In operation S210, a target direction vector corresponding to a target image is acquired.
[0031] In the embodiment of the present disclosure, the target image may be an image in a video sequence captured by a roadside camera.
[0032] For example, the target image can be Figure 1B The target image may contain objects (e.g. Figure 1B Vehicle 105).
[0033] For example, the target image may also be an image obtained by processing the original image, such as a grayscale image. The original image may be, for example, Figure 1B The image captured by the roadside camera 104.
[0034] In the embodiment of the present disclosure, the target direction vector may be used to characterize the direction of the top-down viewing angle.
[0035] For example, the target direction vector may be a first direction vector from the upper right vertex of the target image to the lower left vertex of the target image. For another example, the target direction vector may be a second direction vector that forms a predetermined acute angle with the first direction vector.
[0036] For example, the target direction vector may represent the angle between the object and a roadside camera.
[0037] In operation S220, a size of a processing frame corresponding to the target pixel is determined according to the position of the target pixel in the target image and the target direction vector to perform image processing.
[0038] In the embodiment of the present disclosure, the target pixel may be any pixel in the target image.
[0039] In the embodiment of the present disclosure, the position of the target pixel may be the coordinates of the target pixel.
[0040] For example, the upper left vertex of the target image can be used as the origin to establish a coordinate system. The X-axis direction of the coordinate system is the direction from the origin to the upper right vertex. The Y-axis direction of the coordinate system is the direction from the origin to the lower left vertex. Then, the coordinates of each pixel on the target image can be obtained to determine the position of the target pixel.
[0041] For example, in the coordinate system described above, the center coordinates of the processing frame are the coordinates of the target pixel.
[0042] Through the disclosed embodiments, a more appropriate processing frame size can be determined for different pixels in an image. After subsequent processing using a dark channel priori algorithm, a processed image with a smaller degree of distortion can be obtained compared to a processing frame with a fixed size.
[0043] Figure 3 is a flowchart of an image processing method according to another embodiment of the present disclosure.
[0044] like Figure 3 As shown, the method 320 can determine the size of the processing frame corresponding to the target pixel according to the position of the target pixel in the target image and the target direction vector to perform image processing. The following will be described in detail with reference to operations S321 to S323.
[0045] In operation S321, a reference object related to the target image is determined according to the target direction vector.
[0046] In the embodiment of the present disclosure, the position of the reference point may be acquired.
[0047] For example, the reference point can be any point in the target image.
[0048] For example, the reference point may be the center point of the target image. For another example, the reference point may be one of the four vertices of the target image.
[0049] In one example, one can use, for example, Figure 2 The coordinate system described in the embodiment is used to determine the coordinates of the reference point as the position of the reference point.
[0050] In one example, the reference point may be the upper right vertex of the target image.
[0051] For example, the reference point may be a point outside the target image.
[0052] In the embodiment of the present disclosure, a straight line passing through a reference point and forming a predetermined angle with a target direction vector may be acquired to determine a reference straight line related to the target image.
[0053] For example, the predetermined angle is 90 degrees. For another example, the predetermined angle may be greater than 0 degrees and less than or equal to 90 degrees.
[0054] In one example, one can use, for example, Figure 2 The coordinate system described in the embodiment of the invention determines the reference straight line according to the coordinates of the reference point and the predetermined angle formed with the target direction vector. For example, the coordinates of the upper right vertex of the target image are (c, 0), and the target direction vector is (a, b). The vector at 90 degrees to the target direction is (-b, a). Furthermore, the equation of the reference straight line can be determined based on the coordinates of the upper right vertex (c, 0) and the vector (-b, a):
[0055] a*x+b*ya*c=0 (Formula 1)
[0056] a>0, b>0, c>0.
[0057] In operation S322, a first distance between the target pixel and the reference object is determined according to the position of the target pixel.
[0058] For example, the coordinates of the target pixel are (x0, y0). The first distance between the target pixel and the reference straight line shown in Formula 1 can be calculated by the following formula:
[0059]
[0060] d is the first distance.
[0061] In operation S323, a size of a processing frame corresponding to the target pixel is determined according to the first distance.
[0062] In the embodiment of the present disclosure, a target parameter related to the target pixel may be determined according to the first distance.
[0063] For example, the target parameter associated with the target pixel can be determined by the following formula:
[0064]
[0065] S is the target parameter, d is the first distance, D is the second distance between the predetermined pixel and the reference object, S max is the first predetermined parameter, S min is the second predetermined parameter.
[0066] The predetermined pixel may be the pixel on the target image that is the largest distance from the reference point. In one example, when the reference point is the upper right vertex of the target image, the predetermined pixel may be the pixel corresponding to the lower left vertex of the target image. max =3, S min =0.1.
[0067] By using the second distance for normalization, resources consumed in determining the size of the processing box can be reduced.
[0068] In the embodiment of the present disclosure, the size of the processing frame corresponding to the target pixel can be determined according to the target parameters and the initial processing frame size.
[0069] For example, the size of the processing box corresponding to the target pixel can be determined by the following formula:
[0070] L=S*L0 (Formula 4)
[0071] W=S*W0 (Formula 5)
[0072] L is the length of the processing frame corresponding to the target pixel, W is the width of the processing frame corresponding to the target pixel, L0 is the length of the initial processing frame, W0 is the width of the initial processing frame, and S is the target parameter. In one example, W0=15, L0=15.
[0073] Figure 4A is a schematic diagram of an image processing method according to an embodiment of the present disclosure.
[0074] like Figure 4A As shown, since the weather was foggy when the target image 400 was collected, there are a lot of relatively blurred areas in the target image.
[0075] A coordinate system can be established with the upper left vertex O of the target image 400 as the origin. The X-axis direction of the coordinate system is the direction from the upper left vertex O to the upper right vertex 403 of the target image 400, and the Y-axis direction of the coordinate system is the direction from the upper left vertex O to the lower left vertex 404.
[0076] The target direction vector corresponding to the target image 400 may be a vector 401. For example, the vector 401 may be a vector from the origin O to the point P in the coordinate system. In one example, the coordinates of the point P are (-2, 1). The angle between the vector 401 and the positive direction of the Y axis is tan -1 0.5. The direction of the target direction vector may be adjusted according to the position of the roadside camera. In one example, the target direction vector may be obtained after being specified by a user.
[0077] According to the above coordinate system, the coordinates of the target pixel 402 can be obtained to determine the position of the target pixel 402 .
[0078] Taking the upper right vertex 403 as a reference point, a reference straight line 405 passing through the upper right vertex 403 and perpendicular to the straight line where the vector 401 is located can be obtained. For example, the angle between the reference straight line 405 and the Y axis can be tan -1 2. In one example, the coordinates of the upper right vertex are (1920, 0). The equation of the reference straight line 405 can be determined as:
[0079] 2x-y-3840=0 (Formula 6)
[0080] Next, according to the coordinates of the target pixel 402 , the first distance between the target pixel 402 and the reference straight line 405 can be determined using the aforementioned formula 2.
[0081] The distance between the lower left vertex 404 and the upper right vertex 403 is used as the second distance, and the size of the processing box corresponding to the target pixel 402 can be determined by using the formulas 5 and 6 described above. In one example, the size of the initial processing box is: width W0 = 15, length L0 = 15. The size of the processing box corresponding to the target pixel 402 is: width W = 16, length L = 16. In another example, the size of the processing box corresponding to a pixel in the target image 400 is: width W min =1.5, length L min =1.5. In another example, the size of the processing box corresponding to one pixel in the target image 400 is: width W max =45, length L max =45.
[0082] like Figure 4A As shown, since the distances between the objects in the target image 400 and the roadside camera are different, the sizes of the objects in the target image 400 vary greatly.
[0083] Figure 4B is a schematic diagram of a target image according to another embodiment of the present disclosure.
[0084] like Figure 4B As shown, the target image includes object 406 and object 407. Object 406 and object 407 are at different distances from the roadside camera. Object 406 and object 407 also form different angles with the roadside camera. If processing frames of different sizes are used for image processing (such as image defogging), a high-quality processed image can be obtained.
[0085] Figure 5 is a block diagram of an image processing apparatus according to an embodiment of the present disclosure.
[0086] like Figure 5 As shown, the device 500 may include an acquisition module 510 and a determination module 520 .
[0087] The acquisition module 510 is used to acquire a target direction vector corresponding to the target image.
[0088] The determination module 520 is used to determine the size of the processing box corresponding to the target pixel according to the position of the target pixel in the target image and the target direction vector, so as to perform image processing.
[0089] In some embodiments, the above-mentioned determination module includes: a first determination submodule, used to determine the reference object related to the above-mentioned target image according to the above-mentioned target direction vector; a second determination submodule, used to determine the first distance between the target pixel and the above-mentioned reference object according to the position of the above-mentioned target pixel; and a third determination submodule, used to determine the size of the processing box corresponding to the above-mentioned target pixel according to the above-mentioned first distance.
[0090] In some embodiments, the reference object is a reference straight line, and the first determination submodule includes: a first acquisition unit for acquiring the position of a reference point; and a second acquisition unit for acquiring a straight line passing through the reference point and forming a predetermined angle with the target direction vector to determine the reference straight line related to the target image.
[0091] In some embodiments, the reference point is a vertex of the target image, and the predetermined angle is 90 degrees.
[0092] In some embodiments, the third determination submodule includes: a first determination unit, used to determine the target parameters related to the target pixel based on the first distance; and a second determination unit, used to determine the size of the processing box corresponding to the target pixel based on the target parameters and the initial processing box size.
[0093] In some embodiments, the first determining unit is further used to determine a target parameter related to the target pixel by using the following formula: Wherein, S is the target parameter, d is the first distance, D is the second distance between the predetermined pixel and the reference object, S max is the first predetermined parameter, S min is a second predetermined parameter; wherein the predetermined pixel is a pixel on the target image that is at the largest distance from the reference point.
[0094] In some embodiments, the second determination unit is also used to determine the size of the processing box corresponding to the target pixel by the following formula: L=S*L0; W=S*W0; wherein L is the length of the processing box corresponding to the target pixel, W is the width of the processing box corresponding to the target pixel, L0 is the length of the initial processing box, W0 is the width of the initial processing box, and S is the target parameter.
[0095] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0096] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0097] Figure 6 A schematic block diagram of an example electronic device 900 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0098] like Figure 6 As shown, the device 600 includes a computing unit 601, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 602 or a computer program loaded from a storage unit 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the device 600 can also be stored. The computing unit 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0099] A number of components in the device 600 are connected to the I / O interface 605, including: an input unit 606, such as a keyboard, a mouse, etc.; an output unit 607, such as various types of displays, speakers, etc.; a storage unit 608, such as a disk, an optical disk, etc.; and a communication unit 609, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 609 allows the device 600 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0100] The computing unit 601 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 601 performs the various methods and processes described above, such as image processing methods. For example, in some embodiments, the image processing method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 608. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 600 via ROM 602 and / or communication unit 609. When the computer program is loaded into RAM 603 and executed by the computing unit 601, one or more steps of the image processing method described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to perform the image processing method in any other appropriate manner (e.g., by means of firmware).
[0101] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0102] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0103] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0104] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0105] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0106] A computer system may include clients and servers. Clients and servers are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship to each other.
[0107] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0108] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. An image processing method, comprising: Get the target direction vector corresponding to the target image; Determining a reference object related to the target image according to the target direction vector; Determining a first distance between the target pixel and the reference object according to a position of the target pixel in the target image; determining a difference between a first predetermined parameter and a second predetermined parameter; Taking the first distance as a dividend and the second distance as a divisor, obtaining a division result, wherein the second distance is a distance between a predetermined pixel and the reference object, the predetermined pixel is a pixel on the target image with the largest distance from a reference point, and the reference point is a vertex of the target image; determining a product between the difference and the result of the division operation; taking the difference between the first predetermined parameter and the product as a target parameter; The size of the processing frame corresponding to the target pixel is determined according to the target parameter and the initial processing frame size to perform image processing.
2. The method according to claim 1, wherein: The reference object is a reference straight line, The determining, according to the target direction vector, a reference object related to the target image comprises: Obtaining the position of the reference point; A straight line passing through the reference point and forming a predetermined angle with the target direction vector is obtained to determine the reference straight line related to the target image.
3. The method according to claim 2, wherein: The predetermined angle is 90 degrees.
4. The method according to claim 1, wherein: The target parameter is determined by the following formula: Wherein, S is the target parameter, d is the first distance, D is the second distance between the predetermined pixel and the reference object, and S max is the first predetermined parameter, S min is the second predetermined parameter; The predetermined pixel is a pixel on the target image that is at the largest distance from the reference point.
5. The method according to claim 4, wherein: Determining the size of the processing frame corresponding to the target pixel according to the target parameter and the initial processing frame size includes: The size of the processing box corresponding to the target pixel is determined by the following formula: Among them, L is the length of the processing box corresponding to the target pixel, W is the width of the processing box corresponding to the target pixel, L0 is the length of the initial processing box, W0 is the width of the initial processing box, and S is the target parameter.
6. An image processing device, comprising: An acquisition module, used for acquiring a target direction vector corresponding to a target image; A first determination submodule, configured to determine a reference object related to the target image according to the target direction vector; A second determination submodule, configured to determine a first distance between a target pixel and the reference object according to a position of the target pixel in the target image; A first determining unit, configured to determine a difference between a first predetermined parameter and a second predetermined parameter; Taking the first distance as a dividend and the second distance as a divisor to obtain a division result, wherein the second distance is the distance between a predetermined pixel and the reference object, the predetermined pixel being a pixel on the target image with the largest distance from a reference point, and the reference point being a vertex of the target image; determining a product between the difference value and the division result; and taking a difference between the first predetermined parameter and the product as a target parameter; The second determining unit is used to determine the size of the processing frame corresponding to the target pixel according to the target parameter and the initial processing frame size to perform image processing.
7. The device according to claim 6, wherein: The reference object is a reference straight line, The first determining submodule includes: A first acquisition unit, used to acquire the position of the reference point; The second acquisition unit is used to acquire a straight line that passes through the reference point and forms a predetermined angle with the target direction vector, so as to determine the reference straight line related to the target image.
8. The device according to claim 7, wherein: The predetermined angle is 90 degrees.
9. The device according to claim 6, wherein: The target parameter is determined by the following formula: Wherein, S is the target parameter, d is the first distance, D is the second distance between the predetermined pixel and the reference object, and S max is the first predetermined parameter, S min is the second predetermined parameter; The predetermined pixel is a pixel on the target image that is at the largest distance from the reference point.
10. The device according to claim 9, wherein: The second determining unit is further configured to: The size of the processing box corresponding to the target pixel is determined by the following formula: Among them, L is the length of the processing box corresponding to the target pixel, W is the width of the processing box corresponding to the target pixel, L0 is the length of the initial processing box, W0 is the width of the initial processing box, and S is the target parameter.
11. An electronic device, comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 5.
12. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 5.
13. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 5.
