Skip to content
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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

CoolEgor61
Copy link

No description provided.

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)

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)]

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)

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): # Работает сомнительно

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)

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)]

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):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Необходимо добавить разбор аргументов командной строки.

@CoolEgor61
Copy link
Author

@valentina-kustikova исправил недочеты

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants