Introduction to OpenCV image


Introduction to image processing

An image is made up of pixels

Image classification: binary image, gray image, RGB image

Channel order in opencv: B, G, R

Read pixel

Return value = image (position parameter)

Gray image, return gray value

BGR image, the return value is the value of B, G, R

# eg:
p = img[88, 142]

Returns the pixel in row 88, column 142

BGR image, the return value is the value of B, G, R

# eg:
blue = img[78, 125, 0]
green = img[78, 125, 1]
red = img(78, 125, 2)

When accessing, you can specify the name of the channel

p = img[78,125]

Returns the value of three channels

Modify pixels

img[88, 99] = 255

This work adoptsCC agreementReprint must indicate the author and the link of this article


Recommended Today

[Q & A share the second bullet] MySQL search engine, after watching the tyrannical interviewer!

Hello, I’m younger brother. A few days ago, I shared the second interview question, the interview site of search engine in MySQL. This question is the interview at normal temperature. After reading it, I’m sure you will gain something in terms of database engine If you haven’t read my first share, you can refer to […]