Video image rotation display method and device
By alternately storing and calculating effective frames of video images at low cost, and using inverse coordinates and weight algorithms to achieve efficient rotation output, it solves the problem of difficulty in achieving high resolution and high frame rate at the same time in the existing technology, and improves the quality of video images. Spin performance.
Patent Information
- Application Number
- CN202110820520.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-20
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2041-07-20
AI Technical Summary
It is difficult for the existing technology to achieve high resolution and high frame rate video image rotation at the same time at low cost. The high cost of FPGA and the low frequency of SRAM result in limited read and write bandwidth and cannot satisfy the simultaneous existence of high resolution and high frame rate. .
By obtaining the frame start flag of the video image, the valid frames and invalid frames are divided into two sets of SRAMs and stored alternately in two sets of SRAM. The inverse coordinate and weight algorithm is used to calculate the rotated pixel coordinates and data to achieve efficient image rotation output. Combined with FPGA and peripherals to improve frame rates.
It achieves high-resolution and high-frame-rate video image rotation at low cost, saves data bandwidth and costs, and improves the output video image frame rate.
Smart Images

Figure CN113691741B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of video image processing, and in particular to a method and device for displaying video image rotation. Background Art
[0002] In the process of rotating video images, since the rotated video data needs to be continuously output, the image storage device has very high requirements. In the prior art, the dynamic storage part is often set inside the FPGA (Field Programmable Gate Array), but since the cost of this part is extremely high and the number is fixed, the resolution processing capability is limited. If a high-resolution image needs to be displayed, a more expensive FPGA is required. In order to solve this problem, most of them use an external SRAM (Static Random-Access Memory) as a video storage device, but since the frequency supported by the SRAM device is relatively low, the bandwidth of reading and writing data is limited. In actual use, either the image resolution is high, but the output frame rate is low; or the image resolution is low, but the output frame rate is high. In the case of low cost, it cannot meet the situation where high-resolution and high-frame-rate video images exist at the same time. Summary of the invention
[0003] The present invention provides a method and device for displaying video image rotation, which realizes outputting high-resolution and high-frame-rate rotating video at low cost.
[0004] In order to solve the above technical problem, an embodiment of the present invention provides a method for displaying a video image rotation, comprising the following steps:
[0005] A video image is acquired, a start mark is added to the frame start of each frame in the video image, and the video image is divided into a valid frame image and an invalid frame image.
[0006] According to the preset frame number storage rule, the valid frame images are alternately stored in the first sram and the second sram, and all invalid frame images are deleted; wherein the first sram and the second sram are components of the sram storage module.
[0007] According to the start mark of the video image, the display coordinates of each valid frame image stored in the video image after rotation are constructed, the rotation angle of the video image input by the user is obtained, and the inverse coordinates of the display coordinates are calculated according to the rotation angle.
[0008] According to the inverse coordinates of the display coordinates, the corresponding actual image coordinate values stored in the SRAM storage module are read out in turn, and according to the preset weight algorithm, the display coordinates corresponding to all pixel points in each valid frame image and the image data corresponding to each display coordinate are calculated.
[0009] Each valid frame image is alternately read and written from the SRAM storage module, and according to the image data corresponding to all display coordinates of each valid frame image, the row and field marks of the valid frame image are added, and each valid frame image is output in sequence to obtain a rotated video image.
[0010] Furthermore, according to the preset frame number storage rule, the valid frame image is alternately stored in the first SRAM and the second SRAM, specifically:
[0011] The first SRAM enable signal and the second SRAM enable signal of the valid frame image are collected, and according to a preset frame number storage rule, the valid frame image data is alternately stored in the SRAM storage module through the first SRAM enable signal and the second SRAM enable signal, and when the first SRAM enable signal or the second SRAM enable signal is a high level, the valid frame image data is allowed to be written into the SRAM storage module; wherein the frame number storage rule is: only odd-numbered frame images are stored or only even-numbered frame images are stored.
[0012] Furthermore, the display coordinates of each valid frame image stored in the video image after rotation are constructed according to the starting mark of the video image, specifically:
[0013] By utilizing the rising edge of the starting point signal of the first valid frame image, a preset cyclic image standard is constructed through a construction module to form the display coordinates of each valid frame image after rotation from left to right and from top to bottom.
[0014] Furthermore, after constructing the display coordinates of each valid frame image stored in the video image after rotation, the method further includes: calculating and obtaining the inverse coordinates of the display image, specifically:
[0015] Taking the center point of the video image as the coordinate origin, the inverse coordinates of all pixels in each displayed image are calculated, and the calculation formula is: Wherein, α is the rotation angle, (x, y) is the display coordinate, and (x′, y′) is the inverse coordinate.
[0016] Furthermore, according to a preset weight algorithm, the display coordinates corresponding to all pixels in each valid frame image and the image data corresponding to each display coordinate are calculated, specifically:
[0017] According to the actual image coordinates corresponding to the inverse coordinates of each display coordinate, several coordinate points closest to the actual image coordinates corresponding to the inverse coordinates are obtained, and according to a preset weight algorithm, the display coordinates corresponding to all pixel points in each valid frame image and the image data corresponding to each display coordinate are calculated.
[0018] Furthermore, the preset weight algorithm is specifically to obtain the 4 coordinate points closest to the actual image coordinates, and the calculation formula is:
[0019] f(R1)=(1-u)·f(i,j)+u·f(i+1,j)
[0020] f(R2)=(1-u)·f(i,j+1)+u·f(i+1,j+1)
[0021] f(P)=(1-v)·f(R1)+v·f(R2)
[0022] Among them, f(P) is the image data corresponding to the display coordinates, f(i, j), f(i+1, j), f(i, j+1), and f(i+1, j+1) are the image data corresponding to the 4 points closest to the actual image coordinates, f(R1) and f(R2) are the image data corresponding to the coordinates R1 and R2 of f(P) on the Y component, respectively, (i, j) are the integer part coordinates of the inverse coordinates, and (u, v) are the decimal part coordinates of the inverse coordinates.
[0023] Further, the alternate reading and writing of each valid frame image from the SRAM storage module is specifically as follows:
[0024] After the valid frame image is read out by the data control module, it is written into the SDRAM module, and the output frame rate of the SDRAM module is twice the input frame rate. Further, the row and field marks added to the valid frame image are specifically:
[0025] The VS, DE, and HS flag signals of the video image are acquired through a sampling module, and the image data corresponding to all display coordinates are aligned with the VS, DE, and HS flag signals through an image cache module and then output in sequence to obtain the rotated video image.
[0026] Among them: VS is a field mark, which is used to identify the starting position of each frame of the video image; HS is a row mark, which is used to identify the position of each row of each frame of the video image when it is displayed; DE is a valid data mark, which is used to identify the valid range area of the video image data.
[0027] The invention also discloses a video image rotation display device, comprising: an image division module, an image storage module, an inverse coordinate acquisition module, a weight calculation module and an image output module.
[0028] The image division module is used to obtain a video image, mark the frame start of each frame in the video image, and divide the video image into valid frame images and invalid frame images.
[0029] The image storage module is used to store the valid frame images alternately in the first SRAM and the second SRAM according to the preset frame number storage rule, and delete all invalid frame images; wherein the first SRAM and the second SRAM are components of the SRAM storage module.
[0030] The inverse coordinate acquisition module is used to construct the display coordinates of each valid frame image stored in the video image after rotation according to the starting mark of the video image, obtain the rotation angle of the video image input by the user, and calculate the inverse coordinates of the display coordinates based on the rotation angle.
[0031] The weight calculation module is used to read out the corresponding actual image coordinate values stored in the SRAM storage module according to the inverse coordinates of the display coordinates in turn, and calculate the display coordinates corresponding to all pixel points in each valid frame image and the image data corresponding to each display coordinate according to a preset weight algorithm.
[0032] The image output module is used to alternately read and write each valid frame image from the SRAM storage module, and add the row and field marks of the valid frame image according to the image data corresponding to all display coordinates of each valid frame image, and output each valid frame image in sequence to obtain a rotated video image.
[0033] The present invention also discloses a video image rotation display device and the above-mentioned video image rotation display method; the display device comprises: FPGA and peripheral devices; wherein:
[0034] The FPGA includes a PLL clock hard core module, a sampling module, a construction module, a DSP hard core coordinate output module, a data control module, an SDRAM storage module and an image cache module; the peripheral devices include an SRAM storage module and a key module.
[0035] The input end of the sampling module is connected to the image input data; the output end of the sampling module is connected to the input end of the SRAM storage module; the output end of the SRAM module is connected to the input end of the data control module.
[0036] The input end of the construction module is connected to the output end of the button module and the output end of the sampling module; the output end of the construction module is connected to the input end of the DSP hard core coordinate output module; the output end of the DSP hard core coordinate output module is connected to the input end of the data control module.
[0037] The output end of the data control module is connected to the input end of the SDRAM storage module; the output end of the SDRAM storage module is connected to the input end of the image cache module.
[0038] Compared with the prior art, the embodiments of the present invention provide a method and device for displaying video image rotation, which classifies valid frames of video images into odd and even numbers through a sampling module, and only extracts odd frames to cache in two groups of SRAMs of an FPGA peripheral, thereby saving a large amount of data bandwidth and cost while meeting the cache requirements of high-resolution video. The SDRAM (synchronous dynamic random-access memory) device built into the FPGA is used to improve the frame rate of the video image, thereby realizing the output of high-resolution, high-frame-rate rotating video at a low cost. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 It is a flow chart of an embodiment of a method for displaying video image rotation provided by the present invention;
[0040] Figure 2 is a schematic diagram of the sampling module structure in an embodiment of the present invention;
[0041] Figure 3 is a schematic diagram of calculating inverse coordinates by the DSP hard core coordinate calculation module in an embodiment of the present invention;
[0042] Figure 4 It is a structural schematic diagram of an embodiment of a display device for rotating video images provided by the present invention;
[0043] Figure 5 The present invention is a schematic diagram of the structural connection of an embodiment of a display device for rotating video images provided by the present invention. DETAILED DESCRIPTION
[0044] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of this protection.
[0045] Embodiment 1
[0046] Please refer to Figure 1 A video image rotation display method provided by an embodiment of the present invention includes steps 11 to 15, each step is specifically as follows:
[0047] Step 11: Acquire a video image, mark the frame start of each frame in the video image, and divide the video image into valid frame images and invalid frame images.
[0048] Step 12: According to a preset frame number storage rule, the valid frame images are alternately stored in the first SRAM and the second SRAM, and all invalid frame images are deleted; wherein the first SRAM and the second SRAM are components of the SRAM storage module.
[0049] Step 13: According to the start mark of the video image, construct the display coordinates of each valid frame image stored in the video image after rotation, obtain the rotation angle of the video image input by the user, and calculate the inverse coordinates of the display coordinates based on the rotation angle.
[0050] Step 14: Read out the corresponding actual image coordinate values stored in the SRAM storage module according to the inverse coordinates of the display coordinates, and calculate the display coordinates corresponding to all pixel points in each valid frame image and the image data corresponding to each display coordinate according to a preset weight algorithm.
[0051] Step 15: alternately read and write each valid frame image from the SRAM storage module, and add the row and field marks of the valid frame image according to the image data corresponding to all display coordinates of each valid frame image, and output each valid frame image in turn to obtain a rotated video image.
[0052] Furthermore, the valid frame images are alternately stored in the first SRAM and the second SRAM according to a preset frame number storage rule, specifically:
[0053] The first SRAM enable signal and the second SRAM enable signal of the valid frame image are collected, and according to a preset frame number storage rule, the valid frame image data is alternately stored in the SRAM storage module through the first SRAM enable signal and the second SRAM enable signal, and when the first SRAM enable signal or the second SRAM enable signal is at a high level, the valid frame image data is allowed to be written into the SRAM storage module;
[0054] The frame number storage rule is: only odd-numbered frame images are stored or only even-numbered frame images are stored.
[0055] It should be noted that if Figure 2As shown, the external input video image data is obtained through the sampling module, and the count cycle is performed from 0 to 3 for every four frames of valid frame images. When the frame start mark of the valid frame image is detected, the counter is increased by one, and the count value is used for the first data selector; when the first data selector recognizes the first frame, the first SRAM is enabled as a high level, otherwise it is a low level. Similarly, when the first data selector recognizes the third frame, the second SRAM is enabled as a high level, otherwise it is a low level; when the first data selector recognizes the even frame, the output is a low level, and the odd frames are stored alternately so as to retain only half of the image data, thereby reducing the storage cost.
[0056] Furthermore, the display coordinates of each valid frame image stored in the video image after rotation are constructed according to the starting mark of the video image, specifically:
[0057] By utilizing the rising edge of the starting point signal of the first valid frame image, a preset cyclic image standard is constructed through a construction module to form the display coordinates of each valid frame image after rotation from left to right and from top to bottom.
[0058] It should be noted that, by utilizing the rising edge of the starting point signal of each valid frame image, a cyclic image standard with a size of 1280*720 is constructed inside the construction module to form the display coordinates of each valid frame image after rotation, which are used as parameters for calculating the inverse coordinates of the image in sequence.
[0059] Furthermore, after constructing the display coordinates of each valid frame image stored in the video image after rotation, the method further includes: calculating and obtaining the inverse coordinates of the display image, specifically:
[0060] Taking the center point of the video image as the coordinate origin, the inverse coordinates of all pixels in each displayed image are calculated, and the calculation formula is: Wherein, α is the rotation angle, (x, y) is the display coordinate, and (x′, y′) is the inverse coordinate.
[0061] It should be noted that if Figure 3 As shown, the address line of the DSP hard-core coordinate output module is used to obtain the rotation angle α of the video image input by the key module, and at the same time, the inverse coordinate is calculated by a calculation formula according to the display coordinate.
[0062] Furthermore, the display coordinates corresponding to all pixels in each valid frame image and the image data corresponding to each display coordinate are calculated according to a preset weight algorithm, specifically:
[0063] According to the actual image coordinates corresponding to the inverse coordinates of each display coordinate, several coordinate points closest to the actual image coordinates corresponding to the inverse coordinates are obtained, and according to a preset weight algorithm, the display coordinates corresponding to all pixel points in each valid frame image and the image data corresponding to each display coordinate are calculated.
[0064] It should be noted that converting the inverse coordinates of the display coordinates into the actual image coordinates in the corresponding SRAM storage module is a prior art and will not be elaborated here.
[0065] Furthermore, the preset weight algorithm is specifically to obtain the 4 coordinate points closest to the actual image coordinates, and the calculation formula is:
[0066] f(R1)=(1-u)·f(i,j)+u·f(i+1,j)
[0067] f(R2)=(1-u)·f(i,j+1)+u·f(i+1,j+1)
[0068] f(P)=(1-v)·f(R1)+v·f(R2)
[0069] Among them, f(P) is the image data corresponding to the display coordinates, f(i, j), f(i+1, j), f(i, j+1), and f(i+1, j+1) are the image data corresponding to the 4 points closest to the actual image coordinates, f(R1) and f(R2) are the image data corresponding to the coordinates R1 and R2 of f(P) on the Y component, respectively, (i, j) are the integer part coordinates of the inverse coordinates, and (u, v) are the decimal part coordinates of the inverse coordinates.
[0070] It should be noted that since the inverse coordinates of each display coordinate are not necessarily integers, they may not correspond to the coordinates of the original valid frame image. Therefore, it is necessary to obtain the image data corresponding to the 4 points closest to each display coordinate through weight calculation method to calculate the integer value of each display coordinate.
[0071] Further, the alternately reading and writing each valid frame image from the SRAM storage module is specifically as follows:
[0072] After the valid frame image is read out by the data control module, it is written into the SDRAM module, and the output frame rate of the SDRAM module is twice the input frame rate. Further, the row and field marks added to the valid frame image are specifically:
[0073] Acquire the VS, DE, and HS flag signals of the video image through a sampling module, align the image data corresponding to all display coordinates with the VS, DE, and HS flag signals through an image cache module, and then output them in sequence to obtain the rotated video image;
[0074] Among them: VS is a field mark, which is used to identify the starting position of each frame of the video image; HS is a row mark, which is used to identify the position of each row of each frame of the video image when it is displayed; DE is a valid data mark, which is used to identify the valid range area of the video image data.
[0075] In summary, the present invention provides a display method for rotating video images. The valid frames of the video images are classified into odd and even types through a sampling module, and only valid odd-numbered frame images are extracted and cached in two groups of SRAM devices of an FPGA peripheral. This saves a large amount of data bandwidth and cost while meeting the cache requirements of high-resolution videos. An SDRAM storage module is built into the FPGA to improve the frame rate of the rotated video image, thereby achieving the output of high-resolution and high-frame-rate rotated videos at a low cost.
[0076] like Figure 4 As shown, an embodiment of the present invention also provides a video image rotation display device, comprising: an image division module, an image storage module, an inverse coordinate acquisition module, a weight calculation module and an image output module;
[0077] The image division module is used to obtain an input video image, mark the frame start of each frame in the video image, divide the video image into valid frame images and invalid frame images, and generate an SRAM enable signal.
[0078] The image storage module is used to store the valid frame images alternately in the first SRAM and the second SRAM according to the preset frame number storage rule, and delete all invalid frame images; wherein the first SRAM and the second SRAM are components of the SRAM storage module.
[0079] The inverse coordinate acquisition module is used to construct the display coordinates of each valid frame image stored in the video image after rotation according to the starting mark of the video image, obtain the rotation angle of the video image input by the user, and calculate the inverse coordinates of the display coordinates based on the rotation angle.
[0080] The weight calculation module is used to read out the corresponding actual image coordinate values stored in the SRAM storage module according to the inverse coordinates of the display coordinates in turn, and calculate the display coordinates corresponding to all pixel points in each valid frame image and the image data corresponding to each display coordinate according to a preset weight algorithm.
[0081] The image output module alternately reads and writes each valid frame image from the SRAM storage module, and adds the row and field marks of the valid frame image according to the image data corresponding to all display coordinates of each valid frame image, and outputs each valid frame image in sequence to obtain a rotated video image.
[0082] The more detailed steps and working principle of the device can refer to but not limited to the display method of video image rotation described above.
[0083] In the specific implementation, Figure 5 As shown, a video image rotation display device is applied with the video image rotation display method of the present invention; the display device comprises: FPGA and peripheral devices; wherein:
[0084] The FPGA includes a PLL clock hard core module, a sampling module, a construction module, a DSP hard core coordinate output module, a data control module, an SDRAM storage module and an image cache module; the peripheral devices include an SRAM storage module and a key module;
[0085] The input end of the sampling module is connected to the image input data; the output end of the sampling module is connected to the input end of the SRAM storage module; the output end of the SRAM module is connected to the input end of the data control module; the output end start frame mark of the sampling module is connected to the input port of the construction module.
[0086] It should be noted that after the PLL clock module is powered on in the FPGA, the internal phase-locked loop of the PLL uses the external input reference clock to control the frequency and phase of the internal oscillation signal of the loop, and outputs different clock frequencies to each module in the clock network of the FPGA through the output pin.
[0087] Among them, the input clock of the acquired video image is used as the input clock of the PLL clock module. The input clock of the PLL clock module is 74.25MHz, and the output is three frequencies, namely 2 times the frequency, 1 times the frequency, and 1 / 2 times the frequency; the output 2 times the frequency and 1 / 2 times the frequency are used for the data control module, the output 1 times the frequency is used for the SDRAM module and the image cache module, the 1 / 2 frequency is used for the construction module and the DSP hard core coordinate output module, and the sampling module and the input clock of the sram data use the input clock of the acquired video image.
[0088] The sampling module inputs a digital signal with a bit width of 24 bits and RGB888, and outputs a digital signal with a bit width of 16 bits and a processed data format of 565, that is, only the high 5 bits of R, the high 6 bits of G, and the high 5 bits of B of RGB are taken;
[0089] The SRAM storage module consists of a first SRAM and a second SRAM that work independently and have the same functions. The first SRAM and the second SRAM each have a capacity of 36Mbit, a data bit width of 18bit, and use a 74.25MHz input clock and a 148.5MHz output clock.
[0090] The input end of the construction module is connected to the output end of the key module; the output end start frame mark of the sampling module is connected to the input port of the construction module; the output end of the construction module is connected to the input end of the DSP hard core coordinate output module; the output end of the DSP hard core coordinate output module is connected to the input end of the data control module;
[0091] The output end of the data control module is connected to the input end of the SDRAM storage module; the output end of the SDRAM storage module is connected to the input end of the image cache module.
[0092] It should be noted that the capacity of the SDRAM storage module is 64Mbit, the data interface is 16bit, and the read and write pins are shared. The input uses a 37.125MHz clock and the output uses a 74.25MHz clock. The data is written in an alternating manner. Since the input and output clocks differ by exactly one times, the SDRAM storage module reads out two frames of valid frame image data while writing one frame of valid frame image data.
[0093] The image buffer module restores the output bit width from 16 bits to 24 bits, and restores the high 5 bits of R, the high 6 bits of G, and the high 5 bits of B in 16 bits to the high 8 bits of R, the high 8 bits of G, and the high 8 bits of B. Since the high bits are used for calculation, the output rotated video image retains the original color to the maximum extent.
[0094] A video image rotation display device provided in this embodiment can execute a video image rotation display method provided in a method embodiment of the present invention, can execute any combination of implementation steps of the method embodiment, and has the corresponding functions and beneficial effects of the method.
[0095] The specific embodiments described above further illustrate the purpose, technical solutions and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. It is particularly pointed out that for those skilled in the art, any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for displaying a video image rotation, characterized in that: The steps include: Acquire a video image, mark the start of each frame in the video image, and divide the video image into valid frame images and invalid frame images; According to the preset frame number storage rule, the valid frame images are alternately stored in the first SRAM and the second SRAM, and all invalid frame images are deleted; wherein the first SRAM and the second SRAM are components of the SRAM storage module, and the first SRAM and the second SRAM are both peripheral devices of the FPGA; the frame number storage rule is: only odd-numbered frame images are stored or only even-numbered frame images are stored; According to the starting mark of the video image, the display coordinates of each valid frame image stored in the video image after rotation are constructed, the rotation angle of the video image input by the user is obtained, and the inverse coordinates of the display coordinates are calculated from the rotation angle. Specifically, the inverse coordinates of all pixels in each display image are calculated with the center point of the video image as the coordinate origin. The calculation formula is: ,in, is the rotation angle, ( ) is the display coordinate, ( ) is the inverse coordinate; According to the inverse coordinates of the display coordinates, the corresponding actual image coordinate values stored in the SRAM storage module are read out in turn, and according to the preset weight algorithm, the display coordinates corresponding to all the pixels in each valid frame image and the image data corresponding to each display coordinate are calculated; Each valid frame image is alternately read and written from the SRAM storage module, and according to the image data corresponding to all display coordinates of each valid frame image, the row and field marks of the valid frame image are added, and each valid frame image is output in sequence to obtain a rotated video image; wherein the row and field marks are specifically: the VS, DE, and HS mark signals of the video image are obtained through a sampling module, and the image data corresponding to all display coordinates are aligned with the VS, DE, and HS mark signals through an image cache module, and then output in sequence to obtain the rotated video image; wherein: VS is a field mark, which is used to identify the starting position of each frame image of the video image; HS is a row mark, which is used to identify the position of each row of each frame image when the video image is displayed; DE is a valid data mark, which is used to identify the valid range area of the video image data; wherein, after alternately reading and writing each valid frame image from the SRAM storage module, it is written into the SDRAM module, and the output frame rate of the SDRAM module is twice the input frame rate.
2. A method for displaying video image rotation as claimed in claim 1, characterized in that: According to the preset frame number storage rule, the valid frame image is alternately stored in the first SRAM and the second SRAM, specifically: The first SRAM enable signal and the second SRAM enable signal of the valid frame image are collected, and according to a preset frame number storage rule, the valid frame image data is alternately stored in the SRAM storage module through the first SRAM enable signal and the second SRAM enable signal, and when the first SRAM enable signal or the second SRAM enable signal is at a high level, the valid frame image data is allowed to be written into the SRAM storage module.
3. A method for displaying video image rotation according to claim 1, characterized in that: The method of constructing the display coordinates of each valid frame image stored in the video image after rotation according to the starting mark of the video image is specifically as follows: By using the rising edge of the starting point signal of the first valid frame image, a preset cyclic image standard is constructed through the construction module to form the display coordinates of each valid frame image after rotation from left to right and from top to bottom.
4. A method for displaying video image rotation as claimed in claim 1, characterized in that: According to the preset weight algorithm, the display coordinates corresponding to all pixels in each valid frame image and the image data corresponding to each display coordinate are calculated, specifically: According to the actual image coordinates corresponding to the inverse coordinates of each display coordinate, several coordinate points closest to the actual image coordinates corresponding to the inverse coordinates are obtained, and according to a preset weight algorithm, the display coordinates corresponding to all pixel points in each valid frame image and the image data corresponding to each display coordinate are calculated.
5. A method for displaying video image rotation as claimed in claim 4, characterized in that: The preset weight algorithm is specifically to obtain the 4 coordinate points closest to the actual image coordinates, and the calculation formula is: in is the image data corresponding to each display coordinate, , , , is the image data corresponding to the 4 points closest to the actual image coordinates, , They are The coordinate in the Y component , The corresponding image data, ( ) is the integer part coordinate of each inverse coordinate, ( ) are the decimal parts of the inverse coordinates.
6. A video image rotating display device, characterized in that: include: Image division module, image storage module, inverse coordinate acquisition module, weight calculation module and image output module; The image division module is used to obtain a video image, mark the frame start of each frame in the video image, and divide the video image into a valid frame image and an invalid frame image; The image storage module is used to store the valid frame images alternately in the first SRAM and the second SRAM according to the preset frame number storage rule, and delete all invalid frame images; wherein the first SRAM and the second SRAM are components of the SRAM storage module, and the first SRAM and the second SRAM are both peripheral devices of the FPGA; the frame number storage rule is: only odd-numbered frame images are stored or only even-numbered frame images are stored; The inverse coordinate acquisition module is used to construct the display coordinates of each valid frame image stored in the video image after rotation according to the starting mark of the video image, obtain the rotation angle of the video image input by the user, and calculate the inverse coordinates of the display coordinates according to the rotation angle. Specifically, the inverse coordinates of all pixels in each display image are calculated with the center point of the video image as the coordinate origin. The calculation formula is: ,in, is the rotation angle, ( ) is the display coordinate, ( ) is the inverse coordinate; The weight calculation module is used to read out the corresponding actual image coordinate values stored in the SRAM storage module according to the inverse coordinates of the display coordinates in turn, and calculate the display coordinates corresponding to all pixel points in each valid frame image and the image data corresponding to each display coordinate according to a preset weight algorithm; The image output module is used to alternately read and write each valid frame image from the SRAM storage module, and according to the image data corresponding to all display coordinates of each valid frame image, add the row and field marks of the valid frame image, output each valid frame image in sequence, and obtain the rotated video image; wherein, the row and field marks are specifically: the VS, DE, and HS mark signals of the video image are obtained through the sampling module, and the image data corresponding to all display coordinates are aligned with the VS, DE, and HS mark signals through the image cache module, and then output in sequence to obtain the rotated video image; wherein: VS is a field mark, which is used to identify the starting position of each frame image of the video image; HS is a row mark, which is used to identify the position of each row of each frame image when the video image is displayed; DE is a valid data mark, which is used to identify the valid range area of the video image data; wherein, after alternately reading and writing each valid frame image from the SRAM storage module, it is written into the SDRAM module, and the output frame rate of the SDRAM module is twice the input frame rate.
7. A video image rotation display device, characterized in that: The display method for rotating a video image as described in claims 1 to 5 is applied; the display device comprises: an FPGA and peripheral devices; wherein: The FPGA includes a PLL clock hard core module, a sampling module, a construction module, a DSP hard core coordinate output module, a data control module, an SDRAM storage module and an image cache module; the peripheral devices include an SRAM storage module and a key module; The input end of the sampling module is connected to the image input data; the output end of the sampling module is connected to the input end of the SRAM storage module; the output end of the SRAM module is connected to the input end of the data control module; The input end of the construction module is connected to the output end of the key module and the output end of the sampling module; the output end of the construction module is connected to the input end of the DSP hard core coordinate output module; the output end of the DSP hard core coordinate output module is connected to the input end of the data control module; The output end of the data control module is connected to the input end of the SDRAM storage module; the output end of the SDRAM storage module is connected to the input end of the image cache module.
Citation Information
Patent Citations
Video image rotating system
CN101489053A
Real-time video image arbitrary angle rotation system and control method thereof
CN102098459A
Radio frequency identification (RFID) system
CN102855507A
Rotating display method and system of spliced display screen
CN105721791A
Student hand ring with positioning function and remote calling function
CN108741464A
