Skip to content
Snippets Groups Projects
Commit b020beb4 authored by Caillat Michel's avatar Caillat Michel
Browse files

replaced a > with a >= in the computation of the mask relative to the contour level

parent de903483
Branches
No related tags found
No related merge requests found
......@@ -1155,7 +1155,7 @@ class DataBlock:
x,y,w,h = cv2.boundingRect(contour)
for j in np.arange(y, y+h):
for i in np.arange(x, x+w):
theMask[j][i] = cv2.pointPolygonTest(contour, (i, j), False) == 1 and slice[j][i] > level
theMask[j][i] = cv2.pointPolygonTest(contour, (i, j), False) != -1 and slice[j][i] >= level
if theMask[j][i] :
numpix += 1
......@@ -1170,7 +1170,6 @@ class DataBlock:
result["numpix"] = numpix
result["percent"] = numpix / (shape[0]*shape[1]) * 100
result["boundingRect"] = cv2.boundingRect(contour)
self.__logger.debug(cv2.boundingRect(contour))
result = {"status":True, "message":"", "result":result}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment