GithubHelp home page GithubHelp logo

Comments (5)

lessthanoptimal avatar lessthanoptimal commented on May 14, 2024

Could you provide an example image? Similar bugs have popped up in the past because there are so many possible formats inside of BufferedImages.

from boofcv.

thhart avatar thhart commented on May 14, 2024

Please see files attached. Used jpg here because of sizes. This is an image captured via v4l from a webcam.

analyze
analyze-converted

from boofcv.

lessthanoptimal avatar lessthanoptimal commented on May 14, 2024

I actually need the original image since it's the internal color model that got screwed up. However, it might be fixed in the current GIT code. The most recent stable release requires you to manually call ConvertBufferedImage.orderBandsIntoRGB() to put it into RGB or RGBA order, one of the examples goes over this. In the latest code this is handled by a flag in convertFromMulti() and convertTo(). In both of those functions set orderRgb to true and it "should" be handled correctly.

from boofcv.

thhart avatar thhart commented on May 14, 2024

Hello Peter, thanks for the tip. OrderBandsIntoRGB fixes the issue. However I don't understand your request of the original image. The image I provided is the original one and should be loaded via ImageIO.

         BufferedImage read = ImageIO.read(new File("/tmp/analyze.jpg"));
         MultiSpectral srcImg = ConvertBufferedImage.convertFromMulti(read, null, ImageFloat32.class);
         try {
            // ConvertBufferedImage.orderBandsIntoRGB(srcImg, read);
            ImageIO.write(ConvertBufferedImage.convertTo(srcImg, null), "jpg", new File("/tmp/analyze-converted.jpg"));
         } catch (IOException ignored) {
         }

from boofcv.

lessthanoptimal avatar lessthanoptimal commented on May 14, 2024

From your message it sounded like the original image was in PNG format, but you converted it into a JPEG? If that is the case then the way color is encoded was change and I wouldn't be able to reproduce the problem on my end exactly the same.

Since orderBandsIntoRGB fixed it I'm going to close this ticket. In the next release I'm going to change how ConvertBufferedImage handles color to make it easier to use.

from boofcv.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.