unknown view type

I am trying to generate a hdri image from my camera Nikon D90 using various lenses. My Nikon camera generates a .NEF file in RAW version however I was able to generate a .HDR file using .JPG of the same images in Photoshop. After I generated the .HDR file I tried running evalglare on it which gives me an error. I understand I need to have a fish eye lens to get the full view in order to get the correct results but the purpose of my experiment is to test the error in dgp using different lenses that are not fish eye lens. I am using the -vth command and have entered the -vv and -vh as calculated for the 35mm lens on a DX format camera (25.74degrees and 37.4degrees). This gives me an error pict_update_view: unknown view type and error: invalid view specified. Can anyone please let me know where I am going wrong.

Thanks,
Avinash

Hello Avinash,

There are two possible issues that I can think of: one regarding image size (more likely culprit), and the second regarding metadata (less likely). I am pretty sure the image size issue will solve your problem, but you may also get improved results using images processed in a slightly different way. Here are possible solutions:

SOLVING THE IMAGE SIZE ISSUE

Depending on the exact pixel count of your hdr, you need to make slight adjustments to one of your image angle values. Using a camera and lens similar to yours (Nikon D90 & AF-S Nikkor 35mm 1:1.8G), I collected a series of raw and .jpg processed images. In my 3 experiments, I got the following image sizes (shown with Matlab code):

nef = [4310 2868];
jp1= [4288 2848];
jp2= [1936 1286];

According to your notes, you set vv and vh as follows:

vv = 25.74
vh = 37.4

Now, I will recompute vv according to the pixel values and vh noted above, which will show slightly different vv values:

vv_t1 = 2*atand(nef(2)/nef(1)*tand(vh/2))
vv_t2 = 2*atand(jp1(2)/jp1(1)*tand(vh/2))
vv_t3 = 2*atand(jp2(2)/jp2(1)*tand(vh/2))

Notice that the answers are slightly different than vv above:

vv_t1 = 25.3864
vv_t2 = 25.3403
vv_t3 = 25.3431

A detailed explanation is available in this posting from May 16, 1994: http://radsite.lbl.gov/radiance/digests_html/v2n7.html#VIEW_ANGLES

SOLVING POSSIBLE METADATA ISSUE

I am not sure if this will help, but I suspect another culprit may be either missing metadata in your Photoshop .jpg images, or (maybe but not likely) the .hdr algorithm in Photoshop. I've tested the following 3 possible solutions using the same D90 and hdrgen wrapper variants--all of which seem to preserve the metadata in the images, and produce photometrically accurate results (list members, please correct me if I am wrong about the above metadata assumptions)...

Method 1)

To process .nef images, see Greg's suggestion posted on February 20, 2012: http://www.radiance-online.org/pipermail/hdri/2012-February/000363.html. This seems to be the best raw to hdr method, as it seems to produce the most photometrically accurate images.

My line of code looks like this: raw2hdr -o test01.hdr *.NEF (although I should have included a calibration image).

Or, to use .jpg images, which are less accurate photometrically (but still works), try either of the following procedures:

Method 2)

With .nef images still in the Nikon D90, use on-board post processing of .nefs to .jpgs. That should give you the right metadata embedded in the .jpgs, which may have been lost in the Photoshop .nef to .jpg conversion process. I've tried this method, and it works. On the D90: Press play-->select image-->press "ok"-->NEF (RAW) Processing-->(Chose your favorite settings)-->EXE. Repeat that process for each image. Then create the .hdr using hdrgen, Photosphere, or the online tool. I used Photosphere in this case.

Method 3)

You can do batch processing (.nef->.jpg), using Nikon's ViewNX 2 on your computer, as follows: Select your images, then: File-->Convert Files-->Convert. I've also verified that images from this method work with Photosphere. Or create .hdr with Photosphere, hdrgen, or the online tool.

Note that with methods 2 or 3, you will have .jpg images that will be processed using hdrgen or photosphere (or maybe Photoshop). Keep in mind that Method 1 is the most difficult to set up, but will produce the best (i.e., most photometrically accurate) results.

I hope these suggestions help (and don't lead you astray).
-Chris

···

On 4/23/13 10:31 PM, Avinash Gautam wrote:

I am trying to generate a hdri image from my camera Nikon D90 using various lenses. My Nikon camera generates a .NEF file in RAW version however I was able to generate a .HDR file using .JPG of the same images in Photoshop. After I generated the .HDR file I tried running evalglare on it which gives me an error. I understand I need to have a fish eye lens to get the full view in order to get the correct results but the purpose of my experiment is to test the error in dgp using different lenses that are not fish eye lens. I am using the --vth command and have entered the --vv and --vh as calculated for the 35mm lens on a DX format camera (25.74degrees and 37.4degrees). This gives me an error */pict_update_view: unknown view type /*and */error: invalid view specified/*. Can anyone please let me know where I am going wrong.

Thanks,

Avinash

//

_______________________________________________
HDRI mailing list
[email protected]
http://www.radiance-online.org/mailman/listinfo/hdri

Hi Avinash,

Just a followup: I was able to install and run evalglare on the .hdr created from last night's .nef files (Method 1). I then performed the following two operations:

pfilt -1 -x /4 -y /4 test01.hdr>test01s.hdr
evalglare -c test01g.hdr test01s.hdr

Everything seemed to work (i.e., I got a grayscale output image with a green 'glare' mask). I suspect that since the header information (I was calling it 'metadata' before) was already in the image, there was no need to add -vtv, or declare -vv -vh. Here is what I found in my test01s.hdr header:

#?RADIANCE
CAMERA= NIKON D90 version dcraw v9.12
hdrgen created HDR image from '_DSC3776.tif' '_DSC3775.tif' '_DSC3774.tif' '_DSC3773.tif' '_DSC3772.tif'
EXPOSURE=3.280407e+00
VIEW= -vtv -vh 37.200130 -vv 25.245402
CAPDATE= 2013:04:23 23:46:20
PRIMARIES= 0.6400 0.3300 0.3000 0.6000 0.1500 0.0600 0.3127 0.3290
FORMAT=32-bit_rle_rgbe
pfilt -1 -x /4 -y /4

I hope this helps...
-Chris

···

On 4/23/13 10:31 PM, Avinash Gautam wrote:

I am trying to generate a hdri image from my camera Nikon D90 using various lenses. My Nikon camera generates a .NEF file in RAW version however I was able to generate a .HDR file using .JPG of the same images in Photoshop. After I generated the .HDR file I tried running evalglare on it which gives me an error. I understand I need to have a fish eye lens to get the full view in order to get the correct results but the purpose of my experiment is to test the error in dgp using different lenses that are not fish eye lens. I am using the --vth command and have entered the --vv and --vh as calculated for the 35mm lens on a DX format camera (25.74degrees and 37.4degrees). This gives me an error */pict_update_view: unknown view type /*and */error: invalid view specified/*. Can anyone please let me know where I am going wrong.

Thanks,

Avinash

//

_______________________________________________
HDRI mailing list
[email protected]
http://www.radiance-online.org/mailman/listinfo/hdri

Hi Chris,

I think Adobe Photoshop must have messed up with the header files while creating the HDR. I was about to try the methods you sent in your earlier email but seems there is a shorter route by using hdrgen or photosphere to create the HDR file. I am a novice in this area and your help is really appreciated.

Thanks again for all your help.

Regards,
Avinash

···

From: Chris Kallie [mailto:[email protected]]
Sent: Wednesday, April 24, 2013 10:28 AM
To: [email protected]
Subject: Re: [HDRI] unknown view type

Hi Avinash,

Just a followup: I was able to install and run evalglare on the .hdr created from last night's .nef files (Method 1). I then performed the following two operations:

pfilt -1 -x /4 -y /4 test01.hdr>test01s.hdr
evalglare -c test01g.hdr test01s.hdr

Everything seemed to work (i.e., I got a grayscale output image with a green 'glare' mask). I suspect that since the header information (I was calling it 'metadata' before) was already in the image, there was no need to add -vtv, or declare -vv -vh. Here is what I found in my test01s.hdr header:

#?RADIANCE
CAMERA= NIKON D90 version dcraw v9.12
hdrgen created HDR image from '_DSC3776.tif' '_DSC3775.tif' '_DSC3774.tif' '_DSC3773.tif' '_DSC3772.tif'
EXPOSURE=3.280407e+00
VIEW= -vtv -vh 37.200130 -vv 25.245402
CAPDATE= 2013:04:23 23:46:20
PRIMARIES= 0.6400 0.3300 0.3000 0.6000 0.1500 0.0600 0.3127 0.3290
FORMAT=32-bit_rle_rgbe
pfilt -1 -x /4 -y /4

I hope this helps...
-Chris

On 4/23/13 10:31 PM, Avinash Gautam wrote:
I am trying to generate a hdri image from my camera Nikon D90 using various lenses. My Nikon camera generates a .NEF file in RAW version however I was able to generate a .HDR file using .JPG of the same images in Photoshop. After I generated the .HDR file I tried running evalglare on it which gives me an error. I understand I need to have a fish eye lens to get the full view in order to get the correct results but the purpose of my experiment is to test the error in dgp using different lenses that are not fish eye lens. I am using the -vth command and have entered the -vv and -vh as calculated for the 35mm lens on a DX format camera (25.74degrees and 37.4degrees). This gives me an error pict_update_view: unknown view type and error: invalid view specified. Can anyone please let me know where I am going wrong.

Thanks,
Avinash

_______________________________________________

HDRI mailing list

[email protected]<mailto:[email protected]>

http://www.radiance-online.org/mailman/listinfo/hdri

Yes, Photoshop strips the header from Radiance (HDR) images, including the view parameters. You can always add them back in afterwards using the Radiance "vinfo" command (on Unix anyway). You'll still have the problem that Photoshop doesn't do any kind of absolute calibration on HDR images, so if evalglare needs absolute quantities, it won't have them. Adding the correct exposure requires having an in-scene luminance measurement for calibration.

This is why it's generally better to use hdrgen or Photosphere for HDR creation in photometric applications, although a calibration measurement will improve your accuracy even more.

Cheers,
-Greg

···

From: Avinash Gautam <[email protected]>
Date: April 24, 2013 9:37:03 AM PDT

Hi Chris,

I think Adobe Photoshop must have messed up with the header files while creating the HDR. I was about to try the methods you sent in your earlier email but seems there is a shorter route by using hdrgen or photosphere to create the HDR file. I am a novice in this area and your help is really appreciated.

Thanks again for all your help.

Regards,
Avinash

Greg confirmed my foggy memory about Photoshop and hdr headers. Just a couple quick thoughts I wanted to share... If you have extra time and energy, consider trying Greg's raw2hdr script (http://www.radiance-online.org/pipermail/hdri/2012-February/000363.html). However, there's really no problem with using jpegs and hdrgen/photosphere. I have personally found that with creating and using a good calibration method and file (see this: http://www.jaloxa.eu/webhdr/calibrate.shtml), and being consistent with the whitebalance setting, the jpeg method produces extremely accurate luminance images (r^2 > .996). As Greg just mentioned, a photometer to dial in the range would further improve the 1:1 hdr to real photometric values. Finally, I will cautiously note that in one experiment, I found that jpegs were more accurate than nefs (perhaps due to random fluctuations in estimating the calibration response curve), but I haven't repeated that experiment. For both image types (jpg and nef), the covariances between image sample and photometer were still extreme (r^2 ~ .99).

Happy imaging!
Chris

···

On 4/24/13 12:09 PM, Gregory J. Ward wrote:

Yes, Photoshop strips the header from Radiance (HDR) images, including the view parameters. You can always add them back in afterwards using the Radiance "vinfo" command (on Unix anyway). You'll still have the problem that Photoshop doesn't do any kind of absolute calibration on HDR images, so if evalglare needs absolute quantities, it won't have them. Adding the correct exposure requires having an in-scene luminance measurement for calibration.

This is why it's generally better to use hdrgen or Photosphere for HDR creation in photometric applications, although a calibration measurement will improve your accuracy even more.

Cheers,
-Greg

*From: *Avinash Gautam <[email protected] <mailto:[email protected]>>

*Date: *April 24, 2013 9:37:03 AM PDT

*

Hi Chris,

I think Adobe Photoshop must have messed up with the header files while creating the HDR. I was about to try the methods you sent in your earlier email but seems there is a shorter route by using hdrgen or photosphere to create the HDR file. I am a novice in this area and your help is really appreciated.

Thanks again for all your help.

Regards,

Avinash

_______________________________________________
HDRI mailing list
[email protected]
http://www.radiance-online.org/mailman/listinfo/hdri