这个算法是什么意思 [英] What does this algorithm mean

查看:105
本文介绍了这个算法是什么意思的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

1。将每个像素的颜色编码为一个字符串:

-a。从左上角的像素开始。

-b。以十六进制代码(#rrggbb)写出像素的颜色。

-c。如果当前像素右侧有像素,则移动到该像素。否则,移动到下一行的最左边的像素。无论哪种方式,从步骤b再次继续。



2.分析结果字符串的运行情况。

-a。运行被定义为一系列相同的像素颜色。

-b。对于每次运行,计算颜色出现的次数。

-c。然后用一个像素颜色实例替换整个运行,接着是:n,其中n是运行中该颜色的连续像素数。


$ b $我应该使用这个算法来完成一项任务,但是我根本没有关注,有些人可以帮我解释一下它好一点



我尝试了什么:



我一遍又一遍地读过这个东西但是无法抓住它

1. Encode each pixel’s color into a string:
-a. Start with the top left pixel.
-b. Write the color of the pixel in hexcode (#rrggbb).
-c. If there is pixel to the right of the current pixel, move onto that pixel. Otherwise, move to the leftmost pixel of the next row. Either way, continue again from step b.

2. Analyze the resulting string for runs.
-a. A run is defined as a sequence of identical pixel colors.
-b. For each run, count the number of times the color appears.
-c. Then replace the entire run with one instance of the pixel color, followed by ":n" where n is the number of consecutive pixels of that that color in the run.

im supposed to use this algorithm to complete an assignment but I'm not following at all can some one help me out and explain it a little better

What I have tried:

I have read this thing over and over but cant get a hold of it

推荐答案

建议阅读:游程编码 - 维基百科,免费的百科全书 [ ^ ]。


这篇关于这个算法是什么意思的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆