Select to view content in your preferred language

Grey Image to RGB convertion

1383
5
06-29-2021 04:07 AM
TASL_Virendra
Occasional Contributor

Hi,

I'm trying to convert a grey scale image to RGB, but not able to do so over Qt SDK.

I was able to convert in ArcGIS pro as follows:

  1. .nitf->Input to STRETCH Raster function with Minmax->this give  me a stretch_raster layer.
  2. new Stretch raster layer-> changing symbology by changing color map.
  3. The resultant is shown below
  4. TASL_Virendra_0-1624964676707.png

     

 But samething I'm trying over qt code, I'm not able to do so color map rendering on raster file gives me below output, just single line.

 

TASL_Virendra_1-1624964789562.png

 

does anyone faced similar issue and guide me. If required I can share code.

 

Thanks

Virendra

 

 

0 Kudos
5 Replies
TASL_Virendra
Occasional Contributor

Thanks Lucas for reply!

we have tried that but this is one part of of Grey to RGB, 2nd part to convert Stretch image (0-255) as per user defined colour pallet is not working. if you have any similar example please share it.

 

Thanks

Virendra

0 Kudos
LucasDanzinger
Esri Frequent Contributor

Can you share some of your code for creating the renderer & layer?

0 Kudos
TASL_Virendra
Occasional Contributor

Hi Lucas,

Please find the code in attached file.

It is a trial project, so ignore the coding standard and stuff.

 

Thanks

Virendra

 

0 Kudos
LucasDanzinger
Esri Frequent Contributor

Your code sample reads color values from a text file. What does your `QList<QColor> colors` end up containing? 

 

Also, did you take a look at the ColormapRenderer sample? This assigns color values to each pixel value https://github.com/Esri/arcgis-runtime-samples-qt/blob/main/ArcGISRuntimeSDKQt_CppSamples/Layers/Ras...

0 Kudos