解决图片混乱! [英] Solving a picture jumble!

查看:91
本文介绍了解决图片混乱!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您会导致计算机使用什么样的算法,如果你想解决一个画面混乱?

What algorithm would you make a computer use, if you want to solve a picture jumble?

您可以随时主张在算法的效率方面,但在这里,我真的看什么方法可循。

You can always argue in terms of efficiency of the algorithm, but here I am really looking at what approaches to follow.

感谢

推荐答案

您需要做的是定义一个索引词汇每个面的拼图,使得向右边缘的指标可以告诉你什么一个相应的左衬缘的索引是(例如,一个简单的词汇:凸和凹,对一个面凸意味着上的匹配相对面凹),然后再根据每一块进行分类为索引的词汇。越细的词汇,更discrimantory面部匹配和更快的你algorthm会去,但是你实现它。 (例如,你可能有平边,直边左倾的左,直边倾右,凹,凸,旋钮,旋钮孔,......),我们假设索引模式抽象了边缘的实际形状,并且有一个predicate恰好配合(piece1,边沿1,piece2,EDGE2),即真实只有在边缘完全匹配。我们进一步假设有至多一个完全匹配的一块与特定边缘。

What you need to do is to define an indexing vocabulary for each face of a jigsaw puzzle, such that the index of a right-facing edge can can tell you what the index of a corresponding left-facing edge is (e.g, a simple vocabulary: "convex" and "concave", with "convex" on a face implying "concave" on a matching opposite face), and then classify each piece according to the indexing vocabulary. The finer the vocabulary, the more discrimantory the face-matching and the faster your algorthm will go, however you implement it. (For instance, you may have "flat edge, straight-edge-leans-left, straight-edge-leans-right, concave, convex, knob, knob-hole, ...). We assume that the indexing scheme abstracts the actual shape of the edge, and that there is a predicate "exactly-fits(piece1,edge1,piece2,edge2)" that is true only if the edges exactly match. We further assume that there is at most one exact match of a piece with a particular edge.

的目标是发展一组区域,例如,一组的连接件,直至它不再可以生长的区域。我们先标记具有独特的区域名,1元一件,和所有边缘无与伦比的所有作品。然后,我们列举以任意顺序片边缘。对于每一个枚举片P上边缘E,使用索引模式来选择潜在的配套件/边对。检查恰好符合predicate;顶多一块Q,与边楼恰好匹配。结合该区域的P和Q在一起,使一个大的区域。重复。我想,这解决了这一难题。

The goal is grow a set of regions, e.g., a set of connected pieces, until it is no longer possible to grow the regions. We first mark all pieces with unique region names, 1 per piece, and all edges as unmatched. Then we enumerate the piece edges in any order. For each enumerated piece P with edge E, use the indexing scheme to select potentially matching piece/edge pairs. Check the exactly-fits predicate; at most one piece Q, with edge F, exactly-matches. Combine the regions for P and Q together to make a large region. Repeat. I think this solves the puzzle.

这篇关于解决图片混乱!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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