Questions tagged [imshow]

The imshow is a function from the matplotlib library that displays an image on the axes.

The is a function from the library that displays an image on the axes.

References:

See also:

806 questions
25
votes
2 answers

matplotlib imshow distorting colors

I have tried to use the imshow function from matplotlib.pyplot and it works perfectly to show grayscale images. When I tried to represent rgb images, it changes the colors, showing a more blue-ish color. See an example: import cv2 import…
dberga
  • 363
  • 1
  • 3
  • 6
25
votes
2 answers

cv2.imshow image window placement is outside of viewable screen

I am running Anaconda install of python35 with cv2 install from menpo. I am having trouble with cv2.imshow() inconsistently placing the image window outside of the viewable screen when running code similar to the one below both as a standalone…
chiaka
  • 315
  • 1
  • 3
  • 9
24
votes
2 answers

Drawing circles on image with Matplotlib and NumPy

I have NumPy arrays which hold circle centers. import matplotlib.pylab as plt import numpy as np npX = np.asarray(X) npY = np.asarray(Y) plt.imshow(img) // TO-DO plt.show() How can I show circles at the given positions on my image?
orkan
  • 512
  • 1
  • 4
  • 18
24
votes
3 answers

Fitting an image to screen using imshow opencv

I want to display an image using opencv on Mac os X 13'. The image size is 1920 × 1080. When I run this code, I see just a part of an image. I need to fit the image to the screen. #include #include #include…
LearnToGrow
  • 1,656
  • 6
  • 30
  • 53
23
votes
3 answers

Difference between plt.imshow and cv2.imshow?

Why is there a difference in the output image when calling the same image using plt.imshow & cv2.imshow()? Here is my code: import cv2 import numpy as np from matplotlib import pyplot as plt src=cv2.imread('fruits1.jpg') # Source…
Aman Garg
  • 343
  • 1
  • 2
  • 6
23
votes
1 answer

Dates in the xaxis for a matplotlib plot with imshow

So I am new to programming with matplotlib. I have created a color plot using imshow() and an array. At first the axis were just the row and column number of my array. I used extent = (xmin,xmax,ymin,ymax) to get the x-axis in unix time and…
user3546200
  • 269
  • 1
  • 3
  • 10
22
votes
1 answer

Two different color colormaps in the same imshow matplotlib

Let's suppose the example below import matplotlib.pyplot as plt import numpy as np v1 = -1 + 2*np.random.rand(50,150) fig = plt.figure() ax = fig.add_subplot(111) p = ax.imshow(v1,interpolation='nearest') cb =…
Marcos Alex
  • 1,600
  • 3
  • 15
  • 20
22
votes
2 answers

How can I display a numpy array with imshow

The np.array that results from this loop has 4383 lines and 6 columns. I have tried without success to use pylab.imshow() from matplotlib(pylab) to display the array. The objective is to create an image of the array, in which the colors gradient…
user1419224
  • 1,285
  • 6
  • 14
  • 14
21
votes
1 answer

Matplotlib : What is the function of cmap in imshow?

I'm trying to learn opencv using python and came across this code below: import cv2 import numpy as np from matplotlib import pyplot as plt BLUE = [255,0,0] img1 = cv2.imread('opencv_logo.png') replicate =…
Clive
  • 1,137
  • 7
  • 19
  • 28
20
votes
4 answers

Matplotlib: how to make imshow read x,y coordinates from other numpy arrays?

When you want to plot a numpy array with imshow, this is what you normally do: import numpy as np import matplotlib.pyplot as plt A=np.array([[3,2,5],[8,1,2],[6,6,7],[3,5,1]]) #The array to…
FaCoffee
  • 7,609
  • 28
  • 99
  • 174
20
votes
2 answers

display matrix values and colormap

I need to display values of my matrix using matshow. However, with the code I have now I just get two matrices - one with values and other colored. How do I impose them? Thanks :) import numpy as np import matplotlib.pyplot as plt fig, ax =…
fremorie
  • 713
  • 2
  • 9
  • 20
20
votes
10 answers

Opencv imshow() freezes when updating

For my image processing algorithm I'm using python / OpenCV. The output of my algorithm shall be updated im the same window over and over again. However sometimes the window freezes and doesn't update at all, but the algorithm is still running and…
user3085931
  • 1,757
  • 4
  • 29
  • 55
19
votes
4 answers

How to add legend to imshow() in matplotlib

I am using matplotlib In plot() or bar(), we can easily put legend, if we add labels to them. but what if it is a contourf() or imshow() I know there is a colorbar() which can present the color range, but it is not satisfied. I want such a legend…
rankthefirst
  • 1,370
  • 2
  • 14
  • 26
17
votes
1 answer

Matplotlib imshow: how to apply a mask on the matrix

I am trying to analyse graphically 2d data. matplotlib.imshow is very useful in that but I feel that I could make even more use of that if I could exclude some cells from my matrix, values of outside of a range of interest. My problem is that these…
Learning is a mess
  • 7,479
  • 7
  • 35
  • 71
17
votes
3 answers

Showing an image with pylab.imshow()

I'm relatively new to all this and I started the tutorial on image analysis here. When trying to perform the pylab.imshow(dna) step it returns the following error: In [10]:…
Samuel Barnett
  • 434
  • 1
  • 3
  • 13
1
2
3
53 54