title: Why are my grayscale images showing up in black and white?
body: <p>I am doing some tests in opencv, looking at blurring and the result in discrete cosine transform (increasing kernel size with each loop).  I want to display the image and the dct result in the same frame so I can compare.  </p>
  
  <p>When I display them in separate frames, they look good.  But when I use np.hpstack or np.concatenate to display the blurred image and the dct, the grayscale image becomes really thresholded.  I can see a bit of black with kernel size 1, but after that it pretty much goes white after that in my loop.</p>
  
  <pre><code>import cv2
  import numpy as np
  img = cv2.imread('lena.jpg')
  img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
  
  for i in xrange(1,31,2):
      median_blur = cv2.medianBlur(img,i)
      string = 'median_blur : kernel size - '+str(i)
      imf = np.float32(median_blur)/255.0  # float conversion/scale
      dst = cv2.dct(imf)           # the dct
      img2 = np.uint8(dst)*255.0    # convert back
      cv2.putText(median_blur,string,(20,20),cv2.FONT_HERSHEY_COMPLEX_SMALL,1,(0,0,0))
      vis = np.hstack([median_blur,img2])
  
      cv2.imshow('Blur',median_blur)
      cv2.imshow('dct',img2)
      cv2.imshow('together', vis)
      cv2.waitKey(500)
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/RkLlg.png" alt="enter image description here"></p>
  
  <p>I think it must have something to do with median_blur and img2 being of different dimensions but I am confused because they display ok by themselves. Sorry but my screenshot cut off a bit of the 'together' window.  I am using greyscale because the dct only works on one channel at a time as far as I know.</p>