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進行多線程的討論。 –