Posts

CODU Sudoku

Image
Problem Description ( TCS Codevita-2020   CODU Sudoku ) CODU is solving a 7x7 sudoku. Help him in solving the unique Sudoku. Rules are as follows 1. There are 7 regions colored differently. Each region must have a single occurrence of numbers between range [1, 7]. 2. Regions don't have a fix shape and it can change from input to input. 3. Each row must have a single occurrence of numbers between range [1, 7] across all input. 4. Each column must have a single occurrence of numbers between range [1, 7] across all input. Some numbers in some rows, columns and regions will be given. These will be between [1, 7]. Zero (0) denotes that the number is covered. Uncovering it will give a number between [1, 7]. Your task is to fill the numbers [1,7] where there is a 0 such that the 7x7 Sudoku is solved. 7x7 Sudoku is said to be solved when every region, every column, every row has exactly one occurrence of numbers [1,7]. Constraints 7 < Known/Given numbers in Entire Sudoku < 14 Input I

Distance measurement using opencv

Image
In Covid-19 pandemic, we all know about the importance of Social Distancing . Right now, It is the only thing that can help to reduce the number of affected people. So I have decided to make a social distancing checker using python. The main idea is to measure the distance of object in the image and if the distance between two objects are less than some predefined pixel value then 'green' dot at the center of the bounding-box will convert to 'red' dot . The output of the code will like this- social distancing checker Python code for Distance Measurement I am providing the python code to measure the distance of the object in the image or each frame of a video. Later I will discuss some key points related to the code. Key points to be Noted: Everything will be the same like object detection (discussed in Part-I and Part-II ) as I have implemented distance measurement based on object detection. We will filter out only the  'person' object   from the obje

Object Detection (PART-II)

Image
  The  most fundamental computer technology  related to Computer vision and Image Processing is  Object Detection.  It deals with detecting the   semantic object of a certain class in digital images and videos. In the previous post, I have shown you how to detect object very easily with less than 15 lines of code. But our concern is about the FPS(Frames Per Second). Check out the  Object Detection (PART-I)    if you have not seen yet.  In this post, we are going to optimize the previous post so that we can improve the FPS. In this case also we are gong to use YOLO  model again. There are 80 different classes that can be detected using YOLO model. such as-       person, bicycle, car, motorcycle, airplane, bus, train, truck, boat, traffic light, fire hydrant, stop_sign, parking meter, bench, bird, cat, dog, horse, sheep, cow, elephant, bear, zebra, giraffe, backpack, umbrella, handbag, tie, suitcase, frisbee, skis, sn

Object Detection (Part I)

Image
The most fundamental computer technology related to Computer vision and Image Processing is Object Detection. It deals with detecting the   semantic object of a certain class in digital images and videos. Have a look on the images, bellow. Object detection with YOLO Detecting home objects Here, we can see that the model can detect the home objects (chair, bag, laptop, bottle, laptop, bowl, cup etc.) and also the outer-home objects ( bus, bi-cycle, human, car etc.).  Object Detection Object Detection is a supervised learning technique by which the model can detect or predict the object present in the digital images or videos. We can make our own object detecting tool using python with the help of Computer vision with deep learning model ( Here we have used YOLO model ). In this post we are going to create our own object detecting model in python.  As this is the PART-I, I will keep this very simple but FPS(Frames Per Seconds)  will be very low due to its simplicity. In the next post

Introduction to Computer Vision

Image
  Do you ever think, how Facebook can automatically tag your friend when you upload an image, how your smart phone can recognize you, using it's very advanced and accurate  Face recognition feature.  Have you ever thought how a picture is processed by computer , how a picture  is stored in computer  etc.   These are very few examples, many more will be discussed as we go on, of Computer Vision. Well, In this post we are going to discuss about Computer Vision. So let's get started. What is C omputer Vision ? Computer Vision is a  interdisciplinary field that helps computer to make high-level understanding from digital images and videos to automate the task that human visuals do. It use some techniques  by which computer can understand many useful information from an image and perform some action based on that information. We see an image and our brain can understand the message, delivered by the image. Machines do exactly the same thing. Various applications of C omputer Vi

Invisible Cloak using OpenCV

Image
Have you ever seen Harry Potter’s   Invisible Cloak   If not then let's have a look.     Was it wonderful? Do you surprised how this can be possible? If yes, then this post is going to help you. You will be able to make such invisible cloak by your own but yes, not in real way but it is all about graphics . Algorithm behind the idea First, we take the background frame ( for some second ) and store in the memory. Then, we will take the frame with cloth. Then, detect and segment the portion of the cloth of pre-determined color. For Example here we will use Red. [ known as Color Detection and Image Segmentation ] Then, that segment will be replaced by the background , we have stored in the memory, segment. At last, create the final image to make the magic. Note: All the things will be done in python due to the availability of the various libraries mainly numpy . Python Code: First of all, importing all the required libraries.   To make a vid