Posts

Showing posts from March, 2020

MongoDB Community Server

Image
MongoDB  is a cross-platform, document-oriented, and   NoSQL database program. Since there is no pre structure table, it is easy to change the scale of the database.  You can easily download MongoDB Community Server using this link . (Select latest .msi version) After downloading the file, you can follow the installation steps and install the MongoDB Compass to your machine. Let's see how to do crud operations using MongoDB Compass. 1. Double click and open the MongoDB Compass. 2. Click "Connect" button and create new connection 3. Click "Create Database" button and create new database 4. Click "Create Database" button 5. Go to the Database and Select the Collection 6. Click "Add Data" button to insert Document 6.1. Insert Data as Objects 6.2. Insert Data using List View Other methods of insertion Output of the insertion 7. Click "Edit" button to update data 8. Edit data

Count Coin Values in Image using MATLAB

Image
As the first step, I am going to read the image.              img = imread('F:/Academic Video/MC/PracticalAssignment_I/Coins.jpg'); As the second step, I am going to crop the image.             img1 = img(700:2500,400:1950,:); As the third step, I am going to convert the image into black and white             bw = im2bw(img1); As the fourth step, I am going to convert the background color into black and object color into white.             bw = ~bw; As the fifth step, I am going to enhance the objects.             se = strel('disk',50);             img2 = imdilate(bw,se);             img2 = imerode(img2,se);             se = strel('disk',60);             img2 = imerode(img2,se); As the sixth step, I am going to get the count of coins.             [L N]=bwlabel(img2);             N             N =                    8 As the seventh step, I am going to label the coins. (text(X coordination ,Y coordination

Take Snapshots Using WebCam in MATLAB

Image
In this post, I am going, open webcam capture image save the captured image  using MATLAB. As the first step, we want to install the support tool. So we have to click "Add-Ons." After that, we have to select "Get Hardware Support Packages." Next, we have to search for  MATLAB Support Package for USB Webcams  and install it. (before installing Add-Ons, you want to log in to MATLAB)  After installing the support tool, You can use these codes. captureimg.m clear; cam = webcam; %start webcam cam.Resolution = '640x360'; %resize the webcam resolution preview(cam); %preview the webcam pause(5); %pause the webcam img = snapshot(cam); %take snapshot closePreview(cam); %close the preview screen imshow(img); %show the image savecapture(img); %call function savecapture clear; %stop the webcam savecapture.m function savecapture(img)     persistent k %static value k for naming variables      if isempty(k)         k = 0;