用python解谜
您有2000个原始图像,52x52像素,RGB 24位,对应 到代表4000x1250像素图像的拼图块 每对相邻图像在1行/列像素上重叠。边境 图像具有重复的像素行/列。尝试重建 谜题 我在考虑使用其他的图书馆 编辑 有人这样做了用python解谜,python,python-imaging-library,python-2.7,Python,Python Imaging Library,Python 2.7,您有2000个原始图像,52x52像素,RGB 24位,对应 到代表4000x1250像素图像的拼图块 每对相邻图像在1行/列像素上重叠。边境 图像具有重复的像素行/列。尝试重建 谜题 我在考虑使用其他的图书馆 编辑 有人这样做了 private function runAlgorithm(index:int):void { var currentBitmap:Object = allBitmaps[index]; if(currentBitmap.visited) return
private function runAlgorithm(index:int):void
{
var currentBitmap:Object = allBitmaps[index];
if(currentBitmap.visited) return;
currentBitmap.visited = true;
var left:int = leftMap[currentBitmap.leftRow];
var right:int = rightMap[currentBitmap.rightRow];
var top:int = topMap[currentBitmap.topRow];
var bottom:int = bottomMap[currentBitmap.bottomRow];
if(left != -1){
allBitmaps[left].bitmap.x = currentBitmap.bitmap.x - 50;
runAlgorithm(left);
}
if(right != -1){
allBitmaps[right].bitmap.x = currentBitmap.bitmap.x + 50;
runAlgorithm(right);
}
if(top != -1){
allBitmaps[top].bitmap.y = currentBitmap.bitmap.y - 50;
runAlgorithm(top);
}
if(bottom != -1){
allBitmaps[bottom].bitmap.y = currentBitmap.bitmap.y + 50;
runAlgorithm(bottom);
}
}
如果这是正确的方法,我需要用python编写一个类似的or代码,使用numpy,我将用小的52x52矩阵生成一个大矩阵。每个条目都是一个三元素元组
(R,G,B)
要加入较小的矩阵,可以使用()和()。我使用的是
家庭作业
标记,它不是家庭作业,但看起来像家庭作业:)无论如何,我只想知道如何处理它:我删除了家庭作业
标记,如果它不是家庭作业,就不要添加它。如果它们彼此重叠仅1像素行/列,那么,角件和侧件如何才能达到52x52。角/侧面图像不是52x52,或者重叠更多。。。知道这一点很重要,因为如果拼图的各个部分重叠超过1行/列,则必须比较2列/行像素以获得正匹配。但如果侧边和边角部分较小,则相对容易将其从其余部分中剔除。基本上你知道“网格”的大小-25x80。创建这些图像的对象并创建重叠区域的散列。通过匹配ttrue创建谜题的边界,我正在等待创建谜题的人回答并解释,从昨天开始,我建议使用“费曼问题解决算法”:1。把问题写下来。2.好好想想。3.写下答案