Java解码JPEG 2000为BufferedImage,ImageIO不支持JP2。

huangapple go评论109阅读模式
英文:

Java decode JPEG 2000 to BufferedImage, ImageIO doesn't support JP2

问题

我在过去的两个月里一直在开发一个Java项目,涉及从服务器获取卫星图像并进行图像处理。几乎所有的代码都已经完成,唯一的问题是我还没有找到一种真正将图像加载到缓冲图像中的方法。这些图像是JPEG 2000格式的,我已经在互联网上搜索了解码jp2文件的任何实现,但似乎ImageIO.read方法不适用。我确实找到了Java高级图像API(JAI),但我正在寻找在不使用第三方库的情况下完成此操作的任何方法。我还尝试了JDeli和JJ2000,但我使用它们的尝试都失败了。

有没有办法解码这些文件?如果这要求过高的话,是否有易于使用的库可以处理这个问题?还有,出于好奇,为什么在Java中很难找到jp2解码器的实现呢?

英文:

I've been working on a Java project for the past two months that involves accessing satellite image from servers and doing some image processing. Almost all the code is finished, except for the fact that I haven't found a way to actually load the images into a buffered image. They are JPEG 2000 images, and I've searched all over the internet for any implementations for decoding jp2 files. Apparently ImageIO.read won't cut it. I did come across the java advanced imaging API (JAI), but I'm looking for any way to do this without using a third party. I also checked out JDeli and JJ2000, but my attempts to use them were unsuccessful.

Is there any way to decode these files? If that's asking too much, is there an easy-to-use library out there that handles this? Also, out of curiosity, why is it so difficult to find an implementation of a jp2 decoder for java?

答案1

得分: 1

你可以尝试使用 imageio-openjpeg 库作为 ImageIO API 的插件。(https://github.com/dbmdz/imageio-jnr)

英文:

You can try to use imageio-openjpeg library as plugin for the ImageIO API. (https://github.com/dbmdz/imageio-jnr)

huangapple
  • 本文由 发表于 2020年7月24日 03:15:00
  • 转载请务必保留本文链接:https://go.coder-hub.com/63061577.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定