The image processing technology of computers is getting better and better, and many seemingly impossible things are now quite mature.Algorithm. But do you believe that there is an algorithm that can change the aspect ratio of an image while keeping the aspect ratio unchanged!
We often encounter such a problem: the source image's aspect ratio is not consistent with the target's length and width. It would be a pity to cut a part of the image, and the image content is changed after the image is stretched. At this time, a technology called retargeting may help you: when the aspect ratio of an image changes, it can compress unimportant parts of the image and keep the aspect ratio of the image body unchanged, this image cannot be seen as being stretched.
The principle of the algorithm comes from this paper named seam carving for content-aware image resizing, which was first presented at the Siggraph conference in August this year. The following video briefly introduces this algorithm, and you will find it very simple.
Youtube link: http://www.youtube.com/watch? V = qadw0brkemk
You will hear a word that oier is particularly familiar with in the video. "Starting from a pixel in the top row, you can only move to the bottom left, bottom right, and bottom right at a time to find the weight and the smallest one in the path at the bottom ", this is a required course for every oier to learn dynamic planning. It even appeared in a noip simulation competition a few days ago (it seems to be the third question ).
A recent cnbeta article mentioned that this technology has been used for practice. A flash website called rsizr can implement the above algorithms. If you are interested, you can try it.