-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lab1 Egor Petrov #11
base: main
Are you sure you want to change the base?
Lab1 Egor Petrov #11
Conversation
lab1_filters.py
Outdated
# Вывод функции - исходное изображение в оттенках серого | ||
|
||
b,g,r=cv.split(dst) | ||
gray = np.uint8(0.299*r) + np.uint8(0.587*g) + np.uint8(0.114*b) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Сначала надо перемешать интенсивности, а потом делать приведение.
lab1_filters.py
Outdated
stepy=dst.shape[0]/desired_height | ||
for i in range (0, desired_width): | ||
for j in range (0, desired_height): | ||
resized[j,i]=dst[int(j*stepy),int(i*stepx)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Можно уйти от попиксельной обработки.
lab1_filters.py
Outdated
b1,g1,r1=cv.split(dst) | ||
b=np.uint8(0.272*r1) + np.uint8(0.534*g1) + np.uint8(0.131*b1) | ||
g=np.uint8(0.349*r1) + np.uint8(0.686*g1) + np.uint8(0.168*b1) | ||
r=np.uint8(0.393*r1) + np.uint8(0.769*g1) + np.uint8(0.189*b1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Приведение после смешивания.
lab1_filters.py
Outdated
sepia=cv.merge((b,g,r)) | ||
return sepia | ||
|
||
def vignette(dst,r): # Работает сомнительно |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Что-то странное написано. Обсудим.
lab1_filters.py
Outdated
mask = np.empty((height,width,3), np.uint8) | ||
for i in range (0,height//2): | ||
mask[i] = mask[height-i-1] = i | ||
gray =toShapesOfGray(dst) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Вот это нигде не используется.
lab1_filters.py
Outdated
tmp[i]=np.hsplit(tmp[i], kx) | ||
for i in range(0,ky): | ||
for j in range(0,kx): | ||
tmp[i][j]=tmp[random.randint(0,ky-1)][random.randint(0,kx-1)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Надо проверять, что номера не будут повторяться, чтобы не было повторяющихся блоков.
main.py
Outdated
import lab1_filters as lf | ||
|
||
image = input() | ||
if (image != None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Необходимо добавить разбор аргументов командной строки.
@valentina-kustikova исправил недочеты |
No description provided.