What does k == 27 mean and do in this code?

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

What does k == 27 mean and do in this code?

Post by answerhappygod »

What does k == 27 mean and do in this code?
What Does K 27 Mean And Do In This Code 1
What Does K 27 Mean And Do In This Code 1 (28.39 KiB) Viewed 45 times
import cv2 img cv2.imread('lena.jpg',0) print (img) cv2.imshow('image', img) k=cv2.waitkey (0) if k == 27: cv2.destroyAllWindows() elif kord('s'): cv2.imwrite('lena_copy.jpg',img) cv2.destroyAllWindows()
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply