Indeed if you imagine an image with only alternative horizontal stripes of red and blue, the algorithmswouldn’t see the edges of those stripes if it only compared a pixel to its right neighbour. Thus the two comparisons for each pixel are necessary. So here is the algorithm in symbolic language and in C.
This algorithm was tested on several source images of different types and it gives fairly good results. It is mainly limited in speed because of frequent memory access. The two square roots can be removed easily by squaring the comparison; however, the colour extractions cannot be improved very easily. If we consider that the longest operations are the getpixel function,get*32 and putpixel functions, we obtain a polynomial complexity of 4*N*M, where N is the number of rows and M the number of columns. This is not reasonably fast enough to be computed in real time. For a 300x300x32 image I get about 26 transforms per second on an Athlon XP 1600+. Quite slow indeed. Here are the results of the algorithm on an example image:
A few words about the results of this algorithm: Notice that the quality of the results depends on the sharpness of the source image. If the source image is very sharp edged, the result will reach perfection. However if you have a very blurry source you might want to make it pass through a sharpness filter first, which we will study later. Another remark, you can also compare each pixel with its second or third nearest neighbours on the right and on the bottom instead of the nearest neighbours. The edges will be thicker but also more exact depending on the source image’s sharpness. Finally we will see later on that there is another way to make edge detection with matrix convolution.
The other immediate application of pixel comparison is color extraction. Instead of comparing each pixel with its neighbors, we are going to compare it with a given color C1. This algorithm will try to detect all the objects in the image that are colored with C1. This was quite useful for robotics for example. It enables you to search on streaming images for a particular color. You can then make you robot go get a red ball for example. We will call the reference color, the one we are looking for in the image C0 = (R0,G0,B0).
Once again, even if the square root can be easily removed it doesn’t really affect the speed of the algorithm. What really slows down the whole loop is the NxM getpixel accesses to memory and the get*32 and putpixel. This determines the complexity of this algorithm: 2xNxM, where N and M are respectively the numbers of rows and columns in the bitmap. The effective speed measured on my computer is about 40 transforms per second on a 300x300x32 source bitmap. Here are the results I obtained using this algorithm searching for whites shape in the source bitmap:
求英语翻译 线上等答案!!急用!!(适合大学生的语法)
This idea, however, was given up later. Because the real estate prices has been increasingly growing nowadays, let alone the uncertain factors of buying houses.后来我想到,我现在还在读书,没有必要拥有太多的钱,所以我想我还是先把钱给父母保管或者给他们用,然后一部分的捐给慈善机构。And...
文言文翻译 急用!在线等...
现在的风俗,有的人借人家有丧事就去求酒、肉,找机会到人家家里坐一会儿,希望受人委托办理丧事。他们大搞唱歌、跳舞、演戏、滑稽表演和杂技。
全国三文言文译文
4. 古文三上文章翻译 本人有急用 一、译文 钱思公虽然出身在富贵之家,但是没有什么不良爱好。在西京洛阳曾经告诉官员的家属,说这一生只喜欢读书,坐着的时候就读经书和史书,躺在床上就读各种杂记的书籍,上厕所的时候就读短小的诗词、小令。大概从来没有半刻放下书的时候。 谢希深也说: 同在史院的宋公垂,每当...
火候文言文
因为十天以前荻蔗糖浆还没有长足,而十天以后又怕受霜冻的侵袭而导致前功尽弃,所以种蔗多达十亩的人家就要准备榨糖和煮糖用的车和锅以供急用。至于在广东南部没有霜冻的地区,荻蔗收割的早迟就随人自主安排了。 制造冰糖的方法是:将最上层的白糖加热溶化,用鸡蛋清澄清并去除掉面上的浮渣,要注意适当控制火候。将...
求英语高手帮忙翻译下~~~谢谢啊~~~线上等~~~
急用,求英语高手帮忙翻译……谢谢!线上等 Hello, I am from xian sports institute of XX, it is my pleasure to attend the expo interview. I am an optimistic eager to municate with people, like the people, expertise is martial arts, once won places. If I am fortunate to be elected, I'll...
高手赶紧进来翻译。我急用!!
翻译:1.为了在秦始皇去世之后打倒秦朝。2.引发起了雄伟而激烈的最终战争。3.茶这个字在多个语言里都从中国字里来的。4.俄罗斯人叫它"Cha'I",听起来很像中国北部人发音的“茶叶”。日本的“茶”跟中国的一样,虽然发音有些不同。5.包括种茶,采茶叶、泡茶、喝茶。6.茶还是在舞蹈、诗词和小说里...
翻译。再线等~~紧急!!!
私のふるさとは苏北の名城である阜宁にある。そこの土地は肥沃で、物产に恵まれており、景色が绮丽である。そこの民间の风俗が纯朴で、有名な人物が辈出している。そこに阜宁产の名物料理、乾隆帝から名前を赐った「玉帯饼」といった饼があり、その雪ごとき薄い、绵花ごときやわらかい...
赶快文言文
1. 文言文急需翻译 译文 邹忌身高八尺多,形体容貌光艳美丽。一天早晨,邹忌穿戴好衣 帽,照着镜子,对他的妻子说:“我与城北徐公比,谁更美呢?”他的妻子说:“您十分漂亮,徐公怎么比得上您呢?” 城北的徐公,是齐国的美男子。邹忌不相信自己会比徐公美,就又问他的妾:“我与徐公比,谁更美呢?”妾说:“徐...
急!急!急!在线英文翻译成中文!
语音翻译器,这是一款手机翻译软件,你需要一个英文翻译中文的软件刚刚好,因为它支持中英相互翻译,并且是语音相互翻译。1:首先我们在随身携带的手机上下载一个翻译软件“语音翻译器”,利用手机作为翻译工具的优势在于使用时灵活便捷。2:打开后选择的语音翻译模式,当然你如果喜欢使用文本翻译模式,也可以...
向翻译高手紧急求救!在线等~!
5. 出货高峰 at the peak of shipment 6. 理解和体谅 treat with understanding and consideration 7. 无奈 have no choice 8. 苦衷和难处 secrets in heart and difficulties 9. 满意和欣慰 satisfication and relief 10.由于当前形势十分严峻,摆在我公司面前的困难重重,面对种种残酷...