python拼图识别_用python解决图片拼图

You have 2000 raw images, 52x52 pixels, RGB 24 bits, that correspond

to the pieces of a puzzle representing a 4000x1250 pixel image.

Each adjacent pair of images overlap on 1 row/column of pixels. Border

images have a duplicated row/column of pixels. Try to rebuild the

puzzle.

我正在考虑使用PIL,OpenCV或其他库

编辑

有人这样做了

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中编写类似或代码

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值