0
我正在使用Python 2.7.5和OpenCV。我有一个测试图像,我想在图像数组中找到它最相似的图像。我写了一个使用OpenCV的函数,它会给我相似点的总数。我有更相似的点,图像更相似。不幸的是,这是一个相当耗时的功能,所以我想并行化我的代码以使其更快。使用python进行多处理以找到最大值
#img is the image that I am trying to find the most number of similar pointswith
maxSimilarPts = 0;
#testImages is a list of testImages
for testImage in testImages:
#getNumSimilarPts returns the number of similar points between two images
similarPts = getNumSimilarPts(img, testImage)
if similarPts > maxSimilarPts:
maxSimilarPts = similarPts
我该如何与python并行?任何帮助将不胜感激。
你可能想看看[这篇文章](http://stackoverflow.com/questions/11368486/openmp-and-python)。它与OpenCV无关。但是它有很多与python进行多线程的讨论。 –