Linked Questions
26 questions linked to/from Display image as grayscale
5
votes
1
answer
10k
views
Opencv convert to grayscale not working properly [duplicate]
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
opencv convert image to grayscale, and display using matplotlib gives strange color [duplicate]
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/...
1
vote
1
answer
6k
views
How can I remove colormaps in matplotlib? [duplicate]
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
user10307633
0
votes
1
answer
4k
views
How to plot gray level image by matplotlib.pyplot.imshow? [duplicate]
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
JohnAnnual
2
votes
1
answer
3k
views
How to fix "Type Error : Invalid Dimensions for image data" error when I view an image using matplotlib [duplicate]
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
wrong output in loading gray images in matplotlib [duplicate]
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
Trouble Converting Color Image to Grayscale Using OpenCV [duplicate]
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
Numpy asarray() is saving PIL grayscale image as a green-ish image [duplicate]
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
matplotlib.image distorting colours [duplicate]
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
misc.imshow() doesn't work as expected [duplicate]
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
Save matplotlib plot in grayscale
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?
9
votes
1
answer
11k
views
How to show numpy 2d array as grayscale image in Jupyter Notebook? [duplicate]
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 ...
4
votes
2
answers
15k
views
matplotlib image shows in black and white, but I wanted gray
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 ...
2
votes
2
answers
3k
views
how can i get a black and white image for the following picture?
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
Greyscale in python - incorect colors changing from dark grey to light grey to dark grey
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 ...