Final Project

Doakan bisa selesai dalam waktu 2 bulan ini ya.. ( terhitung tanggal 7 Nopember 2008)

posterta-tin.pdf

proposalTA-tin.pdf

Deteksi Posisi Iris.. ( hehe walo blm sempurna, tapi mo ak sempurnain dulu )

iris.jpg

Program Capture Image

import java.io.IOException;
import javax.microedition.lcdui.*;
import javax.microedition.media.*;
import javax.microedition.media.control.*;
import javax.microedition.midlet.MIDlet;
import javax.microedition.media.control.VideoControl;

public class VideoMIDlet extends MIDlet implements CommandListener {
    
    private Display display;
    private Form form;
    private Command exit,back,capture,camera;
    private Player player;
    private VideoControl videoControl;
    private Video video;
    
    public VideoMIDlet() {
        
        exit = new Command(“Exit”, Command.EXIT, 0);
        camera = new Command(“Camera”, Command.SCREEN, 0);
        back = new Command(“Back”, Command.BACK, 0);
        capture = new Command(“Capture”, Command.SCREEN, 0);
        
        form = new Form(“Capture Video”);
        form.addCommand(camera);
        form.setCommandListener(this);
    }
    
    public void startApp() {
        display = Display.getDisplay(this);
        display.setCurrent(form);
    }
    
    public void pauseApp() {}
    
    public void destroyApp(boolean unconditional) {}
    
    public void commandAction(Command c, Displayable s) {
        if (c == exit) {
            destroyApp(true);
            notifyDestroyed();
        else if (c == camera) {
            showCamera();
        else if (c == back)
            display.setCurrent(form);
        else if (c == capture) {
            video = new Video(this);
            video.start();
        }
    }
    
    public void showCamera() {
        try {
            player = Manager.createPlayer(“capture://video”);
            player.realize();
            
            videoControl = (VideoControl)player.getControl(“VideoControl”);
            Canvas canvas = new VideoCanvas(this, videoControl);
            canvas.addCommand(back);
            canvas.addCommand(capture);
            canvas.setCommandListener(this);
            display.setCurrent(canvas);
            player.start();
        catch (IOException ioe) {} catch (MediaException me) {}
    }
    
    class Video extends Thread {
        videoMIDlet midlet;
        public Video(VideoMIDlet midlet) {
            this.midlet = midlet;
        }
        
        public void run() {
            captureVideo();
            
        }
        
        public void captureVideo() {
            try {
                byte[] raw = videoControl.getSnapshot(null);
                Image image = Image.createImage(raw, 0, raw.length);
                form.append(image);
                display.setCurrent(form);
                
                player.close();
                player = null;
                videoControl = null;
            catch (MediaException me) { }
        }
    };
}

import javax.microedition.lcdui.*;
import javax.microedition.media.MediaException;
import javax.microedition.media.control.VideoControl;

public class VideoCanvas extends Canvas {
    private VideoMIDlet midlet;
    
    public VideoCanvas(VideoMIDlet midlet, VideoControl videoControl) {
        int width = getWidth();
        int height = getHeight();
        this.midlet = midlet;
        
        videoControl.initDisplayMode(VideoControl.USE_DIRECT_VIDEO, this);
        try {
            videoControl.setDisplayLocation(22);
            videoControl.setDisplaySize(width - 4, height - 4);
        catch (MediaException me) {}
        videoControl.setVisible(true);
    }
    
    public void paint(Graphics g) {
        int width = getWidth();
        int height = getHeight();
        
        g.setColor(0×00ff00);
        g.drawRect(00, width - 1, height - 1);
        g.drawRect(11, width - 3, height - 3);
    } 

5 Responses
  1. buy :

    Date: November 15, 2008 @ 6:13 pm

    ya ya

  2. munaz :

    Date: December 16, 2008 @ 11:34 am

    keren abiz TA mu tin
    gak diikutin lomba tuh
    sayang klo gak diikutin
    ya minimal PKM lah
    tak doain moga sukses TA nya
    cepet lulus
    andddddddd
    ehmmmmmmmmm………(nikah)

    hehehehehehehe
    dapat salam tuh
    dari erol

  3. tatin :

    Date: December 16, 2008 @ 4:19 pm

    @munaz

    amiin , makasi ya doanya

    huuaa ak butuh lulus tok iki, ga usa melu2 lomba ^^

  4. maz yayan :

    Date: February 9, 2009 @ 4:39 pm

    busyet…udah mo jadi hardcore coder nih… ampun suhu…. ilmu sayah masih cetek dlm dunia coding. isok’e cuman turbo C, bekas peninggalan jaman masih muda dulu. :D

  5. ewyn :

    Date: July 18, 2009 @ 11:37 am

    One Word..
    SUGOI

Leave a Comment

Your comment

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.