\documentclass[10pt,a4paper]{article} % Packages \usepackage{fancyhdr} % For header and footer \usepackage{multicol} % Allows multicols in tables \usepackage{tabularx} % Intelligent column widths \usepackage{tabulary} % Used in header and footer \usepackage{hhline} % Border under tables \usepackage{graphicx} % For images \usepackage{xcolor} % For hex colours %\usepackage[utf8x]{inputenc} % For unicode character support \usepackage[T1]{fontenc} % Without this we get weird character replacements \usepackage{colortbl} % For coloured tables \usepackage{setspace} % For line height \usepackage{lastpage} % Needed for total page number \usepackage{seqsplit} % Splits long words. %\usepackage{opensans} % Can't make this work so far. Shame. Would be lovely. \usepackage[normalem]{ulem} % For underlining links % Most of the following are not required for the majority % of cheat sheets but are needed for some symbol support. \usepackage{amsmath} % Symbols \usepackage{MnSymbol} % Symbols \usepackage{wasysym} % Symbols %\usepackage[english,german,french,spanish,italian]{babel} % Languages % Document Info \author{meghalagarwal} \pdfinfo{ /Title (advancecomputervision.pdf) /Creator (Cheatography) /Author (meghalagarwal) /Subject (AdvanceComputerVision Cheat Sheet) } % Lengths and widths \addtolength{\textwidth}{6cm} \addtolength{\textheight}{-1cm} \addtolength{\hoffset}{-3cm} \addtolength{\voffset}{-2cm} \setlength{\tabcolsep}{0.2cm} % Space between columns \setlength{\headsep}{-12pt} % Reduce space between header and content \setlength{\headheight}{85pt} % If less, LaTeX automatically increases it \renewcommand{\footrulewidth}{0pt} % Remove footer line \renewcommand{\headrulewidth}{0pt} % Remove header line \renewcommand{\seqinsert}{\ifmmode\allowbreak\else\-\fi} % Hyphens in seqsplit % This two commands together give roughly % the right line height in the tables \renewcommand{\arraystretch}{1.3} \onehalfspacing % Commands \newcommand{\SetRowColor}[1]{\noalign{\gdef\RowColorName{#1}}\rowcolor{\RowColorName}} % Shortcut for row colour \newcommand{\mymulticolumn}[3]{\multicolumn{#1}{>{\columncolor{\RowColorName}}#2}{#3}} % For coloured multi-cols \newcolumntype{x}[1]{>{\raggedright}p{#1}} % New column types for ragged-right paragraph columns \newcommand{\tn}{\tabularnewline} % Required as custom column type in use % Font and Colours \definecolor{HeadBackground}{HTML}{333333} \definecolor{FootBackground}{HTML}{666666} \definecolor{TextColor}{HTML}{333333} \definecolor{DarkBackground}{HTML}{A3A3A3} \definecolor{LightBackground}{HTML}{F3F3F3} \renewcommand{\familydefault}{\sfdefault} \color{TextColor} % Header and Footer \pagestyle{fancy} \fancyhead{} % Set header to blank \fancyfoot{} % Set footer to blank \fancyhead[L]{ \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{C} \SetRowColor{DarkBackground} \vspace{-7pt} {\parbox{\dimexpr\textwidth-2\fboxsep\relax}{\noindent \hspace*{-6pt}\includegraphics[width=5.8cm]{/web/www.cheatography.com/public/images/cheatography_logo.pdf}} } \end{tabulary} \columnbreak \begin{tabulary}{11cm}{L} \vspace{-2pt}\large{\bf{\textcolor{DarkBackground}{\textrm{AdvanceComputerVision Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{meghalagarwal} via \textcolor{DarkBackground}{\uline{cheatography.com/148120/cs/32270/}}} \end{tabulary} \end{multicols}} \fancyfoot[L]{ \footnotesize \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{LL} \SetRowColor{FootBackground} \mymulticolumn{2}{p{5.377cm}}{\bf\textcolor{white}{Cheatographer}} \\ \vspace{-2pt}meghalagarwal \\ \uline{cheatography.com/meghalagarwal} \\ \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Not Yet Published.\\ Updated 31st May, 2022.\\ Page {\thepage} of \pageref{LastPage}. \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Sponsor}} \\ \SetRowColor{white} \vspace{-5pt} %\includegraphics[width=48px,height=48px]{dave.jpeg} Measure your website readability!\\ www.readability-score.com \end{tabulary} \end{multicols}} \begin{document} \raggedright \raggedcolumns % Set font size to small. Switch to any value % from this page to resize cheat sheet text: % www.emerson.emory.edu/services/latex/latex_169.html \footnotesize % Small font. \begin{multicols*}{3} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Libraries}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{OpenCV} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{Mediapipe} \tn % Row Count 2 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.53827 cm} x{2.43873 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Creating 2 Python Files for each project}} \tn % Row 0 \SetRowColor{LightBackground} \seqsplit{HandTrackingModule.py} & FingerCounting.py \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \seqsplit{HandTrackingModule.py} & \seqsplit{AIVirtualPainting.py} \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} \seqsplit{HandTrackingModule.py} & \seqsplit{HandVirtualMouse.py} \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} \seqsplit{HandTrackingModule.py} & \seqsplit{HandVolumeControl.py} \tn % Row Count 8 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{For each project, it is important to create a separate python file that comprises Class and the functions associated with that respective project.} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Defining Hand Class and it's Methods}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{import cv2 \newline import mediapipe as mp \newline import time \newline import math \newline import numpy as np \newline \newline class handDetector(): \newline def \_\_init\_\_(self, mode=False, maxHands=2, detectionCon=0, trackCon=0): \newline self.mode = mode \newline self.maxHands = maxHands \newline self.detectionCon = detectionCon \newline self.trackCon = trackCon \newline \newline self.mpHands = mp.solutions.hands \newline self.hands = \seqsplit{self.mpHands.Hands(self.mode}, self.maxHands, self.detectionCon, self.trackCon) \newline self.mpDraw = \seqsplit{mp.solutions.drawing\_utils} \newline self.tipIds = {[}4, 8, 12, 16, 20{]} \newline \newline def findHands(self, img, draw=True): \newline imgRGB = cv2.cvtColor(img, cv2.COLOR\_BGR2RGB) \newline self.results = \seqsplit{self.hands.process(imgRGB)} \newline \# \seqsplit{print(results.multi\_hand\_landmarks)} \newline \newline if \seqsplit{self.results.multi\_hand\_landmarks:} \newline for handLms in \seqsplit{self.results.multi\_hand\_landmarks:} \newline if draw: \newline \seqsplit{self.mpDraw.draw\_landmarks(img}, handLms, \seqsplit{self.mpHands.HAND\_CONNECTIONS)} \newline \newline return img \newline \newline def findPosition(self, img, handNo=0, draw=True): \newline xList = {[}{]} \newline yList = {[}{]} \newline bbox = {[}{]} \newline self.lmList = {[}{]} \newline if \seqsplit{self.results.multi\_hand\_landmarks:} \newline myHand = self.results.multi\_hand\_landmarks{[}handNo{]} \newline for id, lm in \seqsplit{enumerate(myHand.landmark):} \newline \# print(id, lm) \newline h, w, c = img.shape \newline cx, cy = int(lm.x {\emph{ w), int(lm.y }} h) \newline xList.append(cx) \newline yList.append(cy) \newline \# print(id, cx, cy) \newline self.lmList.append({[}id, cx, cy{]}) \newline if draw: \newline cv2.circle(img, (cx, cy), 5, (255, 0, 255), cv2.FILLED) \newline \newline xmin, xmax = min(xList), max(xList) \newline ymin, ymax = min(yList), max(yList) \newline bbox = xmin, ymin, xmax, ymax \newline \newline if draw: \newline cv2.rectangle(img, (xmin - 20, ymin - 20), (xmax + 20, ymax + 20), (0, 255, 0), 2) \newline \newline return self.lmList, bbox \newline \newline def fingersUp(self): \newline fingers = {[}{]} \newline \newline \# Thumb \newline if self.lmList{[}self.tipIds{[}0{]}{]}{[}1{]} \textgreater{} self.lmList{[}self.tipIds{[}0{]} - 1{]}{[}1{]}: \newline fingers.append(1) \newline else: \newline fingers.append(0) \newline \newline \# Fingers \newline for id in range(1, 5): \newline if self.lmList{[}self.tipIds{[}id{]}{]}{[}2{]} \textless{} self.lmList{[}self.tipIds{[}id{]} - 2{]}{[}2{]}: \newline fingers.append(1) \newline else: \newline fingers.append(0) \newline \newline \# totalFingers = fingers.count(1) \newline \newline return fingers \newline \newline def findDistance(self, p1, p2, img, draw=True,r=15, t=3): \newline x1, y1 = self.lmList{[}p1{]}{[}1:{]} \newline x2, y2 = self.lmList{[}p2{]}{[}1:{]} \newline cx, cy = (x1 + x2) // 2, (y1 + y2) // 2 \newline \newline if draw: \newline cv2.line(img, (x1, y1), (x2, y2), (255, 0, 255), t) \newline cv2.circle(img, (x1, y1), r, (255, 0, 255), cv2.FILLED) \newline cv2.circle(img, (x2, y2), r, (255, 0, 255), cv2.FILLED) \newline cv2.circle(img, (cx, cy), r, (0, 0, 255), cv2.FILLED) \newline length = math.hypot(x2 - x1, y2 - y1) \newline \newline return length, img, {[}x1, y1, x2, y2, cx, cy{]}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{This Class represents the Hand and the methods represent the various actions associated with those hands and finger moments in order to capture the actions.} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{HandVirtualPaint File}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{import cv2 as cv \newline import numpy as np \newline import time \newline import os \newline import HandTrackingModule as htm \newline \newline brushThickness = 25 \newline eraserThickness = 100 \newline \newline folderPath = \seqsplit{"/home/meghal/Personal/Konverge\_AI/Training/Advance} Computer Visions/AI Virtual Painter/Header" \newline myList = os.listdir(folderPath) \newline myList.sort() \newline print(myList) \newline overlayList = {[}{]} \newline \newline for imPath in myList: \newline image = cv.imread(f"\{folderPath\}/\{imPath\}") \newline \seqsplit{overlayList.append(image)} \newline \newline \#overlayList.sort() \newline print(len(overlayList)) \newline header = overlayList{[}0{]} \newline drawColor = (255, 0, 255) \newline \newline cap = cv.VideoCapture(0) \newline cap.set(3, 640) \newline cap.set(4, 480) \newline \newline detector = \seqsplit{htm.handDetector(detectionCon=0},maxHands=1) \newline xp, yp = 0, 0 \newline vidCanvas = np.zeros((480, 640, 3), np.uint8) \newline \newline while True: \newline \newline \# 1. Import image \newline success, vid = cap.read() \newline vid = cv.flip(vid, 1) \newline \#print(vid.shape) \newline \newline \# 2. Find Hand Landmarks \newline vid = detector.findHands(vid) \newline lmList = \seqsplit{detector.findPosition(vid}, draw=False) \newline \newline if len(lmList) != 0: \newline print(lmList) \newline \# tip of index and middle fingers \newline x1, y1 = lmList{[}8{]}{[}1:{]} \newline x2, y2 = lmList{[}12{]}{[}1:{]} \newline \newline \# 3. Check which fingers are up \newline fingers = detector.fingersUp() \newline \# print(fingers) \newline \newline \# 4. If Selection Mode – Two finger are up \newline if fingers{[}1{]} and fingers{[}2{]}: \newline \# xp, yp = 0, 0 \newline \#cv.rectangle(vid, (x1, y1-25), (x2, y2+25), (255, 0, 255), cv.FILLED) \newline print("Selection Mode") \newline \newline \# Checking for the click \newline if y1 \textless{} 100: \newline if 50 \textless{} x1 \textless{} 150: \newline header = overlayList{[}0{]} \newline drawColor = (255, 0, 255) \newline elif 150 \textless{} x1 \textless{} 200: \newline header = overlayList{[}1{]} \newline drawColor = (255, 0, 0) \newline elif 240 \textless{} x1 \textless{} 390: \newline header = overlayList{[}2{]} \newline drawColor = (0, 255, 0) \newline elif 490 \textless{} x1 \textless{} 640: \newline header = overlayList{[}3{]} \newline drawColor = (0, 0, 0) \newline cv.rectangle(vid, (x1, y1 - 25), (x2, y2 + 25), drawColor, cv.FILLED) \newline \newline \# 5. If Drawing Mode – Index finger is up \newline if fingers{[}1{]} and fingers{[}2{]} == False: \newline cv.circle(vid, (x1, y1), 15, drawColor, cv.FILLED) \newline print("Drawing Mode") \newline \newline if xp == 0 and yp == 0: \newline xp, yp = x1, y1 \newline \newline \#cv.line(vid, (xp, yp), (x1, y1), drawColor, brushThickness) \newline \newline if drawColor == (0, 0, 0): \newline cv.line(vid, (xp, yp), (x1, y1), drawColor, eraserThickness) \newline cv.line(vidCanvas, (xp, yp), (x1, y1), drawColor, eraserThickness) \newline else: \newline cv.line(vid, (xp, yp), (x1, y1), drawColor, brushThickness) \newline cv.line(vidCanvas, (xp, yp), (x1, y1), drawColor, brushThickness) \newline \newline xp, yp = x1, y1 \newline \newline \# \# Clear Canvas when all fingers are up \newline \# if all (x \textgreater{}= 1 for x in fingers): \newline \# vidCanvas = np.zeros((720, 1280, 3), np.uint8) \newline \newline vidGray = cv.cvtColor(vidCanvas, cv.COLOR\_BGR2GRAY) \newline \_, vidInv = cv.threshold(vidGray, 50, 255, cv.THRESH\_BINARY\_INV) \newline vidInv = cv.cvtColor(vidInv,cv.COLOR\_GRAY2BGR) \newline vid = cv.bitwise\_and(vid,vidInv) \newline vid = cv.bitwise\_or(vid,vidCanvas) \newline \newline \# Setting the header image \newline vid{[}0:100, 0:640{]} = header \newline \#vid = cv.addWeighted(vid,0.5,vidCanvas,0.5,0) \newline cv.imshow("Video", vid) \newline \#cv.imshow("Video Canvas", vidCanvas) \newline \#print(vidCanvas.shape) \newline \# cv.imshow("Video Inv", vidInv) \newline \# print(vidInv.shape) \newline cv.waitKey(1)} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{This Code represents the logic of how to detect hand moments i.e. Selection / Drawing.} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{AI Virtual Mouse}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{import cv2 \newline import numpy as np \newline import HandTrackingModule as htm \newline import time \newline import autopy \newline \newline wCam, hCam = 640, 480 \newline frameR = 100 \# Frame Reduction \newline smoothening = 7 \newline \newline pTime = 0 \newline plocX, plocY = 0, 0 \newline clocX, clocY = 0, 0 \newline \newline cap = cv2.VideoCapture(0) \newline cap.set(3, wCam) \newline cap.set(4, hCam) \newline detector = \seqsplit{htm.handDetector(maxHands=1)} \newline wScr, hScr = autopy.screen.size() \newline \# print(wScr, hScr) \newline \newline while True: \newline \# 1. Find hand Landmarks \newline success, img = cap.read() \newline img = detector.findHands(img) \newline lmList, bbox = \seqsplit{detector.findPosition(img)} \newline \# 2. Get the tip of the index and middle fingers \newline if len(lmList) != 0: \newline x1, y1 = lmList{[}8{]}{[}1:{]} \newline x2, y2 = lmList{[}12{]}{[}1:{]} \newline \# print(x1, y1, x2, y2) \newline \newline \# 3. Check which fingers are up \newline fingers = detector.fingersUp() \newline \# print(fingers) \newline cv2.rectangle(img, (frameR, frameR), (wCam - frameR, hCam - frameR), (255, 0, 255), 2) \newline \newline \# 4. Only Index Finger : Moving Mode \newline if fingers{[}1{]} == 1 and fingers{[}2{]} == 0: \newline \# 5. Convert Coordinates \newline x3 = np.interp(x1, (frameR, wCam - frameR), (0, wScr)) \newline y3 = np.interp(y1, (frameR, hCam - frameR), (0, hScr)) \newline print(x3) \newline \newline \# 6. Smoothen Values \newline clocX = plocX + (x3 - plocX) / smoothening \newline clocY = plocY + (y3 - plocY) / smoothening \newline \newline \# 7. Move Mouse \newline autopy.mouse.move(wScr - clocX, clocY) \newline cv2.circle(img, (x1, y1), 15, (255, 0, 255), cv2.FILLED) \newline plocX, plocY = clocX, clocY \newline \newline \# 8. Both Index and middle fingers are up : Clicking Mode \newline if fingers{[}1{]} == 1 and fingers{[}2{]} == 1: \newline \# 9. Find distance between fingers \newline length, img, lineInfo = detector.findDistance(8, 12, img) \newline print(length) \newline \newline \# 10. Click mouse if distance short \newline if length \textless{} 40: \newline cv2.circle(img, (lineInfo{[}4{]}, lineInfo{[}5{]}), \newline 15, (0, 255, 0), cv2.FILLED) \newline autopy.mouse.click() \newline \newline \# 11. Frame Rate \newline cTime = time.time() \newline fps = 1 / (cTime - pTime) \newline pTime = cTime \newline cv2.putText(img, str(int(fps)), (20, 50), cv2.FONT\_HERSHEY\_PLAIN, 3, (255, 0, 0), 3) \newline \newline \# 12. Display \newline cv2.imshow("Image", img) \newline cv2.waitKey(1)} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{It is the same as Hand Virtual Painting Tool.} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Virtual Volume Control}} \tn \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{import cv2 \newline import time \newline import numpy as np \newline import HandTrackingModule as htm \newline import math \newline from ctypes import cast, POINTER \newline from comtypes import CLSCTX\_ALL \newline from pycaw.pycaw import AudioUtilities, IAudioEndpointVolume \newline \newline \# Defining the Width and Height of the Video to be displayed \newline wCam, hCam = 640, 480 \newline \newline cap = cv2.VideoCapture(0) \newline cap.set(3, wCam) \newline cap.set(4, hCam) \newline pTime = 0 \newline detector = \seqsplit{htm.handDetector(detectionCon=0.7)} \newline \newline devices = \seqsplit{AudioUtilities.GetSpeakers()} \newline interface = \seqsplit{devices.Activate(IAudioEndpointVolume.\_iid\_}, CLSCTX\_ALL, None) \newline volume = cast(interface, \seqsplit{POINTER(IAudioEndpointVolume))} \newline \newline \# volume.GetMute() \newline \# \seqsplit{volume.GetMasterVolumeLevel()} \newline \newline volRange = volume.GetVolumeRange() \newline minVol = volRange{[}0{]} \newline maxVol = volRange{[}1{]} \newline vol = 0 \newline volBar = 400 \newline volPer = 0 \newline \newline while True: \newline success, img = cap.read() \newline img = detector.findHands(img) \newline lmList = \seqsplit{detector.findPosition(img}, draw=False) \newline \newline if len(lmList) != 0: \newline \# print(lmList{[}4{]}, lmList{[}8{]}) \newline x1, y1 = lmList{[}4{]}{[}1{]}, lmList{[}4{]}{[}2{]} \newline x2, y2 = lmList{[}8{]}{[}1{]}, lmList{[}8{]}{[}2{]} \newline cx, cy = (x1 + x2) // 2, (y1 + y2) // 2 \newline \newline cv2.circle(img, (x1, y1), 15, (255, 0, 255), cv2.FILLED) \newline cv2.circle(img, (x2, y2), 15, (255, 0, 255), cv2.FILLED) \newline cv2.line(img, (x1, y1), (x2, y2), (255, 0, 255), 3) \newline cv2.circle(img, (cx, cy), 15, (255, 0, 255), cv2.FILLED) \newline \newline length = math.hypot(x2 - x1, y2 - y1) \newline \newline \# Hand range 50 - 300 \newline \# Volume Range -65 - 0 \newline vol = np.interp(length, {[}50, 300{]}, {[}minVol, maxVol{]}) \newline volBar = np.interp(length, {[}50, 300{]}, {[}400, 150{]}) \newline volPer = np.interp(length, {[}50, 300{]}, {[}0, 100{]}) \newline print(int(length), vol) \newline \seqsplit{volume.SetMasterVolumeLevel(vol}, None) \newline \newline if length \textless{} 50: \newline cv2.circle(img, (cx, cy), 15, (0, 255, 0), cv2.FILLED) \newline \newline cv2.rectangle(img, (50, 150), (85, 400), (255, 0, 0), 3) \newline cv2.rectangle(img, (50, int(volBar)), (85, 400), (255, 0, 0), cv2.FILLED) \newline cv2.putText(img, f'\{int(volPer)\} \%', (40, 450), \seqsplit{cv2.FONT\_HERSHEY\_COMPLEX}, 1, (255, 0, 0), 3) \newline \newline cTime = time.time() \newline fps = 1 / (cTime - pTime) \newline pTime = cTime \newline \newline cv2.putText(img, f'FPS: \{int(fps)\}', (40, 50), \seqsplit{cv2.FONT\_HERSHEY\_COMPLEX}, 1, (255, 0, 0), 3) \newline \newline cv2.imshow("Img", img) \newline cv2.waitKey(1)} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{It captures the tips and the moments of 2 finger's tips to control the volume.} \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}