As far as I can see, you are doing it almost good. There is one thing missing:
cv2.imshow('image',img) cv2.waitKey(0)
So probably your window appears but is closed very very fast.
Related Posts:
- Python: Can’t convert float NaN to integer
- Permission denied error by installing matplotlib
- OpenCV Python cv2.perspectiveTransform
- ImportError: DLL load failed: The specified module could not be found
- ImportError: DLL load failed: The specified module could not be found
- What is the difference between importing matplotlib and matplotlib.pyplot?
- Purpose of “%matplotlib inline”
- How do I install opencv using pip?
- Purpose of “%matplotlib inline”
- TypeError: only size-1 arrays can be converted to Python scalars (matplotlib)
- python – how to get the data from an plt.imshow()?
- What is the necessity of plt.figure() in matplotlib?
- How do you change the size of figures drawn with Matplotlib?
- Cannot find module cv2 when using OpenCV
- RuntimeWarning: invalid value encountered in divide
- Is “from matplotlib import pyplot as plt” == “import matplotlib.pyplot as plt”?
- ValueError: operands could not be broadcast together with shapes (5,) (30,)
- _tkinter.TclError: no display name and no $DISPLAY environment variable
- matplotlib savefig() plots different from show()
- How to resize an image with OpenCV2.0 and Python2.6
- How do I draw a grid onto a plot in Python?
- Plotting a 2D heatmap with Matplotlib
- No handles with labels found to put in legend
- How to plot a histogram using Matplotlib in Python with a list of data?
- Plot logarithmic axes with matplotlib in python
- In Matplotlib, what does the argument mean in fig.add_subplot(111)?
- import opencv vs import cv2
- Unable to plot Double Bar, Bar plot using pyplot for ndarray
- matplotlib error – no module named tkinter
- Cannot find module cv2 when using OpenCV
- ImportError: DLL load failed: %1 is not a valid Win32 application. But the DLL’s are there
- ImportError: DLL load failed: %1 is not a valid Win32 application. But the DLL’s are there
- pandas DataFrame “no numeric data to plot” error
- How to change the font size on a matplotlib plot
- Updating matplotlib in virtualenv with pip
- How do you change the size of figures drawn with Matplotlib?
- How do I set the figure title and axes labels font size in Matplotlib?
- Is there a list of line styles in matplotlib?
- Add Legend to Seaborn point plot
- A tool to convert MATLAB code to Python
- Matplotlib automatic legend outside plot
- Plotting multiple different plots in one figure using Seaborn
- Change figure size and figure format in matplotlib
- Add Legend to Seaborn point plot
- Improve subplot size/spacing with many subplots in matplotlib
- Python equivalent to ‘hold on’ in Matlab
- Difference in output with waitKey(0) and waitKey(1)
- How to add title to subplots in Matplotlib
- Overcome ValueError for empty array
- How can I convert an RGB image into grayscale in Python?
- Using %matplotlib notebook after %matplotlib inline in Jupyter Notebook doesn’t work
- Display image as grayscale using matplotlib
- Why matplotlib does not plot?
- reducing number of plot ticks
- How to make a 3D scatter plot in matplotlib
- How to draw vertical lines on a given plot in matplotlib
- Modify the legend of pandas bar plot
- Plot a horizontal line using matplotlib
- Changing the “tick frequency” on x or y axis in matplotlib
- ImportError: libSM.so.6: cannot open shared object file: No such file or directory
- explain arguments meaning in res = cv2.bitwise_and(img,img,mask = mask)
- Remove xticks in a matplotlib plot?
- How to add title to seaborn boxplot
- How to update a plot in matplotlib?
- What does bitwise_and operator exactly do in openCV?
- How do I change the figure size with subplots?
- ValueError: Unknown projection ‘3d’ (once again)
- How to change plot background color?
- raise LinAlgError(“SVD did not converge”) LinAlgError: SVD did not converge in matplotlib pca determination
- TypeError: Invalid dimensions for image data when plotting array with imshow()
- matplotlib does not show my drawings although I call pyplot.show()
- Plot correlation matrix using pandas
- How can I set the ‘backend’ in matplotlib in Python?
- Python, Matplotlib, subplot: How to set the axis range?
- ImportError: No module named cv2
- How to plot an array in python?
- Seaborn Lineplot Module Object Has No Attribute ‘Lineplot’
- Installing opencv on Windows 10 with python 3.6 and anaconda 3.6
- Matplotlib plots: removing axis, legends and white spaces
- How to plot a 2d matrix in python with colorbar? (like imagesc in Matlab)
- Label axes on Seaborn Barplot
- Plot a histogram such that the total area of the histogram equals 1
- matplotlib: plot multiple columns of pandas data frame on the bar chart
- How to change legend size with matplotlib.pyplot
- An equivalent function to matplotlib.mlab.bivariate_normal
- SystemError: new style getargs format but argument is not a tuple?
- Superscript in Python plots
- IPython, “name ‘plt’ not defined”
- Plotting a python dict in order of key values
- cmake error ‘the source does not appear to contain CMakeLists.txt’
- How does cv2.boundingRect() function of OpenCV work?
- MovieWriter ffmpeg unavailable; trying to use class ‘matplotlib.animation.PillowWriter’ instead
- How to plot normal distribution
- Python basemap module impossible to import
- Equivalent to matlab’s imagesc in matplotlib? [duplicate]
- Installing Pylab/Matplotlib
- TypeError: zip argument #2 must support iteration
- ValueError: total size of new array must be unchanged
- numpy/scipy/ipython:Failed to interpret file as a pickle
- alueError: ordinal must be >= 1