Questions about the histogram differences between original image and displayed image

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Questions about the histogram differences between original image and displayed image

Yiwei Zhang
Hi,

I have created a test program to get the data from input image and display the image data in a new window

I noticed that the histograms of the original image and newly displayed image are quite different, although the displayed images are the same.

So why there are such differences?  The attached are the histogram images

The reading and writing are as follows:

template<typename T>
   void readImage(T* pData, int row, int col, int rows, int cols, double *buf)
   {
          double  pixelval =  static_cast<double>(*pData);
      
 buf[row*cols+col] = pixelval;
   }

template<typename T>
void displayImage(T* pData, double *pbuf, int row, int col, int rowSize, int colSize)
   {
       
           double pixelVal = pbuf[row*colSize+col];

   *pData = static_cast<T>(pixelVal);

   } 

------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model
configuration take the hassle out of deploying and managing Subversion and
the tools developers use with it. Learn more about uberSVN and get a free
download at:  http://p.sf.net/sfu/wandisco-dev2dev

_______________________________________________
Opticks-devs mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/opticks-devs

Histgram_Original.JPG (151K) Download Attachment
Histgram_New.JPG (154K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Questions about the histogram differences between original image and displayed image

Kip Streithorst
Administrator

If you right-click on the histogram window for the original image and select “Bad Values…”.  I suspect you will see a bad value listed and if you make the bad value the same on the new image I would expect the histograms to match perfectly.  If they still don’t you might be displaying different bands in each image.

 

If that works let me know and I can point you in the right direction in the API to copy the bad values over.

 

Thanks,

Kip

 

 

From: Yiwei Zhang [mailto:[hidden email]]
Sent: Wednesday, August 10, 2011 2:13 PM
To: [hidden email]
Subject: [Opticks-devs] Questions about the histogram differences between original image and displayed image

 

Hi,

 

I have created a test program to get the data from input image and display the image data in a new window

 

I noticed that the histograms of the original image and newly displayed image are quite different, although the displayed images are the same.

 

So why there are such differences?  The attached are the histogram images

 

The reading and writing are as follows:

 

template<typename T>

   void readImage(T* pData, int row, int col, int rows, int cols, double *buf)

   {

          double  pixelval =  static_cast<double>(*pData);

      

             buf[row*cols+col] = pixelval;

   }

 

template<typename T>

void displayImage(T* pData, double *pbuf, int row, int col, int rowSize, int colSize)

   {

       

           double pixelVal = pbuf[row*colSize+col];

 

               *pData = static_cast<T>(pixelVal);

 

   } 


This message and any enclosures are intended only for the addressee.  Please  
notify the sender by email if you are not the intended recipient.  If you are  
not the intended recipient, you may not use, copy, disclose, or distribute this  
message or its contents or enclosures to any other person and any such actions  
may be unlawful.  Ball reserves the right to monitor and review all messages  
and enclosures sent to or from this email address.

------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model
configuration take the hassle out of deploying and managing Subversion and
the tools developers use with it. Learn more about uberSVN and get a free
download at:  http://p.sf.net/sfu/wandisco-dev2dev

_______________________________________________
Opticks-devs mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/opticks-devs