# Reflectance Estimation

#41

I don’t understand how dou you can calculate K. In my case, I applied the formula shared by SEQ-AN-01, and I obtain this:

But now, I don’t know how to calculate the reflectance with the paramenters shared here.

#42

Hi @elliot1993, your question reminded me of pain and suffering (not more than 6 months ago) related to the exact same issue. Therefore I have decided to resolve it for once and for all. Please find the document that briefly explains How to convert Sequoia images to reflectance.

In case anyone finds any mistake in it please report it to me via personal message (I may not look at this post).

#43

v1.1 of the document has been released. FAQ section has been added and Irradiance List section has been updated.

#44

Firstly, I want to say thank you to prepare document about convert raw sequoia images to reflectance. Thanks to your document I start to understand how sequoia works. I am so grateful to you.

I don’t understand one part of this document. When we calculate of sunshine irradiance, we use this formula.

Iss’= k1 x (V/(g*t))= k1 x Iss

-We use Iss instead of Iss’
-t is exposure time which exist in the exif data of image.
-v is CHO count.
-g is relative gain factor.

Relative gain factor not clear for me. Because we have 4 gain index and which one is suitable for us. Which one we should rate. You say in your documents, sequoia use gain1 so CHO value is clear (330 in your example). But what is the relative gain? gainO/gain1 (11/330) or gain1/gain2 (330/3990) or gain2/gain1(3990/330)

#45

Hi community,

I am a researcher of a University and the past month we aquired the multi-spectral Sequoia camera. The problem which I would like to share in this forum is relative to the reflectance calculation. I am processing an image belong to the NIR band and I must know the reflectance for each pixel. By default, We know the DN( Digital Number) for our image (1280x960 resolution). How could I get the reflectance value? I know the formula to apply but the image does not contain the params in the metadata information.

J.J.

#46

@jjurado, the image does have the params to apply. Its just that the params are burried deep inside the metadata. You can read the exif meta data using exittool.

In case you still feel that your image doesn’t have the metadata, you can upload a sample image and I can take a look on that.

#47

Hi community,
@domenzain @muzammil360
I ask help to calculate the sunshine irradiance. I don’t know the steps needed to get this value. I have read the exif data of my image and I have alredy calculated the sequoia irradiance for each pixel. However, to obtain the reflectance value firstly I have to calculate the sunshine irradiance and K value. Could you guide me?

J.J.

#48

Dear @jjurado, the first step in calculating Sunshine Irradiance is extracting the IrradianceList data in exif. This tag has all the essential information you need to compute sunshine irradiance. For some reason, the data in IrradianceList is BASE64 encoded. Therefore, first step would be to decode the BASE64 data. Once you have that, rest of the process is pretty simple and I can guide you how to do that later.

#49

@muzammil360 I have tested different c++ methods to BASE64 decode the IrradianceList tag and I don’t get any good result. I have extracted the string belong to this tag but when I try to decode, it does not work. The code used is:

static std::string base64_decode(const std::string &in) {

``````std::string out;

std::vector<int> T(256,-1);
for (int i=0; i<64; i++) T["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[i]] = i;

int val=0, valb=-8;
for (uchar c : in) {
if (T[c] == -1) break;
val = (val<<6) + T[c];
valb += 6;
if (valb>=0) {
out.push_back(char((val>>valb)&0xFF));
valb-=8;
}
}
return out;
``````

}

J.J.

#50

Well, the result that you get out of BASE64 decoding needs to be interpreted properly. Let me share some material with you that will allow you to interpret it correctly.

I know this sounds annoying but onces you will understand it, it will start to make sense.

#51

Okey, I have tested the same decoded method in c++ with others “string” examples and it works fine. I hope your help.

#52

The Sunshine Irradiance tag is detailed on another thread. Look for `IrradianceList` amongst the topics or follow this link to a working implementation in that same thread. @seanmcleod helpfully provided it.

#53

Hi @muzammil360 and @domenzain,

I have extracted all information of structures array like you can see in the follow image:

I have calculated Sequoia Irradiance and the follow stept is the calculation of Sunshine Irradicance. I have to apply this formula: but I don’t understand how I must resolv it. Could you guide me?

Thanks.

J.J.

#54

@jjurado, I am not sure if its correct. There is something that’s telling me that CH0 count should not be less than CH1 count. Besides, I wouldn’t expect Gain_Index to be 1024. Plus the integration time also seems to be HUGE. Plus your Time_Stamp also doesn’t seem to be correct.

Are you sure you are using correct endianness? You should be using little-endian.

Following is what I would expect after decoding:

• Gain index should be [0, 3]
• Integration time ~600
• CH0 is usually greater than CH1
• Time stamp can be converted to normal human readable dateandtime using online converters.

#55

#56

Hi again,

thanks for your help, I had an error in my code but now, it has been resolved. The Irradiancelist tag of my photo is the follow:

I think that this data is correct so now I have to calculate the sunshine sensor irradiance for each image is it correct? My ultimate goal is to calculate the reflectance map of my image @muzammil360 and @domenzain could you guide me to obtain this value?

Thanks!

#57

I only have one question, is the sunshine sensor really used?

• I work with Pix4D and its final results are reflectance maps with values from 0 to 1. Ok

• Following the document SEQ AN 01, I obtain the irradiance. Ok

• My image happens to have values of 0 +20. okay. But from here, what?

After reviewing a thousand times forum information and the very valuable help of @muzammil360 (thanks for your time) , I do not find any satisfactory result except one, which is explained in the official page of Micasense, so:
, , where:

• K: calibration factor for the each band
• Pi: known reflectance of the Calibration Panel
• Avg (Li): average radiance values of the pixels that fall inside the calibration panel

I get values from 0 to 1
Where are the irradiance values used?

#58

@joan.cano, the formula you have used above converts raw pixel values to sequoia irradiance. These is a way to get sunshine irradiance as well. And then two of these along with a calibration coefficient (specific to every fight and camera) are used to compute reflectance. If you have not already, then take a look at this document

#59

Hi everybody,

we are using the Sequoia and the sunshine sensor within our eBee plus drone.
Currently, I try to understand, where, how and when our tif files are processed into reflectance.
We are using eMotion and Pix4D.

I read the entire converstion about the sunshine sensor dilemma on the Parrot Community Forum and the conversation of this developer forum.
To be honest I already fail to find the irradiance measurements and the list in the exif tags.

Would be great, if someone can help me.
I wrote a short python code to print out the exif tags:

``````import exifread

f = open('N:/exiftest/IMG_171108_114510_0000_NIR.tif', 'rb')

# Return Exif tags
print tags

**Result:**

> {'EXIF ApertureValue': (0x9202) Ratio=2147483647/943945856 @ 10316,
>      'EXIF BodySerialNumber': (0xA431) ASCII=PI040378AA6I001305 @ 10414,
>      'EXIF DateTimeDigitized': (0x9004) ASCII=1970:01:01 00:03:09 @ 10288,
>      'EXIF DateTimeOriginal': (0x9003) ASCII=2017:11:08 11:45:10 @ 10268,
>      'EXIF ExifImageLength': (0xA003) Long=960 @ 10152,
>      'EXIF ExifImageWidth': (0xA002) Long=1280 @ 10140,
>      'EXIF ExposureMode': (0xA402) Short=Auto Exposure @ 10200,
>      'EXIF ExposureTime': (0x829A) Ratio=3865470/2147483647 @ 10244,
>      'EXIF FNumber': (0x829D) Ratio=2147483647/976128896 @ 10252,
>      'EXIF FocalLength': (0x920A) Ratio=2147483647/539568768 @ 10332,
>      'EXIF FocalLengthIn35mmFilm': (0xA405) Short=30 @ 10212,
>      'EXIF FocalPlaneResolutionUnit': (0xA210) Short=4 @ 10188,
>      'EXIF FocalPlaneXResolution': (0xA20E) Ratio=2147483647/8053064 @ 10364,
>      'EXIF FocalPlaneYResolution': (0xA20F) Ratio=2147483647/8053064 @ 10372,
>      'EXIF ISOSpeedRatings': (0x8827) Short=400 @ 10008,
>      'EXIF ImageUniqueID': (0xA420) ASCII=7324E23E672B24115EC6BAF84BD804D5 @ 10380,
>      'EXIF MaxApertureValue': (0x9205) Ratio=2147483647/943945856 @ 10324,
>      'EXIF ShutterSpeedValue': (0x9201) Signed Ratio=2147483647/235526848 @ 10308,
>      'EXIF SpectralSensitivity': (0x8824) ASCII=790 nm @ 10260,
>      'EXIF SubSecTime': (0x9290) ASCII=172315 @ 10340,
>      'EXIF SubSecTimeDigitized': (0x9292) ASCII=395161 @ 10356,
>      'EXIF SubSecTimeOriginal': (0x9291) ASCII=172315 @ 10348,
>      'EXIF Tag 0x9211': (0x9211) Long=0 @ 10092,
>      'GPS GPSAltitude': (0x0006) Ratio=120697441/1000000 @ 10644,
>      'GPS GPSAltitudeRef': (0x0005) Byte=0 @ 10504,
>      'GPS GPSDate': (0x001D) ASCII=2017:11:08 @ 10692,
>      'GPS GPSLatitude': (0x0002) Ratio=[54, 9, 33001569/1000000] @ 10596,
>      'GPS GPSLatitudeRef': (0x0001) ASCII=N @ 10456,
>      'GPS GPSLongitude': (0x0004) Ratio=[13, 23, 3739209/250000] @ 10620,
>      'GPS GPSLongitudeRef': (0x0003) ASCII=E @ 10480,
>      'GPS GPSMapDatum': (0x0012) ASCII=WGS-84 @ 10684,
>      'GPS GPSSpeed': (0x000D) Ratio=2147483647/54907012 @ 10676,
>      'GPS GPSSpeedRef': (0x000C) ASCII=K @ 10552,
>      'GPS GPSStatus': (0x0009) ASCII=A @ 10540,
>      'GPS GPSTimeStamp': (0x0007) Ratio=[11, 45, 5131/500] @ 10652,
>      'GPS GPSVersionID': (0x0000) Byte=[2, 2, 0, 0] @ 10444,
>      'Image ApplicationNotes': (0x02BC) Byte=[] @ 2940,
>      'Image BitsPerSample': (0x0102) Short=16 @ 54,
>      'Image Compression': (0x0103) Short=Deflate @ 66,
>      'Image DateTime': (0x0132) ASCII=2017:11:08 11:45:10 @ 2920,
>      'Image ExifOffset': (0x8769) Long=9962 @ 246,
>      'Image GPSInfo': (0x8825) Long=10434 @ 258,
>      'Image ImageDescription': (0x010E) ASCII=790 nm @ 328,
>      'Image ImageLength': (0x0101) Short=960 @ 42,
>      'Image ImageWidth': (0x0100) Short=1280 @ 30,
>      'Image Make': (0x010F) ASCII=Parrot @ 336,
>      'Image MinSampleValue': (0x0118) Short=0 @ 174,
>      'Image Model': (0x0110) ASCII=Sequoia @ 344,
>      'Image PhotometricInterpretation': (0x0106) Short=1 @ 78,
>      'Image PlanarConfiguration': (0x011C) Short=1 @ 186,
>      'Image Predictor': (0x013D) Short=Horizontal differencing @ 222,
>      'Image RowsPerStrip': (0x0116) Short=3 @ 150,
>      'Image SamplesPerPixel': (0x0115) Short=1 @ 138,
>      'Image Software': (0x0131) ASCII=v1.2.1 @ 2912,
>      'Image StripByteCounts': (0x0117) Long=[4439, 4438, 4428, 4464, 4417, 4461, 4425, 4422, 4449, 4450, 4476, 4449, 4492, 4461, 4470, 4459, 4451, 4463, 4491, 4482, ... ] @ 1632,
>      'Image StripOffsets': (0x0111) Long=[10704, 15144, 19582, 24010, 28474, 32892, 37354, 41780, 46202, 50652, 55102, 59578, 64028, 68520, 72982, 77452, 81912, 86364, 90828, 95320, ... ] @ 352,
>      'Image Tag 0x000B': (0x000B) ASCII=eMotion 3.3.4 @ 314,
>      'Image Tag 0xC619': (0xC619) Short=[2, 2] @ 270,
>      'Image Tag 0xC61A': (0xC61A) Long=[5400, 5376, 5356, 5368] @ 9894,
>      'Image Tag 0xC62F': (0xC62F) ASCII=PI040378AA6I001305 @ 9910,
>      'Image Tag 0xC68B': (0xC68B) Byte=[73, 77, 71, 95, 49, 55, 49, 49, 48, 56, 95, 49, 49, 52, 53, 49, 48, 95, 48, 48, 48, 48, 95, 78, 73, 82, 46, 84, 73, 70, 0] @ 9930}
``````

So, this is all I get. No “IrradianceCalibrationMeasurement”, no “IrradianceList” at all

#60

First, I would update the Firmware of your camera, you’re at 1.2.1, the most recent is 1.4.1