Image Processing Previos Lab Review

import java.awt.*;
import java.applet.*;
import java.awt.image.*;

public class test2 extends Applet
{
Image pic, bwpic, greypic, redpic, greenpic, bluepic;

public void init()
{

pic = getImage(getDocumentBase(), "bear.gif");
MediaTracker t = new MediaTracker(this);
t.addImage(pic, 0);
try
{
t.waitForAll();
}
catch (Exception e)
{
}

ImageProducer p1 = pic.getSource();
BWFilter BnW = new BWFilter();
bwpic = createImage(new FilteredImageSource(p1, BnW));

ImageProducer p2 = pic.getSource();
GreyFilter grey = new GreyFilter();
greypic = createImage(new FilteredImageSource(p2, grey));

ImageProducer p3 = pic.getSource();
RedFilter red = new RedFilter();
redpic = createImage(new FilteredImageSource(p3, red));

ImageProducer p4 = pic.getSource();
GreenFilter green = new GreenFilter();
greenpic = createImage(new FilteredImageSource(p4, green));

ImageProducer p5 = pic.getSource();
BlueFilter blue = new BlueFilter();
bluepic = createImage(new FilteredImageSource(p5, blue));

}

public void paint(Graphics g)
{
g.drawImage(pic,0, 10, this);
g.drawImage(bwpic, 300, 10, this);
g.drawImage(greypic, 600, 10, this);
g.drawImage(redpic, 0, 400, this);
g.drawImage(greenpic, 300, 400, this);
g.drawImage(bluepic, 600, 400, this);
}
}


class BWFilter extends RGBImageFilter
{
public int filterRGB (int x, int y, int rgb)
{
int alpha = (rgb >> 24) & 0xff;
int red = (int) (((rgb >> 16) & 0xff) * 0.3f);
int green = (int) (((rgb >> 8) & 0xff) * 0.59f);
int blue = (int) (((rgb >> 0) & 0xff) * 0.11f);
int bws = red + green + blue;

if(bws > 127)
{
bws = 255;
}
else
{
bws = 0;
}
return ((alpha & 0xff) << 24) | ((bws & 0xff) << 16) | ((bws & 0xff) << 8) | ((bws & 0xff) << 0);
}
}

class GreyFilter extends RGBImageFilter
{

public int filterRGB (int x, int y, int rgb)
{
int alpha = (rgb >> 24) & 0xff;
int red = (int) (((rgb >> 16) & 0xff) * 0.3f);
int green = (int) (((rgb >> 8) & 0xff) * 0.59f);
int blue = (int) (((rgb >> 0) & 0xff) * 0.11f);
int bws = red + green + blue;
return ((alpha & 0xff) << 24) | ((bws & 0xff) << 16) | ((bws & 0xff) << 8) | ((bws & 0xff) << 0);
}
}

class RedFilter extends RGBImageFilter
{

public int filterRGB(int x, int y, int rgb)
{
return rgb & 0xffff0000;
}
}

class GreenFilter extends RGBImageFilter
{
public int filterRGB(int x, int y, int rgb)
{
return rgb & 0xff00ff00;
}
}

class BlueFilter extends RGBImageFilter
{

public int filterRGB(int x, int y, int rgb)
{
return rgb & 0xff0000ff;
}
}
Thanks to GCA and Siew Hao

3rd Sem Exam Time Table

Network Assigment

Step 1 :go spin dowload the CollectionOfJava.rar.

Step 2:Extract all the file into a new folder.

Step 3:compile the RecvTCP.java and SendTCP.java in command prompt.
(example: javac RecTCP.java)

Step 4: Run the RecTCP.java(as server) first then only run SendTCP.java(as client) in command prompt.
(**example:
java RecTCP 7000(at server cmd)
java SendTCP "" 7000 (at client cmd)

You will see the output like this

Server


Client

***For the RecvUDP and SendUDP also same as above step!

KOMUNIKASI DATA DAN TELEKOMUNIKASI Pass Year

I. Which of the following is not a characteristic of microwaves?

A. Microwaves can be used to send signal in all direction.

S. Very high frequency microwaves cannot penetrate walls.

C. Microwaves are used in cellular telephone networks, satellite networks and wireless LANS.

D. Microwaves support high data rate.

2. Which of the following application does not need line-of-sight for transmission?

A. TV remote control.

B. Satellite networks.

C. Cellular telephone base stations.

D. Maritime radio.

3. Data transfers amongst Bluetooth devices are conducted via

A. Radio waves

B. Micro waves

C. Terrestrial microwaves

D. Infrared waves

4. Which of the following protocol is not used in noisy channel?

A. Stop-and-Wait.

B. Stop-and-Wait ARQ

C. Go-back-N ARQ

D. Selective Repeat ARQ.

KOMUNIKASI DATA DAN TELEKOMUNIKASI Pass Year

I. Which of the following is not a characteristic of microwaves?

A. Microwaves can be used to send signal in all direction.

S. Very high frequency microwaves cannot penetrate walls.

C. Microwaves are used in cellular telephone networks, satellite networks and wireless LANS.

D. Microwaves support high data rate.

2. Which of the following application does not need line-of-sight for transmission?

A. TV remote control.

B. Satellite networks.

C. Cellular telephone base stations.

D. Maritime radio.

3. Data transfers amongst Bluetooth devices are conducted via

A. Radio waves

B. Micro waves

C. Terrestrial microwaves

D. Infrared waves

4. Which of the following protocol is not used in noisy channel?

A. Stop-and-Wait.

B. Stop-and-Wait ARQ

C. Go-back-N ARQ

D. Selective Repeat ARQ.

KOMUNIKASI DATA DAN TELEKOMUNIKASI Pass Year

I. Which of the following is not a characteristic of microwaves?

A. Microwaves can be used to send signal in all direction.

S. Very high frequency microwaves cannot penetrate walls.

C. Microwaves are used in cellular telephone networks, satellite networks and wireless LANS.

D. Microwaves support high data rate.

2. Which of the following application does not need line-of-sight for transmission?

A. TV remote control.

B. Satellite networks.

C. Cellular telephone base stations.

D. Maritime radio.

3. Data transfers amongst Bluetooth devices are conducted via

A. Radio waves

B. Micro waves

C. Terrestrial microwaves

D. Infrared waves

4. Which of the following protocol is not used in noisy channel?

A. Stop-and-Wait.

B. Stop-and-Wait ARQ

C. Go-back-N ARQ

D. Selective Repeat ARQ.

Networking Chapter 6 - Quiz

1 The sharing of a medium and its link by two or more devices is called _______.

A) modulation

B) encoding

C) line discipline

D) multiplexing

2 Which multiplexing technique transmits analog signals?

A) FDM

B) TDM

C) WDM

D) (a) and (c)

3 Which multiplexing technique transmits digital signals?

A) FDM

B) TDM

C) WDM

D) None of the above

4 Which multiplexing technique shifts each signal to a different carrier frequency?

A) FDM

B) TDM

C) Both (a) and (b)

D) None of the above

5 In synchronous TDM, for n signal sources of the same data rate, each frame contains _______ slots.

A) n

B) n + 1

C) n - 1

D) 0 to n

6 In TDM, the transmission rate of the multiplexed path is usually _______ the sum of the transmission rates of the signal sources.

A) greater than

B) less than

C) equal to

D) not related to

7 Which multiplexing technique involves signals composed of light beams?

A) FDM

B) TDM

C) WDM

D) none of the above

8 _________ utilization is the use of available bandwidth to achieve specific goals.

A) Frequency

B) Bandwidth

C) Amplitude

D) None of the above

9 ________ can be achieved by using multiplexing; ______ can be achieved by using spreading.

A) Efficiency; privacy and antijamming

B) Privacy and antijamming; efficiency

C) Privacy and efficiency; antijamming

D) Efficiency and antijamming; privacy

10 ________ is the set of techniques that allows the simultaneous transmission of multiple signals across a single data link.

A) Demodulating

B) Multiplexing

C) Compressing

D) None of the above

11 In a multiplexed system, __ lines share the bandwidth of ____ link.

A) 1; n

B) 1; 1

C) n; 1

D) n; n

12 The word ______ refers to the portion of a _______ that carries a transmission.

A) channel; link

B) link; channel

C) line; channel

D) line; link

13 ______ can be applied when the bandwidth of a link (in hertz) is greater than the combined bandwidths of the signals to be transmitted.

A) TDM

B) FDM

C) Both (a) or (b)

D) Neither (a) or (b)

14 FSM is an _________technique.

A) analog

B) digital

C) either (a) or (b)

D) none of the above

15 ____ is designed to use the high bandwidth capability of fiber-optic cable.

A) FDM

B) TDM

C) WDM

D) None of the above

16 ______ is an analog multiplexing technique to combine optical signals.

A) FDM

B) TDM

C) WDM

D) None of the above

17 _____ is a digital process that allows several connections to share the high bandwidth of a link.

A) FDM

B) TDM

C) WDM

D) None of the above

18 _____ is a digital multiplexing technique for combining several low-rate channels into one high-rate one.

A) FDM

B) TDM

C) WDM

D) None of the above

19 We can divide ____ into two different schemes: synchronous or statistical.

A) FDM

B) TDM

C) WDM

D) none of the above

20 In ________ TDM, each input connection has an allotment in the output even if it is not sending data.

A) synchronous

B) statistical

C) isochronous

D) none of the above

21 In ________ TDM, slots are dynamically allocated to improve bandwidth efficiency.

A) synchronous

B) statistical

C) isochronous

D) none of the above

22 In ________, we combine signals from different sources to fit into a larger bandwidth.

A) spread spectrum

B) line coding

C) block coding

D) none of the above

23 _______ is designed to be used in wireless applications in which stations must be able to share the medium without interception by an eavesdropper and without

being subject to jamming from a malicious intruder.

A) Spread spectrum

B) Multiplexing

C) Modulation

D) None of the above.

24 The _______ technique uses M different carrier frequencies that are modulated by the source signal. At one moment, the sign modulates one carrier frequency;

at the next moment, the signal modulates another carrier frequency.

A) FDM

B) DSSS

C) FHSS

D) TDM

25 The ______ technique expands the bandwidth of a signal by replacing each data bit with n bits.

A) FDM

B) DSSS

C) FHSS

D) TDM

Related Posts with Thumbnails