When I first wrote a blog, I wanted to record what I had done and what I learned during my internship at the company. Although I still did not know much about it, but I also hope this is an experience.
I started my internship at 2018.9.3, and now I am almost two months away. I have been on a shift in the company and have stayed in most of my positions for a few weeks, now I am back to the department where I should be-Digital IP design department. Many of them will try again when they are free. Now, my job is to learn image scaling. On the one hand, I need to write a thesis. On the other hand, the company said it will develop chips for this purpose at the end of the year, so that I can reserve knowledge in advance. Record your experiences in recent studies today.
The algorithm used for image scaling I learned is bilinear interpolation. This algorithm is very old and many of the papers I found are from around 2000, however, this stable algorithm may be required in Engineering. In various papers, this algorithm is described and improved a lot (because you are a little lazy and seldom read English ). However, some papers clearly read books in water. If you don't talk much about it, let's talk about the bilinear difference.
The most important component of bilinear interpolation is the formula. If you put a graph here, the formula will not be edited. According to my own ideas, we should first have a scaling factor, and then stretch or contract the image through the scaling factor. But here I have a question: is there a register that stores the first changed image? Then, based on the first scaled image, the grayscale value of each pixel in the new target image is calculated by backward ing, and a new target image is obtained.
This is an algorithm record. How can I practice on hardware? This is also a question for me. I should record all these items first, and solve them in sequence after the unclear points.
(1) first, you must be able to accept the source image on the hardware. At this time, there should be a FIFO to cache the incoming data (if the image is scaled properly, however, if you want to scale the video, you need to store the high-speed video source in FIFO mode ). When to read data and when to read the first row of data, this requires a control.
(2) to read the source image from the FIFO, you can perform vertical interpolation first. In this way, you need to read the two rows of data from the source image, these two rows of data are stored in two RAM instances. In this buffer with two RAM instances, a step value x is required, which I personally think is responsible for two tasks. First, each X can be regarded as a weighting coefficient to let the upper and lower rows of Data perform vertical interpolation. Second, each increase in the coefficient before the integer x indicates that the two rows of interpolation need to move downward. For example, if the original source data is the first and second rows, but the rounded digits of X are carried, read the second and third rows from the FIFO.
(3) After interpolation in the vertical direction, horizontal interpolation is required. The calculation formula does not need to be listed, however, you need to note that both horizontal and vertical interpolation require pointers. You need to tell me when a row ends and when the whole frame interpolation ends.
We are still confused about how to design hardware and how to configure various registers. Why did I write this blog mainly because I recently encountered a major emotional problem and suffered a lot of difficulties? I hope that by sorting out these things, I can get a buffer and shift my attention, you can add more questions later.
Image Scaling Problem With bilinear interpolation