Skip to content

Commit

Permalink
fix upper hue value for thresholding
Browse files Browse the repository at this point in the history
  • Loading branch information
luigidr committed Nov 26, 2015
1 parent fb5bbdf commit 089f54c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/source/07-image-segmentation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,9 @@ Then we can use the mean as the threshold to separate the background from the fo
.. code-block:: java
if (this.inverse.isSelected())
Imgproc.threshold(hsvPlanes.get(0), thresholdImg, threshValue, 180.0, Imgproc.THRESH_BINARY_INV);
Imgproc.threshold(hsvPlanes.get(0), thresholdImg, threshValue, 179.0, Imgproc.THRESH_BINARY_INV);
else
Imgproc.threshold(hsvPlanes.get(0), thresholdImg, threshValue, 180.0, Imgproc.THRESH_BINARY);
Imgproc.threshold(hsvPlanes.get(0), thresholdImg, threshValue, 179.0, Imgproc.THRESH_BINARY);
Now we apply a low pass filter (blur) with a 5x5 kernel mask to enhance the result:
Expand All @@ -195,7 +195,7 @@ After the closing we need to do a new binary threshold:
.. code-block:: java
Imgproc.threshold(thresholdImg, thresholdImg, threshValue, 180.0, Imgproc.THRESH_BINARY);
Imgproc.threshold(thresholdImg, thresholdImg, threshValue, 179.0, Imgproc.THRESH_BINARY);
At last, we can apply the image we've just obtained as a mask to the original frame:
Expand Down

0 comments on commit 089f54c

Please sign in to comment.