[Computer Vision] Homework and network knowledge-1

Write in front

Online courses and homework links The
author Xiaobai, welcome to add corrections.
To complete the private code!

hw0

1. Obtain and set pixels
Insert picture description here
First determine whether the point is in the image. If it is in the image, use this formula to calculate the pixel. The
pixel is stored in the data type of float data, and float v can be assigned to data.

2. Copy the image

First make an image of the same size, <code has been given>
and then traverse all points of the original image, assign its pixel value to the same position of the new image

3. Grayscale image
Traverse all points, convert RGB pixel values ​​to R \ G \ B, and then use the weighted average to calculate the grayscale pixel K
K = 0.299R + 0.587G + 0.114B

4. Change the color of the image. The
pixel value of the c channel is B in rgb to
Insert picture description here
traverse all points in the image, and then add the new pixel (that is, the parameter v) to the c channel.

5. Fixed image value (not sure about ww

Make sure the pixel value in the image is between 0 and 1. Clamp the image, if it is less than 0, it will be set to 0, if it is greater than 1, it will be set to 1.

6 & 7, RGB <----> HSV HSV super detailed
Insert picture description here
Hue (H), Saturation (S), Brightness (V)
algorithm see code

An effect picture of homework
Insert picture description here
Insert picture description here
Insert picture description here
Insert picture description here
and another forgotten to save. . .

Published 29 original articles · praised 0 · visits 501

Guess you like

Origin blog.csdn.net/qq_43771959/article/details/104308650