Hexagon Geospatial
MENU

ERDAS IMAGINE

Discuss and share topics of interest using ERDAS IMAGINE the world’s leading geospatial data authoring system.
Showing results for 
Search instead for 
Do you mean 
Reply
Frequent Contributor
Posts: 106
Registered: ‎06-04-2016

HOWTO: Get PhotometricInterpretation

I ran into a situation where a Clump operation either yielded the linework on my image or everything but the linework. That behavior was controlled by the PhotometricInterpretation in TIF image, which dictates which pixel value/color on the image represents the background. Some of my images were black ink on a white background (PhotometricInterpretation = 0), while some were negatives (white ink on a black background. PhotometricInterpretation = 1). 

 

There isn't a direct way to simply read tag info off of a TIF, but you could "estimate" the PhotometricInterpretation using the Statistics operator's Median port. If the Median is 0, the background color is black (PhotometricInterpretation = 1). If 1, the background color is white (PhotometricInterpretation = 0).

 

 

test.png

Technical Evangelist
Posts: 731
Registered: ‎10-01-2015

Re: HOWTO: Get PhotometricInterpretation

[ Edited ]

Part of the development plans for ERDAS IMAGINE 2017 include improvements to Spatial Modeler's Metadata handling capabilities, which should make this a lot easier.

 

In the meantime (or should that be "mediantime"?) using this approach is an excellent solution for 1-bit scanned data. I wonder if using Mode would work if you have a larger bit-depth (and working on the same assumption that the "background" colour constitutes the largest single "class" of the scanned map)?

Ian Anderson
Chief Product Owner, Desktop Remote Sensing
Hexagon Geospatial
Frequent Contributor
Posts: 106
Registered: ‎06-04-2016

Re: HOWTO: Get PhotometricInterpretation

Hi Ian!

 

That's a great idea, but I was suspicious of Mode. Although it's possible for mode to equal to min, I just didn't expect that in my dataset.

 

I used QGIS to export my layer attributes to an "Excel" file (actually, Calc) and computed Min and Mode on M_AREA there. I then copied M_AREA into MiniTab and computed mode.

 

 

        -- MODE --
ERDAS:  0.00000556 // 2-orders of magnitude! EXCEL: 0.00055000 MINITAB:0.00057222 // good grief, no consensus

 

Regards

 

 

 

Untitled.png

 

Untitled2.png

 

 

 

Technical Evangelist
Posts: 731
Registered: ‎10-01-2015

Re: HOWTO: Get PhotometricInterpretation

I guess the fact that ERDAS IMAGINE is getting the same value for Min and Mode does indicate that Mode successfully finds the background value. But I have no idea why that value would be so markedly different from the other packages.

 

Mode will work well in the case of raster inputs (lots of pixels with the same value), but you're doing it on a table of Area values - I wouldn't know what the "most commonly occurring area value" would be in that instance (especially given that these are Float values - so there are unlikely to be several occurrences of exactly the same float value). Did you visually scan through your table list to see if things like Min, Max, etc appeared valid ( I see that Min varies wildly as well, but should be easy to spot in the list)?

Ian Anderson
Chief Product Owner, Desktop Remote Sensing
Hexagon Geospatial
Frequent Contributor
Posts: 106
Registered: ‎06-04-2016

Re: HOWTO: Get PhotometricInterpretation

Hi Ian,

The expectation mode would yield the most frequently occurring area was a logic error on my part.

I've since rounded those area values and applied a tolerance to get my target records. That trick allows my model to self-tune a param based on input data, rather than rely on prior knowledge.

Regards
Do you need immediate support?
If you encounter a critical issue and need immediate assistance please submit a Service Request through our Support Portal.