c++ - 怎样快速为10亿张1024*1024的图片整体生成一张1024*1024的缩略图?
阿神
阿神 2017-04-17 15:23:12
0
9
1018

有10亿张10241024的png图片,现在需要生成它们整体的一张10241024的缩略图,也就是说,需要在逻辑上将它们拼接起来再生成一张缩略图,有什么高效的好方法吗?尝试了一下ImageMagick,100张图片就耗时很久,有没有什么快速的好方法?谢谢!

阿神
阿神

闭关修行中......

reply all(9)
迷茫

1024*1024 = 1,048,576
1 billion pictures is 1000,000,000
Each pixel corresponds to about 1000 pictures. You can use the sampling method. Each pixel randomly selects N pictures from 1000 pictures. , then randomly select M pixels in each picture, obtain the average value as a pixel of the thumbnail, and obtain 1024*1024 pixels of the thumbnail in turn.
Can be implemented using opencv.
However, if these 1 billion pictures are random, the result will be close to a picture with a grayscale of 0.5. Because according to the central limit theorem, the variance of each pixel of the thumbnail tends to 0. You have to ensure that the combination of 1 billion pixels has structural characteristics.

PHPzhong

Open PS and draw a picture directly with maximum efficiency

巴扎黑

Again, Alibaba Cloud OSS comes with image processing functions. You can take a look at the API.

洪涛

Data compression will calculate the pixel size of each image on the final image, then compress 1 billion images to the corresponding size, and finally call ImageMagick for splicing

Peter_Zhu

I’m not sure about the principle of the thumbnail generation algorithm, or can you see if you can parallelize the algorithm and do it in a distributed way?

左手右手慢动作

Why is there such a demand? 100,000 such small pictures cannot take up even one pixel in each picture, right?

伊谢尔伦

It feels like the memory will fail

黄舟

1 billion, what is the concept? It’s big data, right?

大家讲道理

1 billion pictures! ! I want it fast! ! Looking for solutions

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template