ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 LibRaw question

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
MikeyC Posted - May 16 2018 : 16:09:35
In my software, I need the ability to load a raw photo with no color matrix manipulation using LibRaw. In DCRAW, you could do that by specifying the -o 0 parameter. I believe in LibRaw, the equivalent would be output_color set to zero.

Is there a way to do that? I've tried specifying a number of things in the raw_extraparams string but they don't seem to do anything (with LibRaw enabled anyway).

In addition, the parameters raw_red_bias and raw_blue_bias don't seem to do anything (they are always 1.0). I would expect them to change the white balance if set <> 1.0 before the load and also indicate the camera values if UseCameraWB is true (after the load).

Regards,
Mike

Mike Chaney
14   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Jun 01 2018 : 03:25:13
Hi Mike

We'll have a new "Get Embedded JPEG" property in v8.


Nigel
Xequte Software
www.imageen.com
MikeyC Posted - May 30 2018 : 11:28:36
Hi Nigel,

Most raws that I've seen from Canons have something like a 1/4 size JPEG. This image has a 1616 x 1080 resolution image embedded: I'm able to get it using my old DCraw code:

https://www.imaging-resource.com/PRODS/sony-a7/AA7hVFAI00100.ARW.HTM

No matter how I try to load a thumb using LibRaw in ImageEn, I get a 160x120. It seems like there are two "thumbnails" in most raws: the EXIF thumbnail which is the tiny 160x120 and then the raw itself has an embedded JPEG in the raw data. Looks like the LibRaw implementation in ImageEn is only accessing the EXIF thumb.

Hope this helps, and my continued thanks!

Mike Chaney
PixAndMore Posted - May 30 2018 : 03:20:18
Hi Nigel,

I have the problem that no image is loaded when I set:
GetThumbnail := True;
UseLibRaw := True;

Example Image:
https://cloud.xatosch.de/index.php/s/FENFqbJMgtow5WL

Setting UseLibRaw := False loads "something"...

Regards, Kai
xequte Posted - May 29 2018 : 18:53:24
Hi Mike

In my testing today, I could not find many images that included a higher resolution preview. Do you have some test images that include a preview, but you are not seeing that with ImageEn?


Nigel
Xequte Software
www.imageen.com
MikeyC Posted - May 29 2018 : 10:31:21
Thanks for the great support! On the topic of getting the camera JPEG, I must be doing something wrong. I can set GetThumbnail to true and load the raw either via TImageEnIO.loadfromfile or TIOParams.read and the image I get is always the EXIF thumbnail (160x120). I'm not getting the camera JPEG like I do from DCraw. Maybe I'm not using the proper function(s)?

Thanks again

Mike Chaney
xequte Posted - May 29 2018 : 02:58:27
> Would it be possible to implement LibRaw's user WB parameter?

We've added RAW_UserWhiteBalance to 8.0.0.


> When you set params.RAW_Interpolation:=ieRAWInterpolationDCB for loading a raw via LibRaw,
> it seems to use about 5x more memory than I would expect.

Interpolation is performed by LibRaw so we cannot do anything about that.


> Add the ability to extract the camera generated JPG.

This is already supported. When you enable GetThumbnail it actually gets the embedded JPEG (not the thumbnail) from dcraw and libraw, which will be something like a 700x500 image.

Nigel
Xequte Software
www.imageen.com
MikeyC Posted - May 27 2018 : 10:16:36
One more thing that would be nice to have in the next release is the ability to extract the camera generated JPG. DCraw could do that: it's typically an embedded JPEG that is 1/4 the size of the raw. I typically use that function when generating thumbnails because it loads almost as fast and it isn't the tiny size of a thumbnail which are typically 160x120 or 320x240, etc.

Mike

Mike Chaney
MikeyC Posted - May 26 2018 : 09:54:17
In 8.0.0, do you think it would be possible to implement LibRaw's user WB parameter?

float user_mul[4];
dcraw keys: -r mul0 mul1 mul2 mul3
4 multipliers (r,g,b,g) of the user's white balance.

This would allow you to set mul0, mul1, mul2, mul3 to 1.0 to get a raw photo as shot (with no white balance), allow the user to click on a spot to white balance, and calculate your own mul0, mul1, mul2, mul3 to set for the next load.

Thanks,
Mike

Mike Chaney
MikeyC Posted - May 25 2018 : 12:51:04
Sounds good! Thanks for the help. I did notice one more anomaly in my testing. When you set params.RAW_Interpolation:=ieRAWInterpolationDCB for loading a raw via LibRaw, it seems to use about 5x more memory than I would expect. That's the best interpolation method and I'd like to use it but it uses 840MB of memory just to open the raw file on a 24 megapixel raw. For a 24 megapixel raw, I'd expect it to use maybe 150MB max if you are using NativePixelFormat. The other methods seem to use around that value but params.RAW_Interpolation:=ieRAWInterpolationDCB uses many times that. Don't know if that's something that can be addressed.

Regards,
Mike

Mike Chaney
xequte Posted - May 24 2018 : 23:24:54
Hi Mike

In v8.0.0 you will be able to disable meta-data loading. It makes it approx twice as fast when getting file info for RAW images in my testing

var
  io: TImageEnIO;
begin
  IEGlobalSettings().UseLibRaw := True;
  io := TImageEnIO.create(nil);
  io.Params.GetMetaData := False;
  io.ParamsFromFile( 'C:\image.arw' );
  ... Do something with params ...
  io.free;
end;


Nigel
Xequte Software
www.imageen.com
MikeyC Posted - May 24 2018 : 12:18:08
Thanks Nigel,

I've solved the red and blue scaling by doing the scaling myself but I'm still having issues with the EXIF reading being slow. The code that I'm using is simple:

iop:=TIOParams.create(nil);
if iop.read(filename) then
<code to process params>

The single statement iop.read(filename) takes about 200ms on a decently equipped 3.8 Ghz octocore AMD machine. 200ms might not seem that bad but if you are reading EXIF info for say 100 raw photos while processing thumbs in order to sort by EXIF date, that's 20 seconds just to read the EXIF info for 100 raws. The speed issue only seems to be a problem with raw photos.

All raw photos seem to take the same ~200ms but here's one I've been working with if you need one to test:

https://www.imaging-resource.com/PRODS/sony-a7/AA7hVFAI00100.ARW.HTM

Regards,
Mike

Mike Chaney
xequte Posted - May 23 2018 : 17:29:18
Hi Mike


Regarding the RAW_RedScale and RAW_BlueScale query, can you please supply your test image and advise what you are trying to achieve.

In our testing EXIF processing has a negligible effect on speed, can you show me the code you are using to test.




Nigel
Xequte Software
www.imageen.com
MikeyC Posted - May 22 2018 : 12:58:58
OK. Thanks. I did mean RAW_RedScale and RAW_BlueScale but those don't do what I would expect. They seem to actually scale the size of the image rather than scaling the WB multipliers so you end up with the red and blue planes not aligned with the green. Maybe I was expecting them to do something they weren't designed to do?

The other thing I've found is that TIOParams.read seems to be very slow. I think it might be because all of the EXIF data is being read instead of what I was using in DCraw that only read the essentials such as make, model, shutter, and a few others. It doesn't really show up until you are processing a folder of a few dozen raws, but is there a way to tell the read command to load fewer parameters? Or any way to spead up the read?

Thanks again,
Mike

Mike Chaney
xequte Posted - May 17 2018 : 19:14:34
Hi Mike

In 8.0.0 (ready in a couple of weeks) you can use the new property RAW_OutputColorSpace. If you set:

ImageEnView.IOParams.RAW_OutputColorSpace := iercsRAW;

This is the same as using "-o" parameter.

Regarding "raw_red_bias" and "raw_blue_bias", do you mean the RAW_RedScale and RAW_BlueScale properties? They work correctly in our testing:

ImageEnView.IOParams.RAW_RedScale := 0.2;



Nigel
Xequte Software
www.imageen.com