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)
- Showing an image with pylab.imshow()
- python – how to get the data from an plt.imshow()?
- ImportError: No module named matplotlib.pyplot
- ImportError: No module named matplotlib.pyplot
- 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
- 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”?
- _tkinter.TclError: no display name and no $DISPLAY environment variable
- ValueError: operands could not be broadcast together with shapes (5,) (30,)
- _tkinter.TclError: no display name and no $DISPLAY environment variable
- ImportError: No module named matplotlib.pyplot
- 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
- Save plot to image file instead of displaying it using Matplotlib
- How to plot ROC curve in Python
- ImportError: numpy.core.multiarray failed to import
- 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
- How can I plot a confusion matrix? [duplicate]
- 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: numpy.core.multiarray failed to import
- 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
- How do I install Python OpenCV through Conda?
- 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?
- How to customize a scatter matrix to see all titles?
- Is there a list of line styles in matplotlib?
- Matplotlib automatic legend outside plot
- Add Legend to Seaborn point plot
- A tool to convert MATLAB code to Python
- How can I upgrade NumPy?
- Matplotlib automatic legend outside plot
- Changing the “tick frequency” on x or y axis in matplotlib?
- matplotlib error – no module named tkinter
- Plotting multiple different plots in one figure using Seaborn
- Plot pie chart and table of pandas dataframe
- ModuleNotFoundError: No module named ‘matplotlib’
- Change figure size and figure format in matplotlib
- Add Legend to Seaborn point plot
- TypeError: ‘DataFrame’ object is not callable
- Improve subplot size/spacing with many subplots in matplotlib
- How do I plot only a table 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
- How to change a ‘LinearSegmentedColormap’ to a different distribution of color?
- Display image as grayscale using matplotlib
- Create own colormap using matplotlib and plot color scale
- Why matplotlib does not plot?
- How to plot time series in python
- How to detect simple geometric shapes using OpenCV
- reducing number of plot ticks
- How to increase plt.title font size?
- 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
- How can I set the aspect ratio 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
- python SyntaxError: invalid syntax %matplotlib inline
- OpenCV NoneType object has no attribute shape
- How to update a plot in matplotlib?
- What does bitwise_and operator exactly do in openCV?
- How to make a histogram from a list of data
- How do I change the figure size with subplots?
- ValueError: x and y must be the same size
- SystemError: new style getargs format but argument is not a tuple?
- ValueError: Unknown projection ‘3d’ (once again)
- Why do we convert from RGB to HSV