Image digital zooming method and device, medium, vehicle-mounted DVR device and vehicle
By using the two-line interpolation algorithm to increase image pixels in the on-board DVR device, the pixel protrusion and distortion problems caused by image amplification are solved, and a clearer enlargement of the image is achieved and the user experience is improved.
Patent Information
- Application Number
- CN202411577410.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-06
- Publication Date
- 2024-12-27
AI Technical Summary
When the image is enlarged, the number of pixels remains unchanged, causing pixels to protrude, resulting in distortion and noise, thereby reducing the image quality, resulting in unclear enlarged images.
The two-line interpolation algorithm is used to increase the number of pixels in the image, and by cropping and enlarging the original image, calculating the target pixel value, realizing digital zoom, and improving image clarity.
The image amplification will automatically trigger the two-line interpolation algorithm, increasing pixels, making the enlarged image still clear and improving the user experience.
Smart Images

Figure CN119211723A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of vehicle technology, and in particular relates to an image digital zoom method, device, medium, vehicle-mounted DVR device and vehicle. Background Art
[0002] The vehicle-mounted DVR device can record emergencies and scenery along the way. When you want to enlarge the image, you can crop the original image through digital zoom and enlarge the cropped area to generate a larger image. However, as the image is enlarged, the pixels become more prominent while the number of pixels remains unchanged, resulting in a pixelated image, distortion and noise, which in turn causes the quality of the enlarged image to deteriorate and become unclear. Summary of the invention
[0003] The present disclosure provides an image digital zoom method, device, medium, vehicle-mounted DVR device and vehicle to solve the above technical problems.
[0004] According to a first aspect of the present disclosure, a method for digital zooming of an image is provided, the method comprising: cropping an original image to obtain a cropped image; enlarging the cropped image to obtain an enlarged image; and increasing the number of pixels of the enlarged image by a bilinear interpolation algorithm to obtain a digitally zoomed image.
[0005] In some embodiments, increasing the number of pixels of the enlarged image by a bilinear interpolation algorithm includes: obtaining Q 11 The pixel value of the point f(Q 11 ), and Q 21 The pixel value of the point f(Q 21 ), where Q 11 The coordinates of the point are (x1, y1), Q 21 The coordinates of the point are (x2, y1), x1 and x2 both represent columns, and y1 represents rows; based on f(Q 11 ) and f(Q 21 ), calculate the first interpolation f(R1) in the x direction, where the coordinates of point R1 are (x, y1), x represents the column; get Q 12 The pixel value of the point f(Q 12 ), and Q 22 The pixel value of the point f(Q 22 ), where Q 12 The coordinates of the point are (x1, y2), Q 22 The coordinates of the point are (x2, y2), y2 represents the row; based on f(Q 12 ) and f(Q 22), the second interpolation f(R2) in the x direction is calculated, where the coordinates of the point R2 are (x, y2), and x represents the column; based on f(R1) and f(R2), the interpolation f(P) in the y direction is calculated, that is, the pixel value of the added pixel is obtained, where the coordinates of the point P are (x, y), x represents the target column, and y represents the target row.
[0006] In some embodiments, the f(Q 11 ) and f(Q 21 ), calculate the first interpolation f(R1) in the x direction, including: According to the formula: , f(R1) is calculated.
[0007] In some embodiments, the f(Q 12 ) and f(Q 22 ), calculate the second interpolation f(R2) in the x direction, including: According to the formula: , f(R2) is calculated.
[0008] In some embodiments, the interpolation value f(P) in the y direction is calculated based on f(R1) and f(R2), that is, the pixel value of the added pixel, including: according to the formula: , f(P) is calculated.
[0009] In some embodiments, before cropping the original image, it also includes: detecting the current speed of the vehicle; if the current speed is less than a speed threshold, cropping the original image is allowed, that is, digital zoom is allowed; if the current speed is greater than or equal to the speed threshold, cropping the original image is not allowed, that is, digital zoom is not allowed.
[0010] According to a second aspect of the present disclosure, a vehicle-mounted DVR device is provided. When the vehicle-mounted DVR device detects an image magnification signal, the original image is digitally zoomed using the above-mentioned image digital zoom method.
[0011] According to a third aspect of the present disclosure, a vehicle is also provided, wherein the vehicle is equipped with the above-mentioned vehicle-mounted DVR device.
[0012] According to the fourth aspect of the present disclosure, an image digital zoom device is also provided, including: an original image cropping module, used to crop the original image to obtain a cropped image; a cropped image enlarging module, used to enlarge the cropped image to obtain an enlarged image; a pixel increasing module, used to increase the number of pixels of the enlarged image through a bilinear interpolation algorithm to obtain a digital zoom image.
[0013] According to a fifth aspect of the present disclosure, a computer storable medium is also provided, on which computer program instructions are stored, and when the instructions are executed by a processor, the above-mentioned image digital zoom method is implemented.
[0014] As described above, by adopting the above technical solution, the embodiment of the present disclosure can achieve the beneficial technical effect: when an image magnification signal is detected, the operation of the dual-line interpolation algorithm is automatically triggered. As the image is magnified, the number of pixels increases, so that the magnified image remains clear.
[0015] Other features and advantages of the present disclosure will become apparent from the following detailed description of exemplary embodiments of the present disclosure with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0017] Figure 1 is a flow chart illustrating a method for digitally zooming an image according to some embodiments of the present disclosure.
[0018] Figure 2 is a diagram showing a coordinated introduction of a single linear interpolation algorithm according to some embodiments of the present disclosure.
[0019] Figure 3 is a diagram illustrating a bilinear interpolation algorithm according to some embodiments of the present disclosure.
[0020] Figure 4 is a schematic diagram showing the calculation of pixel value interpretation at row 20.2 and column 14.5 according to some embodiments of the present disclosure.
[0021] Figure 5 is a block diagram showing an image digital zoom device according to some embodiments of the present disclosure.
[0022] Figure 6 is a block diagram illustrating a computer system for implementing some embodiments of the present disclosure. DETAILED DESCRIPTION
[0023] Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. It should be noted that the relative arrangement of components and steps, numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present disclosure unless otherwise specifically stated.
[0024] At the same time, it should be understood that for the convenience of description, the sizes of the various parts shown in the drawings are not drawn according to the actual proportional relationship.
[0025] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the present disclosure, its application, or uses.
[0026] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and equipment should be considered as part of the specification.
[0027] In all examples shown and discussed herein, any specific values should be interpreted as merely exemplary and not as limiting. Therefore, other examples of the exemplary embodiments may have different values.
[0028] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.
[0029] At present, the vehicle-mounted DVR device can record emergencies and scenery along the way. When you want to enlarge the image, you can crop the original image through digital zoom and enlarge the cropped area to generate a larger image. However, as the image is enlarged, the pixels become more prominent while the number of pixels remains unchanged, resulting in a pixelated image, distortion and noise, which in turn causes the quality of the enlarged image to deteriorate and become unclear.
[0030] In view of this, the present disclosure proposes an image digital zoom method, device, medium, vehicle-mounted DVR device and vehicle. When an image magnification signal is detected, a dual-line interpolation algorithm is automatically triggered. As the image is magnified, the number of pixels increases, so that the magnified image remains clear, thereby improving the user experience.
[0031] Figure 1 FIG. 4 is a flowchart showing a method for digitally zooming an image according to some embodiments of the present disclosure. Figure 1 As shown, the image digital zoom method includes steps 110 to 130.
[0032] In step 110, the original image is cropped to obtain a cropped image.
[0033] In step 120, the cropped image is enlarged to obtain an enlarged image.
[0034] In step 130, the number of pixels of the enlarged image is increased by a bilinear interpolation algorithm to obtain a digital zoom image.
[0035] When the vehicle speed is less than 70KM / H, use two fingers to zoom in on the original image and perform digital zoom. When the vehicle speed is greater than or equal to 70KM / H, the camera stops and enters the digital zoom process.
[0036] The two-line interpolation algorithm involved in this technical solution is based on the single-line interpolation algorithm and pixel value. Pixel is the smallest indivisible unit in the picture. The pixel value is the value assigned by the computer when the original image is digitized, which represents the average brightness information of a small square in the original. Image processing software usually uses 8 bits to represent a pixel, with a total of 256 gray levels, and the pixel value is between 0 and 255, and each level represents a different brightness. The two-line interpolation algorithm uses pixel values to infer the adjacent pixel values.
[0037] like Figure 2 As shown, the dual-line interpolation algorithm is implemented on the basis of the single-line interpolation.
[0038] The single linear interpolation algorithm is as follows: Given the data (x0, y0) and (x1, y1), we need to calculate the y value of a position x in the interval [x0, x1] on the straight line. The function value on the straight line changes linearly, so we only need to calculate the slope of the two points x0 and x0 and the slope of the two points x0 and x1. If the other two are equal, we can get an equation.
[0039] like Figure 3 As shown, bilinear interpolation is performed in two directions, a total of three interpolations. Two interpolations in the X direction and one interpolation in the Y direction are performed to obtain the pixel value of point P.
[0040] Interpolate in the X-axis direction: ;
[0041] Interpolate on the Y axis: , get the pixel value of point P.
[0042] like Figure 4 As shown, the intensity value at the pixel at row 20.2 and column 14.5 can be calculated by linearly interpolating between the values at rows 20 and 21 and columns 14 and 15, i.e.:
[0043] Interpolate in the x-axis direction: ;
[0044] Interpolate on the Y axis: , get the pixel value of the target row and target column.
[0045] Figure 5 is a block diagram showing an image digital zoom device according to some embodiments of the present disclosure. Figure 5 As shown, the image digital zoom device 200 includes an original image cropping module 210 , a cropped image magnifying module 220 , and a pixel increasing module 230 .
[0046] The original image cropping module 210 is configured to crop the original image to obtain a cropped image; the cropped image enlarging module 220 is configured to enlarge the cropped image to obtain an enlarged image; the pixel increasing module 230 is configured to increase the number of pixels of the enlarged image through a bilinear interpolation algorithm to obtain a digital zoom image.
[0047] In the device of the embodiment of the present disclosure, when an image magnification signal is detected, the operation of the bilinear interpolation algorithm is automatically triggered. As the image is magnified, the number of pixels increases, so that the magnified image remains clear.
[0048] Figure 6 is a block diagram showing a computer system for implementing some embodiments of the present disclosure. Figure 6 As shown, the computer system 300 may be embodied in the form of a general-purpose computing device. The computer system 300 includes a memory 310, a processor 320, and a bus 330 that connects various system components.
[0049] The memory 310 may include, for example, a system memory, a non-volatile storage medium, etc. The system memory may store, for example, an operating system, an application program, a boot loader, and other programs. The system memory may include a volatile storage medium, such as a random access memory (RAM) and / or a cache memory. The non-volatile storage medium may store, for example, instructions for executing at least one of the corresponding embodiments of the image digital zoom method. The non-volatile storage medium includes, but is not limited to, a disk memory, an optical memory, a flash memory, etc.
[0050] The processor 320 can be implemented by a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistors, etc. Discrete hardware components. Accordingly, each module such as the original image cropping module, the cropped image magnification module, and the pixel increasing module can be implemented by a central processing unit (CPU) running instructions in a memory that execute corresponding steps, or can be implemented by a dedicated circuit that executes corresponding steps.
[0051] The bus 330 may use any of a variety of bus architectures, including, but not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MCA) bus, and a Peripheral Component Interconnect (PCI) bus.
[0052] The computer system 300 may also include an input / output interface 340, a network interface 350, a storage interface 360, etc. These interfaces 340, 350, 360, the memory 310, and the processor 320 may be connected via a bus 330. The input / output interface 340 may provide a connection interface for input / output devices such as a display, a mouse, and a keyboard. The network interface 350 may provide a connection interface for various networked devices. The storage interface 360 may provide a connection interface for external storage devices such as a floppy disk, a USB flash drive, and an SD card.
[0053] Here, various aspects of the present disclosure are described with reference to flowcharts and / or block diagrams of methods, devices, and computer program products according to embodiments of the present disclosure. It should be understood that each frame of the flowchart and / or block diagram and the combination of frames can be implemented by computer-readable program instructions.
[0054] These computer-readable program instructions may be provided to a processor of a general-purpose computer, a special-purpose computer or other programmable device to produce a machine, so that the processor executes the instructions to produce means for implementing the functions specified in one or more blocks in the flowchart and / or block diagram.
[0055] These computer-readable program instructions may also be stored in a computer-readable memory, which cause the computer to work in a specific manner to produce an article of manufacture, including instructions for implementing the functions specified in one or more blocks in the flowchart and / or block diagram.
[0056] The present disclosure can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects.
[0057] The present disclosure also provides a vehicle-mounted DVR device. When the vehicle-mounted DVR device detects an image magnification signal, the original image is digitally zoomed using the above-mentioned image digital zoom method.
[0058] The present disclosure also provides a vehicle, wherein the vehicle is equipped with the above-mentioned vehicle-mounted DVR device.
[0059] In the present disclosure, when an image magnification signal is detected, the operation of the dual-line interpolation algorithm is automatically triggered. As the image is magnified, the number of pixels increases, so that the magnified image remains clear.
[0060] So far, the image digital zoom method, device, medium, vehicle-mounted DVR device and vehicle according to the present disclosure have been described in detail. In order to avoid obscuring the concept of the present disclosure, some details known in the art are not described. Based on the above description, those skilled in the art can fully understand how to implement the technical solution disclosed herein.
[0061] Although some specific embodiments of the present disclosure have been described in detail by way of examples, it should be understood by those skilled in the art that the above examples are for illustration only and are not intended to limit the scope of the present disclosure. It should be understood by those skilled in the art that the above embodiments may be modified without departing from the scope and spirit of the present disclosure. The scope of the present disclosure is defined by the appended claims.
Claims
1. A method for digital zooming of an image, characterized in that: The method comprises: Crop the original image to obtain a cropped image; Enlarging the cropped image to obtain an enlarged image; The number of pixels of the enlarged image is increased by a bilinear interpolation algorithm to obtain a digital zoom image.
2. The image digital zoom method according to claim 1, characterized in that: Increasing the number of pixels of the enlarged image by using a bilinear interpolation algorithm comprises: Get Q 11 The pixel value of the point f(Q 11 ), and Q 21 The pixel value of the point f(Q 21 ), where Q 11 The coordinates of the point are (x1, y1), Q 21 The coordinates of the point are (x2, y1), x1 and x2 both represent columns, and y1 represents rows; Based on f(Q 11 ) and f(Q 21 ), calculate the first interpolation f(R1) in the x direction, where the coordinates of point R1 are (x, y1), and x represents the column; Get Q 12 The pixel value of the point f(Q 12 ), and Q 22 The pixel value of the point f(Q 22 ), where Q 12 The coordinates of the point are (x1, y2), Q 22 The coordinates of the point are (x2, y2), y2 represents the row; Based on f(Q 12 ) and f(Q 22 ), calculate the second interpolation f(R2) in the x direction, where the coordinates of point R2 are (x, y2), and x represents the column; Based on f(R1) and f(R2), the interpolation f(P) in the y direction is calculated, that is, the pixel value of the added pixel is obtained, where the coordinates of point P are (x, y), x represents the target column, and y represents the target row.
3. The image digital zoom method according to claim 2, characterized in that: The f(Q 11 ) and f(Q 21 ), calculate the first interpolation f(R1) in the x direction, including: According to the formula: , f(R1) is calculated.
4. The image digital zoom method according to claim 3, characterized in that: The f(Q 12 ) and f(Q 22 ), calculate the second interpolation f(R2) in the x direction, including: According to the formula: , f(R2) is calculated.
5. The image digital zoom method according to claim 4, characterized in that: The interpolation value f(P) in the y direction is calculated based on f(R1) and f(R2), that is, the pixel value of the added pixel is obtained, including: According to the formula: , f(P) is calculated.
6. The image digital zoom method according to claim 1, characterized in that: Before cropping the original image, the method further includes: Detect the current speed of the vehicle; If the current vehicle speed is less than the vehicle speed threshold, the original image is allowed to be cropped, that is, the digital zoom action is allowed; If the current vehicle speed is greater than or equal to the vehicle speed threshold, cropping of the original image is not allowed, that is, the digital zoom action is not allowed.
7. A vehicle-mounted DVR device, characterized in that: When the vehicle-mounted DVR device detects an image magnification signal, the original image is digitally zoomed using the image digital zoom method according to any one of claims 1 to 6.
8. A vehicle, characterized in that: The vehicle is equipped with the vehicle-mounted DVR device according to claim 7.
9. An image digital zoom device, characterized in that: include: The original image cropping module is used to crop the original image to obtain a cropped image; A cropped image magnification module, used to magnify the cropped image to obtain an enlarged image; The pixel increasing module is used to increase the number of pixels of the enlarged image through a bilinear interpolation algorithm to obtain a digital zoom image.
10. A computer storable medium, characterized in that: Computer program instructions are stored thereon, and when the instructions are executed by a processor, the image digital zoom method as claimed in any one of claims 1 to 6 is implemented.
