Image correction method, device and equipment based on vehicle-mounted image, and storage medium
By generating an operation frame and recording its rotation angle information, cropping and reversing the image, the problem of installation deviation of vehicle cameras is solved, image correction is achieved, user experience is improved and hardware costs are reduced.
Patent Information
- Application Number
- CN202211639036.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-20
- Publication Date
- 2026-03-03
- Estimated Expiration
- 2042-12-20
AI Technical Summary
Existing vehicle cameras cannot be precisely aligned during installation, resulting in skewed images that affect driver judgment and pose safety hazards. Furthermore, existing hardware adjustment devices increase cost and complexity.
By generating an operation box and recording its rotation angle information relative to the initial image, scaling the operation box to crop the target image, and rotating it in the opposite direction to display the corrected image, the correction is achieved using image processing, reducing hardware costs.
It enables the calibration of in-vehicle images, improves user experience, reduces hardware costs, and avoids complex hardware adjustment devices.
Smart Images

Figure CN115937034B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of vehicle technology, and in particular to an image correction method, apparatus, device, and storage medium based on vehicle images. Background Technology
[0002] Currently, in-vehicle imaging equipment is widely used in various types of vehicles. Vehicle cameras are the data source for these devices. However, due to limitations in the installation precision of current camera equipment, absolute accuracy cannot be achieved during installation, resulting in a slight angle deviation in the captured images. This deviation in the camera's shooting angle can affect the driver's judgment. For example, a misalignment in the rearview camera can impair the driver's assessment of the reversing environment, posing a safety hazard.
[0003] In related technologies, steering motors, angle sensors, and other adjustment devices are usually set in vehicle cameras. However, this not only increases hardware costs but also increases the structural complexity of vehicle cameras. Summary of the Invention
[0004] This invention aims to at least solve one of the technical problems existing in the prior art. To this end, this invention proposes an image correction method, apparatus, device, and storage medium based on vehicle-mounted images, which can realize image correction of vehicle-mounted images and reduce hardware costs.
[0005] In a first aspect, embodiments of the present invention provide an image correction method based on vehicle-mounted images, applied to vehicle-mounted imaging devices, the image correction method based on vehicle-mounted images comprising:
[0006] When a rotation command is received, the currently displayed vehicle image is determined as the initial image, and an operation box is generated based on the image boundary of the initial image;
[0007] The operation frame is rotated according to the rotation command, and the angle information of the operation frame is recorded. The angle information is used to indicate the rotation angle of the operation frame relative to the initial image.
[0008] The operation box is scaled so that it is located within the image area of the initial image, and the target image is cropped from the initial image based on the scaled operation box.
[0009] After rotating the target image in the opposite direction according to the angle information, the target image is displayed.
[0010] According to some embodiments of the present invention, displaying the target image includes:
[0011] Obtain the reference image size of the initial image;
[0012] The target image is then enlarged according to the size of the reference image and displayed.
[0013] According to some embodiments of the present invention, the rotation command includes a rotation direction, and the step of rotating the operation frame according to the rotation command and recording the angle information of the operation frame includes:
[0014] Obtain the preset reference rotation angle;
[0015] The operation frame is rotated according to the rotation direction and the reference rotation angle;
[0016] The angle information is determined based on the rotation direction and the reference rotation angle.
[0017] According to some embodiments of the present invention, the angle information is a cumulative rotation angle, the number of rotation commands is multiple, the rotation direction includes a first direction or a second direction, the first direction is the opposite direction of the second direction, and determining the angle information based on the rotation direction and the reference rotation angle includes:
[0018] When the rotation direction of the rotation command is the first direction, the sum of the cumulative rotation angle and the reference rotation angle is determined as the new cumulative rotation angle;
[0019] Alternatively, when the rotation direction of the rotation command is the second direction, the difference between the cumulative rotation angle and the reference rotation angle is determined as the new cumulative rotation angle;
[0020] The cumulative rotation angle obtained after all the rotation commands have been executed is determined as the angle information.
[0021] According to some embodiments of the present invention, determining the angle information based on the rotation direction and the reference rotation angle includes:
[0022] Obtain the preset upper and lower limits of the angle;
[0023] When the sum of the reference rotation angle and the cumulative rotation angle is greater than or equal to the upper limit value of the angle, the upper limit value of the angle is determined as the new cumulative rotation angle;
[0024] Alternatively, when the difference between the cumulative rotation angle and the reference rotation angle is less than or equal to the lower limit of the angle, the lower limit of the angle is determined as the new cumulative rotation angle.
[0025] According to some embodiments of the present invention, recording the angle information of the operation frame includes:
[0026] Once all the rotation commands have been executed and no new rotation commands are received within a preset time period, the accumulated rotation angle is determined as the angle information.
[0027] Alternatively, after all the rotation commands have been executed, a rotation end command is obtained, and the obtained cumulative rotation angle is determined as the angle information;
[0028] Alternatively, if an interrupt signal is received during the execution of the rotation command, the currently obtained cumulative rotation angle is determined as the angle information.
[0029] According to some embodiments of the present invention, after displaying the target image, the method further includes:
[0030] Once the in-vehicle video stream is acquired, the video frames of the in-vehicle video stream are cropped according to the scaled operation box.
[0031] After the video frame is rotated and cropped in the opposite direction according to the angle information, the adjusted video frame is displayed.
[0032] Secondly, embodiments of the present invention provide an image correction device based on vehicle-mounted images, including at least one control processor and a memory for communicatively connecting to the at least one control processor; the memory stores instructions executable by the at least one control processor, the instructions being executed by the at least one control processor to enable the at least one control processor to perform the image correction method based on vehicle-mounted images as described in the first aspect above.
[0033] Thirdly, embodiments of the present invention provide an in-vehicle imaging device, including an image correction device based on in-vehicle imaging as described in the second aspect above.
[0034] Fourthly, embodiments of the present invention provide a computer-readable storage medium storing computer-executable instructions for performing the image correction method based on vehicle images as described in the first aspect above.
[0035] The image correction method based on vehicle-mounted images according to embodiments of the present invention has at least the following beneficial effects: when a rotation command is received, the currently displayed vehicle-mounted image is determined as the initial image, and an operation box is generated based on the image boundary of the initial image; the operation box is rotated according to the rotation command, and the angle information of the operation box is recorded, the angle information being used to indicate the rotation angle of the operation box relative to the initial image; the operation box is scaled so that the operation box is located within the image area of the initial image, and a target image is cropped from the initial image according to the scaled operation box; after rotating the target image in the reverse direction according to the angle information, the target image is displayed. According to the technical solution of the embodiments of the present invention, the correction direction and angle of the initial image can be determined by rotating the operation box according to the rotation command, and then the corrected target image is obtained after cropping and reverse rotation. Vehicle-mounted image correction is achieved through image processing, improving user experience and reducing hardware costs. Attached Figure Description
[0036] Figure 1 This is a flowchart of an image correction method based on vehicle-mounted images provided in one embodiment of the present invention;
[0037] Figure 2 This is a schematic diagram of an image correction process provided in another embodiment of the present invention;
[0038] Figure 3 This is a flowchart of a magnified target image provided in another embodiment of the present invention;
[0039] Figure 4 This is a flowchart of determining angle information provided in another embodiment of the present invention;
[0040] Figure 5 This is a flowchart of determining angle information based on the rotation direction provided in another embodiment of the present invention;
[0041] Figure 6 This is a flowchart for determining the cumulative rotation angle provided in another embodiment of the present invention;
[0042] Figure 7 This is a flowchart for determining the end of rotation provided in another embodiment of the present invention;
[0043] Figure 8 This is a flowchart of video stream processing provided in another embodiment of the present invention;
[0044] Figure 9 This is a structural diagram of an in-vehicle imaging device provided in another embodiment of the present invention. Detailed Implementation
[0045] Embodiments of the present invention are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.
[0046] In the description of this invention, it should be understood that the orientation descriptions, such as up, down, front, back, left, right, etc., are based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limiting this invention.
[0047] In the description of this invention, "several" means one or more, "more than" means two or more, "greater than," "less than," and "exceeding" are understood to exclude the stated number, while "above," "below," and "within" are understood to include the stated number. The use of "first" and "second" in the description is merely for distinguishing technical features and should not be construed as indicating or implying relative importance, or implicitly indicating the number of indicated technical features, or implicitly indicating the order of the indicated technical features.
[0048] In the description of this invention, unless otherwise explicitly defined, terms such as "set up," "install," and "connect" should be interpreted broadly, and those skilled in the art can reasonably determine the specific meaning of the above terms in this invention in conjunction with the specific content of the technical solution.
[0049] This invention provides an image correction method, apparatus, device, and storage medium based on in-vehicle images. The image correction method includes: upon receiving a rotation command, determining the currently displayed in-vehicle image as the initial image, and generating an operation frame based on the image boundary of the initial image; rotating the operation frame according to the rotation command, and recording the angle information of the operation frame, the angle information indicating the rotation angle of the operation frame relative to the initial image; scaling the operation frame so that it is located within the image area of the initial image, and cropping a target image from the initial image based on the scaled operation frame; and displaying the target image after rotating it in the reverse direction according to the angle information. According to the technical solution of this invention, the correction direction and angle of the initial image can be determined by rotating the operation frame according to a rotation command, and then the corrected target image is obtained after cropping and reverse rotation. This achieves in-vehicle image correction through image processing, improving user experience and reducing hardware costs.
[0050] The control method of the present invention will be further described below with reference to the accompanying drawings.
[0051] Reference Figure 1 This invention provides an image correction method based on vehicle-mounted imaging, applicable to vehicle-mounted imaging devices, including but not limited to the following steps:
[0052] Step S110: When a rotation command is received, the currently displayed vehicle image is determined as the initial image, and an operation box is generated based on the image boundary of the initial image.
[0053] Step S120: Rotate the operation box according to the rotation command and record the angle information of the operation box. The angle information is used to indicate the rotation angle of the operation box relative to the initial image.
[0054] Step S130: Scale the operation box so that the operation box is located within the image area of the initial image, and crop the target image from the initial image according to the scaled operation box;
[0055] Step S140: After rotating the target image in the reverse direction according to the angle information, the target image is displayed.
[0056] It should be noted that the in-vehicle imaging device can be any device in the vehicle capable of displaying multimedia information, such as the vehicle's central control screen or an external display device, as long as it can acquire images from the in-vehicle camera. It should also be noted that the in-vehicle camera can be a reversing camera located at the rear of the vehicle or a camera installed inside the passenger compartment. This embodiment does not impose many restrictions on the specific location of the camera; it only needs to be installed inside the vehicle.
[0057] It should be noted that in-vehicle images can be multimedia streams sent from in-vehicle cameras to in-vehicle imaging devices, or they can be captured reference images. Taking a reversing camera installed at the rear of the vehicle as an example, after the in-vehicle imaging device is started and the vehicle is parked, an image captured by the reversing camera at the current shooting angle can be used as the initial image. After adjusting the initial image to obtain the target image, the adjustment parameters of the target image compared to the initial image are used as the adjustment parameters for each frame of the subsequent reversing image multimedia stream. This ensures that the reversing image, after image processing, meets the driver's observation needs without increasing hardware costs and improves the user experience.
[0058] It should be noted that after obtaining the initial image, the image boundaries of the initial image can be used as the operation bounding box, for example... Figure 2 As shown, Figure 2 The first schematic diagram 21 shown is the initial image. After generating the operation box based on the image boundary of the initial image, the second schematic diagram 22 is obtained after performing a clockwise rotation. In the second schematic diagram 22, the dashed box is the operation box obtained after rotation, and the size of the operation box is the same as that of the initial image.
[0059] It should be noted that rotation commands can be obtained through operation buttons set in the in-vehicle imaging device. For example, two physical or virtual buttons can be set in the in-vehicle imaging device, one button is used to generate a clockwise rotation command, and the other button is used to generate a counterclockwise rotation command. By clicking the button once, a rotation command is generated, so that the adjusted target display image can meet the driver's needs and improve the user experience.
[0060] It should be noted that the rotation of the operation frame can be clockwise or counterclockwise. This embodiment does not involve the selection of the display area, but rather a correction for the initial image due to deviations in the installation angle. Therefore, it is not necessary to perform displacement in the horizontal or familiar direction. Figure 2 As shown in the second schematic diagram 22, after the operation box is rotated, the center point still coincides with the initial image, and there is no horizontal or vertical movement. This will not be repeated later.
[0061] It is worth noting that if the entire initial image is rotated directly according to the rotation command, all pixels of the initial image need to be rotated and adjusted every time the rotation command is executed, resulting in a slow response speed. Therefore, since the rotation command in this embodiment can be generated by the driver's operation, the operation box is used as the operation unit in the calibration process. During the calibration process, there is no need to perform image processing on the initial image. After the operation box finally completes the rotation, the angle information of the operation box is recorded to determine the angle that needs to be calibrated. Then, simple image processing is performed through image cropping and reverse rotation to obtain the calibrated target image. This can reduce the image processing in the calibration process, effectively improve the response speed, and improve the user experience.
[0062] It should be noted that during the calibration process, multiple rotation commands may be executed to achieve fine-tuning, and the directions of the multiple rotation commands are different. Therefore, it is necessary to record the angle information of the operation box to determine the rotation angle of the operation box relative to the initial image, so as to provide an information basis for subsequent reverse rotation.
[0063] It should be noted that since the initial size of the operation box is the same as the initial image, the area of the operation box will exceed the display area after rotation. As shown in the second schematic diagram 22, the vertices of the operation box (dashed box) are all located outside the display area (solid box). Therefore, scaling of the operation box can be achieved through vertex detection. When the operation box is scaled to be located within the initial image, one diagonal vertex is located at the image boundary of the initial image, and the other diagonal vertex is located inside the initial image. For example... Figure 2 Taking the third schematic diagram 23 as an example, the vertex position of the operation box is located within the initial image, which can be achieved by establishing a coordinate system. Those skilled in the art are familiar with how to determine whether a box is located inside an image, so no further limitations will be made here.
[0064] It is worth noting that the initial image is cropped, meaning that the image information inside the operation box is retained, while the image information outside the operation box is deleted. For example... Figure 2 As shown in the third schematic diagram 23 and the fourth schematic diagram 24, the content outside the operation box in the third schematic diagram 23 is deleted, and the resulting target image is shown in the fourth schematic diagram 24, retaining only the image inside the operation box. Furthermore, after cropping the image according to the operation box, the angle of the resulting target image is the same as that of the operation box, as shown in the fourth schematic diagram 24. Figure 2 Taking the fourth schematic diagram 24 as an example, the target image also needs to be adjusted to better suit viewing requirements. This can be achieved by rotating the target image in the opposite direction based on the angle information, making it parallel to the display interface. For example, if the operation frame rotates 3 degrees clockwise, the target image can be rotated 3 degrees counterclockwise. Figure 2 The fourth schematic diagram 24 shown is rotated in the opposite direction to obtain the fifth schematic diagram 25, so that the target image displayed after adjustment can meet the user's needs and improve the user experience.
[0065] Additionally, in one embodiment, reference is made to Figure 3 , Figure 1 The step S140 shown also includes, but is not limited to, the following steps:
[0066] Step S310: Obtain the reference image size of the initial image;
[0067] Step S320: After enlarging the target image according to the size of the reference image, display the target image.
[0068] It should be noted that since the display area of the vehicle imaging device is fixed, if the target image is rotated in the opposite direction and displayed directly, a large number of empty areas will appear in the display area, such as the area between the dashed and solid lines in the fifth schematic diagram 25. In order to further improve the user experience, since the initial size of the operation box is the same as the size of the reference image of the initial image, it is also scaled proportionally. Therefore, it is only necessary to enlarge the target image proportionally to complete the full filling of the display area. The effect can be seen in the sixth schematic diagram 26, which effectively improves the user experience.
[0069] In another embodiment, the rotation command includes a rotation direction, and the operation box is rotated according to the rotation command, as shown in the reference. Figure 4 , Figure 1 The step S120 shown also includes, but is not limited to, the following steps:
[0070] Step S410: Obtain the preset reference rotation angle;
[0071] Step S420: Rotate the operation box according to the rotation direction and reference rotation angle;
[0072] Step S430: Determine angle information based on rotation direction and reference rotation angle.
[0073] It should be noted that rotation commands can be generated by clicking the button, so a reference rotation angle can be set for each rotation, for example, 0.5 degrees. Each time the operation button is clicked, the operation box rotates by 0.5 degrees according to the rotation direction. Of course, the reference rotation angle can also be other values, which can be preset according to actual needs.
[0074] It should be noted that since the angle of each rotation is a reference rotation angle, the correction may be achieved by clicking the button multiple times or pressing and holding the button to achieve continuous rotation. In order to ensure accuracy when rotating the target image in the opposite direction, the rotation direction and reference rotation angle can be recorded after each rotation command is completed, so that the angle information can be summarized after the rotation is completed.
[0075] In another embodiment, the angle information is the cumulative rotation angle, the number of rotation commands is multiple, and the rotation direction includes a first direction or a second direction, where the first direction is the opposite of the second direction. Figure 5 , Figure 4 The step S430 shown also includes, but is not limited to, the following steps:
[0076] Step S510: When the rotation direction of the rotation command is the first direction, the sum of the cumulative rotation angle and the reference rotation angle is determined as the new cumulative rotation angle.
[0077] Step S520: When the rotation direction of the rotation command is the second direction, the difference between the cumulative rotation angle and the reference rotation angle is determined as the new cumulative rotation angle.
[0078] Step S530: The cumulative rotation angle obtained after all rotation commands have been executed is determined as angle information.
[0079] It should be noted that this embodiment uses clockwise as the first direction and counterclockwise as the second direction as an example for illustration. Since image correction can obtain multiple rotation commands through multiple operations, and fine adjustments in different directions may also occur, it is not possible to simply accumulate the number of operations and the reference rotation angle. For example, rotate N times clockwise and M times counterclockwise. For each rotation in the clockwise direction, the cumulative rotation angle is added to the reference rotation angle. For each rotation in the counterclockwise direction, the cumulative rotation angle is subtracted from the reference rotation angle. The final cumulative rotation angle is used as the angle information.
[0080] For example, with a reference rotation angle of 0.5 degrees, multiple rotation commands are sequentially 5 consecutive clockwise rotations, 2 counterclockwise rotations, and 1 clockwise rotation. After 5 consecutive clockwise rotations, the cumulative rotation angle is 2.5 degrees. After 2 counterclockwise rotations, subtract 1 degree, and the cumulative rotation angle is 1.5 degrees. The 1 clockwise rotation completes the correction, and the final cumulative rotation angle is 2 degrees. Therefore, the angle information is 2 degrees.
[0081] Additionally, in one embodiment, reference is made to Figure 6 , Figure 4 The step S430 shown also includes, but is not limited to, the following steps:
[0082] Step S610: Obtain the preset upper limit and lower limit values of the angle;
[0083] Step S620: When the sum of the reference rotation angle and the cumulative rotation angle is greater than or equal to the upper limit value of the angle, the upper limit value of the angle is determined as the new cumulative rotation angle.
[0084] Step S630: When the difference between the cumulative rotation angle and the reference rotation angle is less than or equal to the lower limit value of the angle, the lower limit value of the angle is determined as the new cumulative rotation angle.
[0085] It should be noted that although there may be deviations in the vehicle camera, the deviations are usually not too large. This embodiment sets an upper limit and a lower limit for the angle of deviation correction. For example, the upper limit is set to 5 degrees and the lower limit is -5 degrees, that is, the maximum angle that can be rotated clockwise and counterclockwise is 5 degrees, so as to avoid excessive rotation angle caused by clicking the button too many times during the correction.
[0086] For example, if the current cumulative rotation angle is 5 degrees, clicking to rotate clockwise again will not cause the operation box to rotate further because 5.5 is greater than 5; it will remain at 5 degrees. Clicking to rotate counterclockwise again will cause the operation box to rotate 0.5 degrees counterclockwise, reaching 4.5 degrees. Similarly, if the current cumulative rotation angle is -5 degrees, clicking to rotate counterclockwise again will not cause the operation box to rotate further because -5.5 is less than -5; it will remain at -5 degrees. Clicking to rotate counterclockwise again will cause the operation box to rotate 0.5 degrees counterclockwise, reaching -4.5 degrees.
[0087] Additionally, in one embodiment, reference is made to Figure 7 , Figure 1 The step S120 shown also includes, but is not limited to, the following steps:
[0088] Step S710: After all rotation commands have been executed and no new rotation commands have been obtained within a preset time period, the accumulated rotation angle is determined as angle information.
[0089] Step S720: After all rotation commands have been executed, the rotation end command is obtained, and the accumulated rotation angle is determined as angle information.
[0090] Step S730: When an interrupt signal is obtained during the execution of the rotation command, the currently obtained cumulative rotation angle is determined as angle information.
[0091] It should be noted that in order to determine the angle information, it is necessary to confirm that the calibration is complete, that is, all rotation commands have been executed. A preset time can be set, for example, 5 seconds. If no new rotation command is obtained within 5 seconds, the angle information is determined based on the current cumulative rotation angle and subsequent operations are performed.
[0092] It should be noted that a confirmation button can also be added to the vehicle imaging device. After the operation frame is rotated, clicking the confirmation button generates an end command, which triggers the vehicle imaging device to determine the angle information based on the current cumulative rotation angle and execute subsequent operations.
[0093] It should be noted that since the in-vehicle imaging equipment is installed in the vehicle, performing image correction after the vehicle is started may pose certain safety hazards. Therefore, an interrupt signal can be generated after the vehicle is started or movement is detected. At this time, regardless of whether the rotation command has been fully completed, the angle information can be determined based on the current cumulative rotation angle and subsequent operations can be performed to ensure driving safety.
[0094] Additionally, in one embodiment, reference is made to Figure 8 After execution Figure 1 Following step S140 as shown, the following steps may also be included, but are not limited to:
[0095] Step S810: When the vehicle video stream is acquired, the video frames of the vehicle video stream are cropped according to the scaled operation box.
[0096] Step S820: After rotating the cropped video frame in the reverse direction according to the angle information, the adjusted video frame is displayed.
[0097] It should be noted that after correcting the initial image to obtain a target image that meets the user's needs, the correction parameters of the target image can be applied to the in-vehicle video stream, such as the video stream fed back from the reversing camera to the in-vehicle imaging device. The same processing is performed on each frame of the video stream so that the display angle of the video stream can be corrected according to the angle of the target image, effectively improving the user experience.
[0098] like Figure 9 As shown, Figure 9 This is a structural diagram of an in-vehicle imaging device provided in one embodiment of the present invention. The present invention also provides an in-vehicle imaging device, comprising:
[0099] The processor 901 can be implemented using a general-purpose central processing unit (CPU), microprocessor, application specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this application.
[0100] The memory 902 can be implemented as a read-only memory (ROM), static storage device, dynamic storage device, or random access memory (RAM). The memory 902 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 902 and called and executed by the processor 901 using the image correction method based on vehicle-mounted images according to the embodiments of this application.
[0101] The 903 input / output interface is used to implement information input and output.
[0102] The communication interface 904 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).
[0103] Bus 905 transmits information between various components of the device (e.g., processor 901, memory 902, input / output interface 903, and communication interface 904);
[0104] The processor 901, memory 902, input / output interface 903, and communication interface 904 are connected to each other within the device via bus 905.
[0105] This application embodiment also provides a storage medium, which is a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the above-described image correction method based on vehicle images.
[0106] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof. The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0107] It will be understood by those skilled in the art that all or some of the steps and systems in the methods disclosed above can be implemented as software, firmware, hardware, and suitable combinations thereof. Some or all of the physical components can be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a computer-readable medium, which can include computer storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and is accessible to a computer. Furthermore, as is known to those skilled in the art, communication media typically include computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.
[0108] The above provides a detailed description of the preferred embodiments of the present invention. However, the present invention is not limited to the above embodiments. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of the present invention. All such equivalent modifications or substitutions are included within the scope defined by the claims of the present invention.
Claims
1. A method for image rectification based on vehicle-mounted images, characterized in that, The image correction method based on vehicle-mounted image is applied to a vehicle-mounted image device, and includes the following steps: When a rotation instruction is acquired, an initial image is determined as a current displayed vehicle-mounted image, and an operation frame is generated based on an image boundary of the initial image; The operation frame is rotated according to the rotation instruction, and angle information of the operation frame is recorded, the angle information being used to indicate a rotation angle of the operation frame relative to the initial image; The operation frame is zoomed so as to be located in an image region of the initial image, and a target image is cropped from the initial image according to the zoomed operation frame; After the target image is reversely rotated according to the angle information, the target image is displayed; The rotation instruction includes a rotation direction, and the operation frame is rotated according to the rotation instruction, and the angle information of the operation frame is recorded, including the following steps: A preset reference rotation angle is acquired; The operation frame is rotated according to the rotation direction and the reference rotation angle; The angle information is determined based on the rotation direction and the reference rotation angle; The angle information is a cumulative rotation angle, the number of the rotation instructions is a plurality, the rotation direction includes a first direction or a second direction, the first direction is an opposite direction of the second direction, and the angle information is determined based on the rotation direction and the reference rotation angle, including the following steps: When the rotation direction of the rotation instruction is the first direction, a sum of the cumulative rotation angle and the reference rotation angle is determined as a new cumulative rotation angle; Or, when the rotation direction of the rotation instruction is the second direction, a difference between the cumulative rotation angle and the reference rotation angle is determined as the new cumulative rotation angle; After all the rotation instructions are executed, the cumulative rotation angle obtained is determined as the angle information.
2. The vehicle-mounted image-based image rectification method according to claim 1, wherein The target image is displayed, including the following steps: A reference image size of the initial image is acquired; After the target image is enlarged according to the reference image size, the target image is displayed.
3. The vehicle-mounted image-based image rectification method according to claim 1, wherein The angle information is determined based on the rotation direction and the reference rotation angle, including the following steps: A preset upper limit value and a lower limit value of the angle are acquired; When a sum of the reference rotation angle and the cumulative rotation angle is greater than or equal to the upper limit value of the angle, the upper limit value of the angle is determined as the new cumulative rotation angle; Or, when a difference between the cumulative rotation angle and the reference rotation angle is less than or equal to the lower limit value of the angle, the lower limit value of the angle is determined as the new cumulative rotation angle.
4. The vehicle-mounted image-based image rectification method according to claim 3, wherein The angle information of the operation frame is recorded, including the following steps: After all the rotation instructions are executed, and within a preset time length, if a new rotation instruction is not acquired, the cumulative rotation angle obtained is determined as the angle information; Or, after all the rotation instructions are executed, if a rotation end instruction is acquired, the cumulative rotation angle obtained is determined as the angle information; Or, during execution of the rotation instruction, if an interrupt signal is acquired, the cumulative rotation angle obtained is determined as the angle information.
5. The vehicle-mounted image-based image rectification method according to claim 1, wherein After the target image is displayed, the method further includes the following steps: When the vehicle-mounted video stream is acquired, a video frame of the vehicle-mounted video stream is cropped according to the scaled operation frame; After the cropped video frame is reversely rotated according to the angle information, the adjusted video frame is displayed.
6. An image correction device based on vehicle-mounted images, characterized by comprising: The device comprises at least one control processor and a memory connected to the at least one control processor in communication; the memory stores instructions executable by the at least one control processor, and the instructions are executed by the at least one control processor to enable the at least one control processor to perform the image offset correction method based on vehicle-mounted images according to any one of claims 1 to 5.
7. A vehicle-mounted image device, characterized by comprising: The device for image offset correction based on vehicle-mounted images comprises the device according to claim 6.
8. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer executable instructions for causing a computer to perform the image offset correction method based on vehicle-mounted images according to any one of claims 1 to 5.
Citation Information
Patent Citations
Method and apparatus for processing collected image data
CN103795892A
Method and device for acquiring image
CN104184985A