Skip to content

Commit

Permalink
bugfix to opencv normalization for 8-bit images
Browse files Browse the repository at this point in the history
  • Loading branch information
mattaq31 committed Sep 8, 2024
1 parent 1e2faac commit a221cea
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion qupath-gelgenie/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ plugins {

ext.moduleName = 'io.github.qupath.extension.gelgenie'

version = "1.0.2"
version = "1.0.3"
description = 'QuPath extension to directly run and interface with GelGenie models.'

// The default 'gradle.ext.qupathVersion' reads this from settings.gradle.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ private static Collection<PathObject> runOpenCVModel(GelGenieModel model, ImageD
// for 8-bit images, normalizing by dividing by 255 works in all cases
if (image.getType() == BufferedImage.TYPE_BYTE_GRAY) {
convertedImage = OpenCVTools.imageToMat(image);
convertedImage.convertTo(convertedImage, CvType.CV_32F);
opencv_core.dividePut(convertedImage, 255.0);
}
// however, for other cases, normalizing by the max bit value could be problematic since it may be
Expand Down

0 comments on commit a221cea

Please sign in to comment.