We have ranges should be carefully chosen the setting the lower and upper range for mask1.some setting the lower and upper range for mask2.then it replaced with some other code depending upon the color of your cloth.then refining the mask corresponding to the detected red color.then we are generating the final output 1.5. and then converting BGR to HSV for better detection or you can convert it to gray. Then we are reading from video.so we are convert the image -BGR to HSV as we focused on detection of red color. you should have video that have some seconds to dedicated to background farm so that it cloud easily save the background image. Our payment security system encrypts your information during transmission. We work hard to protect your security and privacy. Res2 = cv2.bitwise_and(img, img, mask=mask2)įinal_output = cv2.addWeighted(res1, 1, res2, 1, 0)Īs we have installed the numpy ,opencv-python model in our project now you can just import the which ever library we have installed then we write the farther code.then we have to capturing the video.after capturing video we have to give the camera to warm up.Ĭapturing the background in range of 60. Stuff Collection Harry Potter Junior Invisibility Cloak. Res1 = cv2.bitwise_and(background, background, mask=mask1) Mask2=cv2.morphologyEx(mask1, cv2.MORPH_DILATE ,np.ones((3,3), np.uint8), iterations=1) Mask1=cv2.morphologyEx(mask1, cv2.MORPH_OPEN ,np.ones((3,3), np.uint8), iterations=2) Mask2 = cv2.inRange(hsv, lower_red, upper_red) Mask1 = cv2.inRange(hsv, lower_red, upper_red) Ret, background = cap.read()#capturing image step 4 : Open the python file “invisible” import cv2 Welcome to r/HarryPotter, the place where fans from around the world can meet and discuss everything in the Harry Potter universe Be sorted, earn house points, take classes with our fine Hogwarts staff, debate which actor portrayed Dumbledore the best, and finally get some closure for your Post-Potter Depression. ![]() How to install the numpy, opencv-python, time module ?įile > Setting > Project Interpretor > Click on ” + ” > Search for “numpy,python-opencv” then select the package and then click on install package button. Step 3 : Add library in your python project. I have created a new python file with name as ” invisibility cloak ” using pycharm IDE. Right click on Project > New > Python File You need to create a new python file where you can write python code. ![]() ![]() File > New Project Step 2 :Create a new python file to handle invisible cloak harry poter. Step 1 :Create new python projectįirst we have to create a new python project to work on this invisible cloak. So we are using time to capture the video in that time. In this library we are using opencv to capture the video.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |