Linked Questions

26 questions linked to/from Display image as grayscale
5 votes
1 answer
10k views

I've been trying to convert an image to grayscale using opencv in Python but it converts the image to some kind of thermal camera image. What am I doing wrong? Here is the code for image below: img =...
4 votes
2 answers
10k views

I see an oddness when loading an image using opencv, convert to grayscale, and plot using matplotlib: from matplotlib import pyplot as plt import argparse import cv2 image = cv2.imread("images/...
captainst's user avatar
  • 657
1 vote
1 answer
6k views

I have the following code: fig, ax = plt.subplots() fig.set_size_inches(10, 10, forward=True) min_val, max_val = 0, 28 inputBild = np.round(np.reshape(inputBild, [28, 28]), 1) plt.imshow(inputBild) ...
user avatar
0 votes
1 answer
4k views

My data is 2D image in format of numpy.array. By the following code: fig = plt.figure() ax = fig.add_subplot(111) ax.imshow(visu_base) plt.show() I get a color image from Python. But, how can I show ...
user avatar
2 votes
1 answer
3k views

I'm trying to convert an image to grayscale and show it using pyplot. The steps I am taking are: Step 1: Reading an image as input using Pillow in python Step 2: Converting it into grayscale image ...
-1 votes
2 answers
223 views

I have been working on ocr, so I need to load images and convert it to gray scale I tried to load the image as below filename = "sample.jpg" image = cv2.imread(filename) plt.imshow(image) ...
-3 votes
1 answer
108 views

I'm trying to convert a color image to grayscale(black and white) using OpenCV in Python, but I'm encountering an issue where the output is not as expected. Here's the code I'm using: import cv2 from ...
0 votes
0 answers
43 views

I am trying to save a PIL image that is in grayscale as a Numpy array, but everytime I do so, the resulting image is not saved in grayscale, it is saved as a colorful, green-ish image. I am using this ...
0 votes
0 answers
44 views

So i'm reading this image with im=matplotlib.image.imread("lena.bmp") but i get this when i do this matplotlib.pyplot.imshow(im) what am i doing wrong?
1 vote
0 answers
34 views

I want to show image in black-white mode in my notebook using scipy's misc.imshow(), however it doesn't work right. Here you can see expected picture. And here is what misc.imshow() shows. What is the ...
26 votes
6 answers
35k views

I have some color plots that I need to be saved in grayscale. Is there an easy way to do this without changing the plotting formats?
jlconlin's user avatar
  • 15.2k
9 votes
1 answer
11k views

I have numpy array with the following properties. np.shape(I) (300, 300) np.min(I) 115 np.max(I) 250 Unfortunately, when I plot it, I get something greenish bluish. How to get normal grayscale ...
Dims's user avatar
  • 51.9k
4 votes
2 answers
15k views

I have a small code sample to plot images in matplotlib, and the image is shown as this : Notice the image in the black box has black background, while my desired output is this : My code to plot the ...
CyprUS's user avatar
  • 4,269
2 votes
2 answers
3k views

I want to convert the picture into black and white image accurately where the seeds will be represented by white color and the background as black color. I would like to have it in python opencv code....
1 vote
2 answers
3k views

I am plotting a greyscale version of this image: SOURCE: http://matplotlib.org/examples/pylab_examples/griddata_demo.html I have used the following code: import numpy as np import matplotlib.pyplot ...

15 30 50 per page
1
2