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 05a482d commit aec34da
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions nQuantCpp/Otsu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -397,11 +397,10 @@ namespace OtsuThreshold
if (!isGrayscale)
convertToGrayScale(pixels, pixelsGray);

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

auto pPaletteBytes = make_unique<BYTE[]>(sizeof(ColorPalette) + 2 * sizeof(ARGB));
auto pPalette = (ColorPalette*)pPaletteBytes.get();
Expand Down

0 comments on commit aec34da

Please sign in to comment.