Thursday, March 16, 2017

How to Setup the Environments with OpenCV 3 and C++ Using Windows 10 + Visual Studio 2015 (Enterprise Edition) + precompiled binaries

Note: Bold indicates something that will change depending on your version of OpenCV and/or Visual Studio

  1. Though I am using Visual Studio 2015 Enterprise edition you need license for use that version. So if you did not have license Visual Studio Product you can use Visual Studio Community edition. Download and install Visual Studio 2015 Community Edition latest version using Here (yes, it’s free, and choosing all default options will work fine)
  2. Download the latest version of OpenCV Here, for example OpenCV 3.1.0 use by me on future development examples.
  3. Make a folder “C:\OpenCV-X.X.X” for your version of OpenCV, ex. “C:\OpenCV-3.1.0“. ) Double-click on the completed OpenCV download executable, then set “Extract to:” to your “C:\OpenCVX.X.X” directory.
  4. Add the bin directory for your version of OpenCV and Visual Studio to the operating system PATH.
  5. Note: In the OpenCV directories: For example if you are using OpenCV 3.1.0 and Visual Studio 2015 add the following to your PATH:
  6. C:\OpenCV-3.1.0\opencv\build\x64\vc14\bin
  7. Pull up a Command Prompt and verify the bin directory is now in PATH, then reboot.

That is basic for setup the environment and you will be able to learn Create project and make configurations on it, basic image processing techniques example using OpenCV on future post.

Tuesday, July 28, 2015

  Exercise regarding to working with IP Addresses




Questions



1.     What are two main components of an IP address?

2.     In  a  block  of  addresses,  we  know  the  IP  address  of  one  host  is 25.34.12.56/16. What is the network address, first address and the last address in the block?

3.     Find the range of address in following blocks.
                                                       I.            17.34.16.0/23
                                                    II.            180.34.64.64/30
                                                 III.            123.56.77.32/29
                                                IV.            200.17.21.128/27

4.     You are given the network address 175.200.0.0; you are required to have 4 subnets. What is the minimum number of Host Bits can you take in to the Network Bits for this purpose? Write down the addresses of 4 subnets.  Write the subnet mask for the network.

5.     An organization is granted the block 16.0.0.0 in class A. The administrator wants to create 500 subnets.
                               I.            Find the subnet mask.
                            II.            Find the number of addresses in each subnet.
                         III.            Find the first and last address in the first subnet.
                        IV.            Find the first and last address in the last subnet.

6.     An organization is granted the block 130.56.0.0 in class B. The administrator wants to create 1024 subnets.
                               I.            Find the subnet mask.
                            II.             Find the number of addresses in each subnet.
                         III.            Find the first and last address in the first subnet.
                        IV.            Find the first and last address in the last subnet (subnet 1024).

7.     An organization is granted the block 211.17.180.0 in class C. The administrator wants to create 32 subnets.
                               I.            Find the subnet mask.
                            II.             Find the number of addresses in each subnet.
                         III.            Find the first and the last address in the first subnet.
                        IV.            Find the first and the last address in the last subnet (subnet 32).


Answers



1.     Network part and Host Part

2.     Network address- 25.34.0.0/16, 
 
1st address 25.34.00000000.00000001          25.34.0.1/16
Last address 25.34.11111111.11111110         25.34.255.254/16
3.      
                      I.             Subnet mask            
11111111.11111111.11111110.00000000   host part
17.34.00010000.00000001                   17.34.16.1 first address
17.34.00010001.11111110                   17.34.17.254 last address

                     II.            Subnet mask
       11111111.11111111.11111111.11111100   host part
                      180.34.64.11111101                   180.34.64.65 first address
                      180.34.64.11111110                   180.34.64.66 last address

                    III.             Subnet mask            
11111111.11111111.11111111.11111000   host part
123.56.77.00100001                   123.56.77.33 first address
123.56.77.00100110                   123.56.77.38 last address

                     IV.            Subnet mask            
11111111.11111111.11111111.11100000   host part
200.17.21.10000001                   200.17.21.129 first address
200.17.21.10011110                   200.17.21.158 last address

4.           175.200.00000000.00000000
                                                  
        Network part                                               Host part

    175.200.00000000.0                          175.200.0.0/18
    175.200.01000000.0                          175.200.64.0/18
    175.200.10000000.0                          175.200.128.0/18
    175.200.11000000.0                          175.200.192.0/18
5.         
             I.           
       500 subnets, 9 bits should be taken from host part.

          II.           
Number of host bits remain=24-9=15

       III.            First address, first subnet
16.0.0.00000001                      16.0.0.1
               Last address, first subnet
              16.0.01111111.11111110                   16.0.127.254

      IV.            First address, last subnet
            16.11111111.100000000.00000001                     16.255.128.1
             Last address, last subnet
            16.11111111.11111111.11111110                   16.255.1255.254

6.      
             I.           

1024 subnets, 10 bits should be taken from host part.

          II.           
Number of host bits remain=16-10=6

       III.            First address, first subnet
130.56.0.00000001                      130.56.0.1
               Last address, first subnet
              130.56.0.00111110                  130.56.0.62

      IV.             First address, last subnet
130.56.1111111.11000001                      130.56.255.193
             Last address, last subnet
            130.56.1111111.11111110                      130.56.255.254
7.      
             I.           
32 subnets, 5 bits should be taken from host part.

          II.           
Number of host bits remain=8-5=3

       III.             
First address, first subnet
              211.17.180.00000001                      211.17.180.1/29
              Last address, first subnet
                211.17.180.00000110                      211.17.180.6/29

      IV.             First address, last subnet
211.17.180.11111001                      211.17.180.249/29
             Last address, last subnet
211.17.180.11111110                     211.17.180.254/29