Grayscale image is displayed as a color image in OpenCV / Python

The cause is that the display is set to 3 channels.

gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
cv2.merge((gray, gray, gray), frame)

I'm blogging: http://weed.nagoya

Recommended Posts

Grayscale image is displayed as a color image in OpenCV / Python
Use fabric as is in python (fabric3)
Hash in Perl is a dictionary in Python
What is wheezy in the Docker Python image?
Image format in Python
Check if the string is a number in python
Specify a subcommand as a command line argument in Python
Fill the background with a single color with OpenCV2 + Python
Display a histogram of image brightness values in python
Python OpenCV tried to display the image in text.
Take a screenshot in Python
Displaying DICOM images in rudimentary Python as a medical professional
Create a function in Python
Create a dictionary in Python
Image editing with python OpenCV
A memo when face is detected with Python + OpenCV quickly
Python list is not a list
Tweet with image in Python
Make a bookmarklet in Python
Paste png with alpha channel as transparent image with Python / OpenCV
Make Opencv available in Python
Image Processing Collection in Python
When "No changes detected" is displayed in python3 manage.py makemigrations
Draw a heart in Python
The image is a slug
What is a python map?
Note installing modules such as pytorch and opencv with pip in Blender python (2.82a or later)
Play a sound in Python assuming that the keyboard is a piano keyboard
[Python] Execution time when a function is entered in a dictionary value
Delete a particular character in Python if it is the last
Investigating what could be used as a Markdown parser in Python
[Python] The value written in Openpyxl is displayed in exponential notation (E).
A program that determines whether a number entered in Python is a prime number
What's new in datetime that is a bit more useful in Python 3
Get the formula in an excel file as a string in Python
[Python] What is a zip function?
Maybe in a python (original title: Maybe in Python)
[Python] What is a with statement?
Write a binary search in Python
Use pymol as a python library
[python] Manage functions in a list
[Python] Using OpenCV with Python (Image Filtering)
Hit a command in Python (Windows)
Difference between == and is in python
Implemented image segmentation in python (Union-Find)
Create a DI Container in Python
[Python] Using OpenCV with Python (Image transformation)
Is there a special in scipy? ??
Python is UnicodeEncodeError in CodeBox docker
Draw a scatterplot matrix in python
Put python, numpy, opencv3 in ubuntu14
ABC166 in Python A ~ C problem
Write A * (A-star) algorithm in Python
Create a binary file in Python
Use blender as a python module
Solve ABC036 A ~ C in Python
Write a pie chart in Python
Write a vim plugin in Python
There is no switch in python
Write a depth-first search in Python
Today's python error: image is blank