Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
mcychan authored Sep 22, 2024
1 parent b82c3c0 commit b2e56df
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions nQuantGpp/Otsu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -380,13 +380,12 @@ namespace OtsuThreshold
auto pixelsGray = pixels4b.clone();
if (!isGrayscale)
ConvertToGrayScale(pixels4b, pixelsGray);
vector<Vec4b> pixels(pixels4b.begin(), pixels4b.end());
vector<Vec4b> pixels(pixelsGray.begin(), pixelsGray.end());

auto oldPixels = pixels4b.clone();
auto otsuThreshold = getOtsuThreshold(pixels);
auto lowerThreshold = 0.03, higherThreshold = 0.1;
pixels4b = cannyFilter(pixelsGray, lowerThreshold, higherThreshold);
threshold(oldPixels, pixels4b, otsuThreshold);
threshold(pixelsGray, pixels4b, otsuThreshold);

Mat palette(2, 1, srcImg.type(), scalar);
if (srcImg.channels() == 4)
Expand Down

0 comments on commit b2e56df

Please sign in to comment.