Group Abstract Group Abstract

Message Boards Message Boards

1
|
12.2K Views
|
4 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Recover highlight and shadow detail from RAW images?

Posted 10 years ago
POSTED BY: Jeff Burns
4 Replies
Posted 10 years ago

So, what was the source of the problem? Was is too rough default binning by ImageHistogram (default is 128 bins)?

Apparently imported image contains no out-of range values:

ImageData[img] // MinMax
(* =>  {0., 1.} *)

But a naive attempt to obtain it directly from the "Data" element by applying Rescale to each color channel separately produces a slightly different image:

data = Import["DSC_2106.NEF", "Data"];
img = Import["DSC_2106.NEF"];

subimage = ImageTake[img, {-4500, -3000}, {1300, 2700}];
subimageFromData = 
 Image[Rescale /@ Transpose[N@data[[-4500 ;; -3000, 1300 ;; 2700]], {2, 3, 1}], 
  Interleaving -> False];

ImageData[subimageFromData] - ImageData[subimage] // MinMax

(* => {0., 0.0346075} *)
POSTED BY: Updating Name
Posted 10 years ago

Test NEF files are a available at this link.

Using this code it is apparent that the image data is not clipped by Mathematica.

img = Import[“a.NEF”];

ImageHistogram[img, 1000, All, Appearance -> "Transparent", 
   Method -> #, ImageSize -> Large, 
   FrameTicks -> True] & /@ {"IncludeOutOfRange", "ExcludeOutOfRange"}
POSTED BY: Jeff Burns
Posted 10 years ago

If you provide your ".nef" file,you will receive more better solution maybe.And I have a related answer here,hope to help.

POSTED BY: Yode Japhe

Whenever you post here, post your code! it's part of the rules... thanks you :)

Did you use

Import["yourimage.nef"]

or

Import["yourimage.nef","Data"]

or

Import["yourimage.nef","RawData"]

?

POSTED BY: Sander Huisman
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard