Skip to main content

Posts

OpenCV - Play Video with python

Hello Guys, In this tutorial, I will show you how to play a video file using OpenCV. To play a video file or to stream a webcam OpenCV has a function named  VideoCapture.  This function takes only one argument. If you want to play the video you need to pass the file name with extension. Ex:  nature.mp4. Similarly, If you want to stream your webcam you need to pass a number or device index. Which simply means which webcam you want to access. Just in case, If you have more than one webcam. If you have only one webcam then you have to pass 0 or else if you have two web cameras then for accessing the second web camera you have to pass 1  and so on.  Once we have initialized the video object by calling the VideoCapture function. Then we will use an infinite while loop which will iterate till video.read() method returns true. read() function returns two parameters  1. Boolean – If True video still playing or False if the video is ended.  2. Frame – Here frame is simply your picture.  We h

OpenCV - Writing an image

Hello Guys, In this article, I will discuss about how to write images in OpenCV. For writing images, Opencv has the function named “ imwrite “. This function takes two arguments.  1. Image name with extension  2. Image object This function returns a boolean . If it writes the file successfully then it returns True, otherwise False . # Import cv2 moduleimport cv2 as cv#reading an using imread function without passing any parameter# By default it loads the image in color formatcolored_image= cv.imread("nature.jpg") #imwrite returns True if it writes the file successfully otherwise #returns Falseresult = cv.imwrite("nature.png",colored_image)if result: png_img = cv.imread("nature.png") cv.imshow("Png Image",png_img) cv.waitKey(0) cv.destroyAllWindows()else: print("Error in writing file") Also don’t forget to check my previous OpenCV tutorials.  http://techievaibhav.in/category/programming/opencv/

OpenCV - Display Image

Hello Guys, In this tutorial, I will discuss how to display an image using OpenCV.  OpenCV comes with the function named imshow  which is used to display images.  imshow function takes two arguments    1. Window name  2. Image object We can show show any number of windows . But the name of each window must be different. # Import cv2 moduleimport cv2 as cv#reading an using imread function without passing any parameter#by default it loads image in color format (BGR format)colored_image= cv.imread("nature.jpg") # loads image in gray formatgray_image= cv.imread("nature.jpg",cv.IMREAD_GRAYSCALE)#Code to display single imagecv.imshow("Colored Image",colored_image)#Passing zero means it will open till you press any key #to close the window. It takes time in milliseconds . So if 500 will be #passed then it will be opened for 500 ms and then it will be closed #automatically.cv.waitKey(0) # This is used to close all opened windowscv.destroyAllWindows() #code to dis

OpenCV - Reading An Image with python

Hi Guyz, In this tutorial, I will discuss how to read an image in OpenCV using python . OpenCV has the function called imread for reading an image. This imread function reads the image in BGR format. BGR stands for Blue Green Red. This function takes two argument. Image path Flag  There are three types of flags which this function takes. IMREAD_COLOR  IMREAD_GRAYSCALE IMREAD_UNCHANGED IMREAD_COLOR : This is the default flag which this function takes automatically. So if you want to read an image in the color format then you don’t have pass any flag. Or you can also pass 0 .  IMREAD_GRAYSCALE : When using this flag it read an image in grayscale format. Or you can also pass  1.   IMREAD_UNCHANGED : Loads an image with transparency (Alpha channel). Or you can also pass -1 . import cv2 as cv """ Reading Colored Image """colored_image= cv.imread("nature.jpg") #Same statement can also be written as colored_image= cv.imread("nature.jpg",cv

Top 5 Budget Gaming Graphics Card Under 10K

Hello Readers, Today this article is about top 5 graphic cards which you can buy to play new high graphics game on your system. 1.  Zotac Nvidia GT 1030 2GB GDDR5: Specs: GPU: GeForce® GT 1030 CUDA cores: 384 Video Memory: 2GB GDDR5 Memory Bus: 64-bit Memory Clock: 6.0 GHz PCI Express: PCIE 3.0 Display Outputs: VGA ,HDMI 2.0b Recommended Power Supply: 300W DirectX: 12 OpenGL: 4.5 Supported OS: Windows 10 / 8 / 7 (32/64-bit) Buy Now 2. Gigabyte Radeon RX 550 D5 2GB Specs: Graphics Processing Radeon RX550 Core Clock OC mode: 1195 MHz  Gaming mode: 1183 MHz  (Reference clock: 1183 MHz) Process Technology 14 nm Memory Clock 7000 MHz Memory Size 2 GB Memory Type GDDR5 Memory Bus 128 bit Card Bus PCI-E 3.0 x 8 DirectX 12 OpenGL 4.5 Recommended PSU 400W Output Dual-link DVI-D *1  HDMI-2.0b*1 (Max Resolution: 4096x2160 @60 Hz) Display Port-1.4 *1 (Max Resolution: 7680x4320 @60 Hz)

Mi Selfie Stick Tripod (Bluetooth Remote) Review

Hello Readers, Today in this article , i am going to review Mi Selfie Stick Tripod (Bluetooth Remote)  . I have purchased this selfie stick 4 months back. So i thought i should share my experience with this selfie stick. Before getting into details let me list down some its features and specification. Features Tripod Detachable Bluetooth remote  Light and compact Aluminium rod 360 degree rotating phone holder Specs Color: Black & White Weight: 155 grams Version: Android 4.3 or higher , iOS 5.0 or higher Bluetooth version: 3.0 Battery life: up to 50,000 click and charging time 1 to 2 hours Review Looks: The product looks premium and also light weight. The best thing it can hold any smartphone easily. I have tested this with mi and oneplus5 and this works great. Tripod: Its also comes with built in tripod stand so you fix your smartphone and click pictures using Bluetooth remote. You can also use this tripod to record youtube vi

Play PlayStation 3 Games On Windows PC

Hello Readers, Today in this article i am going demonstrate you how you can play ps3 games on your PC. Let's Get Started You need following software's to play PS3 games on your PC. 1.  RPCS3 Emulator   2.  PS3 Update File 3. PS3 ISO/Pkg File (Download or buy choice is yours) 4.  Microsoft Visual C++ 2017 ReDistributable 5.   Direct X So before downloading anything please go through this  Compatible PS3 Games You will find the list of games which are playable through this emulator. So only download/Buy those games which are under playable section otherwise you guys won't be able to play. you will find some indicators to show which game is playable or not. Playable (35.63%):  Games that can be properly played from start to finish Ingame (44.64%):  Games that either can't be finished, have serious glitches or have insufficient performance Intro (17.8%):  Games that display image but don't make it past the menus Loadable (1.