从Java读取RAW图像 [英] Reading RAW images from Java

查看:954
本文介绍了从Java读取RAW图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

佳能/尼康/其他相机以其某些专有格式(.CR2,无论如何)保存传感器的原始输出。是否有任何Java库设计用于读取它们并转换为可管理的BufferedImages?

Canon/Nikon/other cameras save raw output of their sensor in some of their proprietary formats (.CR2, whatever). Is there any Java library designed to read them and convert into manageable BufferedImages?

我不关心完全可自定义的转换类似于ufraw或imagemagick,而是简单的事情只是工作用于渲染此类图像的简单预览。

I don't reqlly care here about fully customizable conversion similar to ufraw or imagemagick, rather something simple that "just works" for rendering simple previews of such images.

推荐答案

我一直在你身边,我觉得您。最好的办法是使用基于Adobe或dcraw的程序自动创建缩略图。使用Adobe转换器的临时DNG文件可能更容易使用。

I've been where you are, and I feel for you. Your best bet is to use an Adobe or dcraw-based program to create thumbnails automatically. Temporary DNG files using Adobe's converter may be easier to use.

如果你坚持用Java做这件事,你将陷入痛苦之中:RAW格式经常变化,有各种各样的疯狂细微差别,并且故意难以使用。相机制造商希望您使用他们的RAW转换软件,以最佳方式显示相机的能力并拧紧Adobe。 dcraw背后的人发现有些相机制造商甚至现在使用加密!

IF you insist on doing it in Java, you're about to run into a mountain of pain. RAW formats change often, have all sorts of crazy nuances and are intentionally hard to work with. Camera makers want you to use THEIR RAW conversion software, to show the camera's abilities at its best and screw Adobe. The guy behind dcraw found that some are camera manufacturers even use encryption now!

现有的Java库很差 - 自从我上次查看它以来,JRawIO已经有所改进,但它只支持dcraw的一小部分格式。除了列出的库之外, imagero 可能提供显示缩略图为您的形象。

The existing Java libraries are poor -- JRawIO has improved since I last looked at it, but it supports only a fraction of the formats that dcraw does. In addition to the listed libraries, the imagero library may provide the ability to display a thumbnail for your image.

从个人经验来看,甚至不要考虑编写自己的RAW文件阅读器。
我试着这样做非常简单的RAW格式一次(只是传感器数据的固体数组,每像素12位)。 dcraw源严重转换为Java。你还没有看到过这样一场有点傻瓜的噩梦。花了我几天来调试字节对齐和字节序的问题。

From personal experience, don't even think about writing your own RAW file reader. I tried to do this with a very simple RAW format once (just a solid array of sensor data, 12 bits per pixel). The dcraw source translates badly to Java. You haven't seen such a nightmare of bit-fiddling ever. Took me days to debug problems with byte alignment and endian-ness.

这篇关于从Java读取RAW图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆