Edit Raster Function does not apply the right colour scheme

639
1
05-19-2017 03:42 AM
OddbjørnLarsen1
New Contributor II

Hi

I exported a template to convert a RGB image to HSV using image analysis. (rtf.xml file)

<RasterFunctionTemplate xsi:type='typens:RasterFunctionTemplate' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xs='http://www.w3.org/2001/XMLSchema' xmlns:typens='http://www.esri.com/schemas/ArcGIS/10.5'><Name>Raster Function Template</Name><Description>A raster function template.</Description><Function xsi:type='typens:ColorspaceConversionFunction'><Name>Color Model Conversion Function</Name><Description>Converts between color models, for example RGB to HSV.</Description><PixelType>U8</PixelType></Function><Arguments xsi:type='typens:ColorspaceConversionFunctionArguments'><Names xsi:type='typens:ArrayOfString'><String>Raster</String><String>ConversionType</String></Names><Values xsi:type='typens:ArrayOfAnyType'><AnyType xsi:type='typens:RasterFunctionVariable'><Name>Raster</Name><Description></Description><Value></Value><IsDataset>true</IsDataset></AnyType><AnyType xsi:type='typens:RasterFunctionVariable'><Name>ConversionType_2017519_102915_628</Name><Description></Description><Value xsi:type='xs:int'>0</Value><IsDataset>false</IsDataset></AnyType></Values></Arguments><Help></Help><Type>0</Type><Thumbnail></Thumbnail><Definition></Definition><Group></Group><Tag></Tag><ThumbnailEx></ThumbnailEx></RasterFunctionTemplate>

When I try to use the tool "Edit raster function" and use this rtf.xml file the input is not correctly transformed, looks like it only uses one band.

This is the output, using the "Edit Raster Function" tool.

Image output using "Edit Raster Function"

And this is the correct output, using "Image Analysis" tool, with the "Color Model Conversion Function" (RGB to HSV)

Image output, using "Image Analysis" tool.

Any help appriciated! Original image attached.

Tags (4)
0 Kudos
1 Reply
GünterDörffel
Occasional Contributor III

Hi Oddbjørn,

I dont think your rtf.xml is wrong or does something wrong. To me it looks as if this is solely a Symbology/Stretchung/Gamma stretch issue caused by defaults you have set. If I copy your code and use, I get excactly what you describe as wanted. The stretch type is percent clip (0.5, 0.5) and the Gamma Stretch used is similar on all bands - 1.31305

If I manually change the Stretch to "none" and remove the gamma stretch, the result is excactly the "blueish" image you show above.

A note on stretch behaviour in ArcGIS/ArcMap: In the ArcMap Options /Raster Tab/Raster Layer Tab you can overwrite the default Stretch behaviour of ArcGIS. Check if you have done so. Without overriding it, the behaviour of ArcGIS is largely controlled by the type of Raster: Go to catalog view and right-click your DGI image, choose properties. There you'll see your image is from Source Type "Generic". There are other source types. See this help chapter to find out what this means for ArcGIS behaviour. "Generic" uses application defaults - and should work just fine and produce what you want - unless you changed something. If you set your image to "Processed" you could expect the (for you wrong=blueish) behaviour you experinced. Feel free to ask if this is not clear. Regards Guenter

0 Kudos