Final Report Krishna Minor

Embed Size (px)

Citation preview

  • 8/8/2019 Final Report Krishna Minor

    1/29

    Implementation

    ofSelectionist relaxation:genetic algorithm

    applied to

    image segmentation

    Under GuidanceOf

    Respected Mrs. Akshi Kumar

    From:

    Krishna Chandra Soni

    M.Tech Software Engg.

    3rd Sem, 10/MT/SE/FT

    Delhi Technological University

    1

  • 8/8/2019 Final Report Krishna Minor

    2/29

    CERTIFICATE

    Delhi Technological University

    (Govt. of National Capital Territory of Delhi)

    BAWANA ROAD, DELHI 110042

    This is certified that the minor project report entitled as Implementation of

    Selectionist relaxation: genetic algorithm applied to image segmentation is

    a work of Krishna Chandra Soni, M-Tech (SE) a student of Delhi

    Technological University. This work is completed under my direct

    supervision and guidance and forms a part of Master of Technology

    (Software Engg.)course and curriculum. He has completed his work with

    utmost sincerity and diligence.

    The work embodied in this minor project has not been submitted for the award

    of any other degree to the best of my knowledge.

    Mrs Akshi Kumar

    Assistant Professor & Project Guide

    Dept. Of Computer Engineering

    DelhiTechnological University

    India

    Acknowledgement

    2

  • 8/8/2019 Final Report Krishna Minor

    3/29

    It is a great pleasure of mine to have the opportunity to extend my heartiest felt gratitude to

    everybody who helped me throughout the course of this project.

    It is distinct pleasure to express my deep sense of gratitude and indebtedness to my learned

    supervisor Respected Mrs. Akshi Kumar, Assistant Professor, Computer Department for her

    invaluable guidance, encouragement and patient reviews. Her continuous inspiration only has

    made me complete this dissertation. Without her help and guidance, this dissertation would

    have been impossible. She provided the conceptions and theoretical background for this study

    as well as suggested us the rational approach. She remained a pillar of help throughout the

    project.

    With her continuous inspiration only, it becomes possible to complete this dissertation.

    I would also like to take this opportunity to present my sincere regards to my teachers Dr.

    Daya Gupta and the other staff of computer engineering department for providing me

    unconditional and any time access to the resources and guidance.

    I am grateful to my parents for their moral support all the time; they have been always around

    to cheer me up, in the odd times of this work. I am also thankful to my classmates for their

    unconditional support and motivation during this work. Last but not least, I special thanks to

    the crowd who are active in the field of Image Mining and Ambiguity issues.

    Krishna Chandra Soni

    M.Tech Software Engg.

    3rd Sem, 10/MT/SE/FT

    Delhi Technological University

    Abstract

    3

  • 8/8/2019 Final Report Krishna Minor

    4/29

  • 8/8/2019 Final Report Krishna Minor

    5/29

    Certificate ............................ii

    Acknowledgement..........................iii

    Abstract ...........................iv

    1.Introduction............................................................................................................. .....6

    2. Method Description.....................................................................................................6

    2.1 Brief description about the concept used....................................................................7

    2.2 Algorithm

    Details.............................................................................................................................8

    2.2.1 Selection Phase: Units and fitness.............................................................................8

    2.2.2. Relaxation cycle .....................................................................................................8

    2.2.2.1. Selection .............................................................................................................8

    2.2.2.2. Crossover and mutation........................................................................................9

    3. Conclusion..................................................................................................................10

    4. Snapshots ...................................................................................................................11

    5. Implementation...........................................................................................................13

    6.References....................................................................................................................29

    5

  • 8/8/2019 Final Report Krishna Minor

    6/29

    1. Introduction

    Image segmentation is a low-level image processing task that aims at partitioning an image

    into homogeneous regions and output of which can be fed as input to higher-level processing

    tasks, such as model-based object recognition systems. Today we are available with large

    number of segmentation techniques and large number of researches are being carried out to

    find new methods in this domain.

    Genetic algorithm is one of the approach that is applied in this domain to enhance results.

    The idea behind this approach is that natural evolution is a search process that seeks to

    optimize the structures it generates. In a GA, a population of candidate solutions to the

    problem to be solved, which are encoded into chromosomes, is iteratively updated throughmechanisms of selection, crossover, and mutation. With time, good solutions spread within

    the population by being selected to replace bad ones, while new, possibly better, solutions are

    permanently being generated from previous ones through crossover and mutation.

    But problem with existing GA is that they requires an objective function which are and may

    be complicated to predict .More exact the objective function , more will be the accuracy

    hence better will be the results. Each objective functions requires one or more parameter that

    are dufficult to predict , also they need to be adjusted with evolution which is quite complex

    task. Thus evaluating a segmentation result is itself a difficult task. To date, no standard

    evaluation method prevails and different measures may yield distinct rankings.

    To avoid these drawbacks, Philippe Andrey advocated an unsupervised GA-based image

    segmentation method that does not require the definition of an objective fitness function

    evaluating candidate segmentation results. The output segmentation instead emerges as a by-

    product of the evolution of a population of chromosomes that are mapped onto the image and

    that locally adapt to its features.

    2. Method Description

    Selectionist relaxation (SR) is an unsupervised,fine-grained distributed genetic algorithm

    applied image segmentation,which is basically a two step proceedure: Selection followed by

    Relaxation, which is a three step proceedure consisting of selection, crossover, mutation.

    By contrast to the standard GA scheme ,wherein each chromosome can interact through

    selection and crossover with any other one in the population, interactions in distributed GAs

    6

  • 8/8/2019 Final Report Krishna Minor

    7/29

    are restricted to occur within subsets of individuals.

    In fine grained distributed scheme , the unique population is mapped onto a grid and

    interactions are restricted to occur among neighboring chromosomes. The use of a fine-

    grained scheme is here imposed by the two-dimensional image structure.

    After having defined the chromosomes, herein referred to as units, and the fitness function, we

    describe the three main steps of the GA cycle (selection, crossover, and mutation).

    2.1 Brief description about the concept used

    In the proposed algorithm , image to be segmented is considered as an artificial

    environment, containing collection of different features.

    Different features forms different regions with different characterstics.

    Hence each segmented part are region with different characterstics. And each region

    have unique name or label. Region is collection of units.

    Unit is combination of chromosome and their fitness value.

    Initially at begining , each pixel of image represents a unit labelled differently and

    thus chromosomes are distributed all over region.

    We apply selection process over entire image using image site windw of size 3*3

    which is set of neighboorhood pixels.to find and replace the current observed unit

    with the unit which leads to effective segmentation based on fitness value.

    After which we apply relaxation process which contains a cycle of selection , cross

    over and mutation.

    During selection phase we select same label units to determine connected region,

    As a result of selection, if a unit is surrounded by other units having same label then

    such a unit is reffered as NONEDGE unit , if a unit have atleast one neighboor having

    different label then it will be reffered as EDGE unit. In this way we can be able to

    determine different regions , which is collection of units of same label, within an

    image.

    After selection we apply cross over and mutation , which is only applied to units if it

    is a NONEDGE unit.

    During crossover, a NONEDGE unit is recombined ,with one of its eight neighboor

    which is picked randomly. Recombination is done with probability X , reffered to as

    crossover rate.

    The mutation of a unit depends on the local properties of the image at the site where

    7

  • 8/8/2019 Final Report Krishna Minor

    8/29

    the unit is located. The mutation rate m is the probability that a position along the

    chromosome undergoes a mutation. Mutating the ith allele ui of the unit located at site

    s consists of replacing ui by ui+d , where d is randomly sampled from the Gaussian

    distribution N(0,m*variance). m is referred to as mutation amplitude . It is computed

    over the k 3 k image window centeredon s.

    The above process is repeated till we segment entire image.

    2.2 Algorithm Details

    2.2.1 Selection Phase: Units and fitness

    A unit is a real-coded chromosome of length p that represents apoint in the feature space. Thecoordinates of the unit in feature space are referred to as its alleles. A population of units is

    built by assigning a unit to each site of the image. At site s, the fitnessfsof the associated unit

    us= (u1,...,up) is computed as the opposite of the city-block distance between us and vs, so that

    a unit whose alleles are close to the actual local pixels values will have a high fitness:p

    Each unit also owns a label used as a region label for the pixel where the unit is located.

    Initially, all units have distinct labels and their alleles are randomly generated by uniform

    sampling in the range of gray level values (typically, 0-255).

    2.2.2. Relaxation cycle

    The initial random population is then fed into the relaxation process, which consists in

    iterating the classical three-step GA cycle (selection, crossover, mutation).

    2.2.2.1. Selection

    The selection scheme implemented in SR is a local tournament selection .It consists in replacing the

    unit located at site s by the unit having the highest fitness value in the neighborhood. The

    neighborhood hs, at site s is arbitrarily defined as the 3* 3 set of units centered on s.To avoid potential

    side-effects of sequential replacement,local tournaments take place simultaneously at all sites.As a

    result of local selections, a unit can be surrounded by neighboring units all having the same label as

    its own label. Such a unit will be referred to as a NonEdgeUnit.Alternatively, a unit can have at least

    one neighbor with a different label and will then be referred to as an EdgeUnit. Our selection

    8

  • 8/8/2019 Final Report Krishna Minor

    9/29

    scheme departs from other local tournament selection implemented in fine grained GAs ,since

    at a site occupied by an EdgeUnit, the tournament involves an additional unit picked at

    random in the population. This modification allows units to propagate over regions sharing

    identical gray level characteristics though not being connected.

    Fig. 1. Pseudo-code for the selection step.

    2.2.2. 2. Crossover and mutation

    Crossover and mutation are applied to a unit if and only if it is a N ONEDGEUNIT. A unit that

    fulfils this mating restric

    Fig. 2. Pseudo-code for the crossover step.

    tion is allowed to recombine with one of its eight neighbors, which is picked at random.

    Crossover is generalized uniform crossover [24,25]. For each position along the two

    chromosomes, an exchange occurs with probability x, referred to as crossover rate.

    The mutation of a unit depends on the local properties of the image at the site where the unit is

    9

  • 8/8/2019 Final Report Krishna Minor

    10/29

    located. The mutation rate /A is the probability that a position along the chromosome

    undergoes a mutation. Mutating the ith allele uiof the unit located at sites consists of replacing

    uiby ui+ 6, where d is randomly sampled from the Gaussian distribution 9\2 (0,mas). m is

    referred to as mutation amplitude, while asis the variance of the local gray level distribution

    around sites. It is computed over the kXkimage window centered ons.

    Fig. 3. Pseudo-code for the mutation step

    3. Conclusion

    We have described an unsupervised image segmentation method based on a fine-grained

    distributed GA. Two main points characterize the departure of SR from other applications of

    GAs to the problem of image segmentation .Firstly, The method is generic since it can be

    applied to segmentation according to any criterion (gray level, texture, depth,etc.).

    Secondly,no segmentation evaluation criterion is required in SR. Also we try to overcome the

    difficulty of evaluating parameter and thieir tuning on existing segmentation algorithms, con-

    ventional applications of GAs to the segmentation problem introduce the difficulty of tuning

    the parameters of the GA itself. Besides, the conventional approach requires an objective

    fitness function, which may itself depend on parameters that have to be heuristically tuned.

    10

  • 8/8/2019 Final Report Krishna Minor

    11/29

    4. Snapshots

    Snapshot 1

    11

  • 8/8/2019 Final Report Krishna Minor

    12/29

    Snapshot 2

    Snapshot 3

    12

  • 8/8/2019 Final Report Krishna Minor

    13/29

    Snapshot 4

    5. Implementation

    ImageSegmentation.java

    package segmentation;import java.awt.image.*;

    import java.io.*;

    import javax.imageio.*;

    import javax.swing.ImageIcon;

    import javax.swing.JFrame;

    import javax.swing.JLabel;

    import java.util.HashMap;import java.util.Random;

    import java.awt.*;//for JFrame and JLabel etc

    /**

    * ImageSegmentation is a class encapsulate the process of segmentation using GA

    */

    public class ImageSegmentation {

    //windows size

    final static int WINDOW_K = 3;

    //the probability of crossover

    final static double CROSSOVER_RATE = 0.5;

    //the total generations of the process

    final static int GENERATION = 64;

    //the probability of mutation

    final static double MUTATION_RATE = 1.0 / GENERATION;

    //the mutation amplitude of the local gray level distribution

    final static double MUTATION_AMPLITUDE = 1.0;

    //the max distance of the unit and local site

    final static int MAX_DISTANCE = -2304;

    //the original image which is going to be processed

    BufferedImage im;

    //the width and height of the image

    13

  • 8/8/2019 Final Report Krishna Minor

    14/29

    int nWidth, nHeight;

    //the matrix of the units

    Unit[][] population;

    /**

    * constructor

    */

    public ImageSegmentation(){

    im = null;

    population = null;

    }

    /**

    * load a image from file

    */

    public void loadImage(String path){

    try{

    InputStream in = new BufferedInputStream(new FileInputStream(path));

    im = ImageIO.read(in);

    nWidth = im.getWidth();

    nHeight = im.getHeight();

    }

    catch(IOException e){

    System.out.println("Read image failed.");

    }

    initial();

    }

    /**

    * initialization

    */

    public void initial(){

    int[] ch = null;

    int length = WINDOW_K * WINDOW_K;

    int gray = 0;

    14

  • 8/8/2019 Final Report Krishna Minor

    15/29

    int x = 0, y = 0;

    Random rand = new Random();

    population = new Unit[nHeight + 2][];

    for(int i = 0; i < nHeight + 2; i++)

    {

    population[i] = new Unit[nWidth + 2];

    for(int j = 0; j < nWidth + 2; j++)

    {

    y = i;

    x = j;

    if(y == 0)

    y++;

    if(x == 0)

    x++;

    if(y == nHeight + 1)

    y--;

    if(x == nWidth + 1)

    x--;

    gray = (im.getRGB(x - 1, y - 1) & 0xff) % 256;

    population[i][j] = new Unit(gray, i * nWidth + j);

    //initial chromosome

    ch = population[i][j].getChromo();

    //randomly initial chromosome

    for(int m = 0; m < length; m++)

    {

    ch[m] = rand.nextInt(256);

    }

    }

    }

    //compute local gray level distribution around site (j,i)

    double mean;

    double variance;

    double temp = 0;

    for(int i = 1; i < nHeight + 1; i++)

    15

  • 8/8/2019 Final Report Krishna Minor

    16/29

    for(int j = 1; j < nWidth + 1; j++)

    {

    mean = 0;

    for(int m = -WINDOW_K / 2; m < (WINDOW_K + 1) / 2; m++)

    for(int n = -WINDOW_K / 2; n < (WINDOW_K + 1) / 2; n++){

    mean += population[i + m][j + n].getGray();

    }

    variance = 0;

    temp = 0;

    for(int m = -WINDOW_K / 2; m < (WINDOW_K + 1) / 2; m++)

    {

    for(int n = -WINDOW_K / 2; n < (WINDOW_K + 1) / 2; n++)

    {

    temp = population[i + m][j + n].getGray() - mean;

    variance += temp * temp;

    }

    population[i][j].setCita(Math.sqrt(variance * MUTATION_AMPLITUDE));

    }

    }

    /**

    * fitness function

    */

    public int getFitness(int x, int y, Unit u){

    int sum = 0, index = 0;

    int xt = 0, yt = 0;

    int[] c = u.getChromo();

    for(int i = -WINDOW_K / 2; i < (WINDOW_K + 1) / 2; i++)

    for(int j = -WINDOW_K / 2; j < (WINDOW_K + 1) / 2; j++){

    yt = y + i;

    xt = x + j;

    if(yt < 0 || yt >= nHeight + 2 || xt < 0 || xt >= nWidth + 2)

    continue;

    index = (i + WINDOW_K / 2) * WINDOW_K + (j + WINDOW_K / 2);

    16

  • 8/8/2019 Final Report Krishna Minor

    17/29

    sum += Math.abs(c[index] - population[yt][xt].getGray());

    }

    sum = 0 - sum;

    return sum;

    }

    /**

    * selection process

    */

    public void selection(){

    int distance = MAX_DISTANCE;

    int x = 0, y = 0;

    int temp = 0;

    int[] v = null, u = null;

    int length = WINDOW_K * WINDOW_K;

    boolean isEdge = false;

    int label;

    for(int i = 1; i < nHeight + 1; i++)

    for(int j = 1; j < nWidth + 1; j++){

    //local tournament selection

    v = population[i][j].getChromo();

    temp = 0;

    x = y = 0;

    distance = MAX_DISTANCE;

    for(int m = -1; m < 2; m++)

    for(int n = -1; n < 2; n++)

    {

    temp = getFitness(j + n, i + m, population[i + m][j + n]);

    if(temp > distance){

    distance = temp;

    x = j + n;

    y = i + m;

    }

    17

  • 8/8/2019 Final Report Krishna Minor

    18/29

    }

    //deal with the EdgeUnit

    if(population[i][j].getEdge()){

    Random rand = new Random();

    int rx = rand.nextInt(nWidth);

    int ry = rand.nextInt(nHeight);

    for(int m = -1; m < 2; m++)

    for(int n = -1; n < 2; n++)

    {

    temp = getFitness(j + n, i + m, population[ry][rx]);

    if(temp > distance){

    distance = temp;

    x = rx;

    y = ry;

    }

    }

    }

    //replacement

    isEdge = false;

    u = population[y][x].getChromo();

    label = population[y][x].getLabel();

    population[i][j].setLabel(label);

    for(int m = 0; m < length; m++)

    v[m] = u[m];

    for(int m = -1; m < 2; m++)

    for(int n = -1; n < 2; n++){

    if(population[i + m][j + n].getLabel() != label){

    isEdge = true;

    break;

    }

    }

    population[i][j].setEdge(isEdge);

    }

    }

    18

  • 8/8/2019 Final Report Krishna Minor

    19/29

    /**

    * crossover process

    */

    public void crossover(){

    Random rand = new Random();

    for(int i = 1; i < nHeight + 1; i++)

    for(int j = 1; j < nWidth + 1; j++){

    if(!population[i][j].getEdge()){

    int x = 0, y = 0;

    while(x == 0 && y == 0){

    x = rand.nextInt(3) - 1;

    y = rand.nextInt(3) - 1;

    }

    int[] chv = population[i][j].getChromo();

    int[] chu = population[y + i][x + j].getChromo();

    int temp = 0;

    for(int m = 0; m < 9; m++){

    if(rand.nextDouble() < CROSSOVER_RATE){

    temp = chv[m];

    chv[m] = chu[m];

    chu[m] = temp;

    }

    }

    }

    }

    }

    /**

    * mutation process

    */

    public void mutation(){

    int length = WINDOW_K * WINDOW_K;

    for(int i = 1; i < nHeight + 1; i++)

    19

  • 8/8/2019 Final Report Krishna Minor

    20/29

    for(int j = 1; j < nWidth + 1; j++){

    if(!population[i][j].getEdge()){

    Random rand = new Random();

    int[] ch = population[i][j].getChromo();

    for(int m = 0; m < length; m++){

    if(rand.nextDouble() < MUTATION_RATE){

    ch[m] += rand.nextGaussian() * population[i][j].getCita();

    }

    }

    }

    }

    }

    /**

    * print the original image, processed image and the segmentation result

    */

    public void print(){

    //create a new image to show the segmentation result

    int color = 0;

    int[] ch = null;

    BufferedImage image = new BufferedImage(nWidth, nHeight,

    BufferedImage.TYPE_INT_ARGB);

    for(int i = 1; i < nHeight + 1; i++){

    for(int j = 1; j < nWidth + 1; j++){

    ch = population[i][j].getChromo();

    color = ch[4] % 256;

    //color = population[i][j].getGray();

    color += (color

  • 8/8/2019 Final Report Krishna Minor

    21/29

    HashMap labmap = new HashMap(nWidth * nHeight /

    8);

    int label = 0;

    int lcolor = 0;

    Random rand = new Random();

    int red = 128, blue = 128, green = 128;

    for(int i = 1; i < nHeight + 1; i++){

    for(int j = 1; j < nWidth + 1; j++){

    label = population[i][j].getLabel();

    if(labmap.containsKey(Integer.valueOf(label))){

    lcolor = labmap.get(Integer.valueOf(label)).intValue();

    labeledImage.setRGB(j - 1, i - 1, lcolor | 0xff000000);

    continue;

    }

    red = rand.nextInt(256);

    green = rand.nextInt(256);

    blue = rand.nextInt(256);

    lcolor = (red

  • 8/8/2019 Final Report Krishna Minor

    22/29

    }

    public static void main(String prog[]){

    BufferedReader _in = new BufferedReader(new InputStreamReader(System.in));

    String path = "Fig8.02(b).jpg";

    try{

    System.out.print("Input image path: ");

    path = _in.readLine();

    }

    catch(Exception e){

    System.out.print("Wrong path");

    }

    ImageSegmentation ig = new ImageSegmentation();

    ig.loadImage(path);

    for(int step = 0; step < ImageSegmentation.GENERATION; step++){

    ig.crossover();

    ig.mutation();

    ig.selection();

    }

    ig.print();

    }

    }

    22

  • 8/8/2019 Final Report Krishna Minor

    23/29

    GaussRandom.java

    package segmentation;

    import java.util.Random;

    / *

    FTable: normal distribution function table

    fTable: normal probability density table

    * /

    public class GaussRandom {

    final int GAUSS_TABLE_LENGTH = 256;

    double miu, cita;

    double[] FTable = new double[GAUSS_TABLE_LENGTH];

    double[] fTable = new double[GAUSS_TABLE_LENGTH];

    public GaussRandom(double m, double c){

    miu = m;

    cita = c;

    }

    / * Generate the normal distribution function and the normal probability density function

    table, the table width is 3 times the variance

    Normal distribution function with mean 0 and variance 1 * /

    public final void initial(){

    int i = 0;

    double h = 6.0 / GAUSS_TABLE_LENGTH / 2.0; //

    double x = -3, temp = 0;

    double C = 1 / Math.sqrt(2 * Math.PI);

    fTable[0] = Math.exp(-x * x / 2) * C;

    for(i = 1; i < GAUSS_TABLE_LENGTH; i++){

    x += h;

    temp = Math.exp(-x * x / 2) * C;

    23

  • 8/8/2019 Final Report Krishna Minor

    24/29

    x += h;

    / * Calculate normal probability density function * /

    fTable[i] = Math.exp (-x * x / 2) * C;

    / * Simpson numerical integration formula normal function * /

    FTable[i] = FTable[i - 1] + (fTable[i - 1] + 4 * temp + fTable[i]) * h / 3;

    }

    }

    public double generateRand(){

    double dRand = 0.0;

    double h = 6.0 / GAUSS_TABLE_LENGTH;

    Random rand = new Random();

    double temp = rand.nextDouble();

    for(int i = 0; i < GAUSS_TABLE_LENGTH; i++){

    if(temp

  • 8/8/2019 Final Report Krishna Minor

    25/29

    Unit.java

    package segmentation;

    /**

    * Unit is a class of the informations of chromosome and gray level about the site of the

    image

    */

    public class Unit {

    //region label

    private int nLabel;//gray level

    private int nGray;

    //chromosome sequence

    private int[] chromosome;

    //whether the unit is a EdgeUnit

    private boolean bIsEdge;

    //the variance of the local gray level distribution around local site

    private double dCita;

    /**

    * constructor

    * @param gray:gray level of local site

    */

    public Unit(int gray)

    {

    this.nGray = gray;

    this.nLabel = 0;

    int k = ImageSegmentation.WINDOW_K;

    chromosome = new int[k * k];

    this.bIsEdge = true;

    this.dCita = 0;

    }

    25

  • 8/8/2019 Final Report Krishna Minor

    26/29

    /**

    * constructor

    * @param gray:gray level of the local site

    * @param label:segmentation label of the local site

    */

    public Unit(int gray, int label)

    {

    this.nGray = gray;

    this.nLabel = label;

    int k = ImageSegmentation.WINDOW_K;

    chromosome = new int[k * k];

    this.bIsEdge = true;

    this.dCita = 0;

    }

    /**

    * get the gray level of the local site

    * @return: gray level of the local site

    */

    public int getGray(){

    return nGray;

    }

    /**

    * set the gray level of the local site

    * @param gray: gray level of the local site

    */

    public void setGray(int gray){

    this.nGray = gray;

    }

    /**

    * get the segmentation label of the local site

    * @return : the segmentation label of the local site

    */

    public int getLabel(){

    26

  • 8/8/2019 Final Report Krishna Minor

    27/29

    return nLabel;

    }

    /**

    * set the segmentation label of the local site

    * @param label : the segmentation label of the local site

    */

    public void setLabel(int label){

    this.nLabel = label;

    }

    /**

    * get the chromosome sequence of the local site

    * @return : the chromosome sequence of the local site

    */

    public int[] getChromo(){

    return this.chromosome;

    }

    /**

    * get the edge information of the local site

    * @return : if the local site is a EdgeUnit, return true, else, return false

    */

    public boolean getEdge(){

    return bIsEdge;

    }

    /**

    * set the edge information of the local site

    * @param edge : whether the local site is a EdgeUnit

    */

    public void setEdge(boolean edge){

    this.bIsEdge = edge;

    }

    /**

    * get the variance of the gray level distribution around local site

    27

  • 8/8/2019 Final Report Krishna Minor

    28/29

    * @return : the variance

    */

    public double getCita(){

    return this.dCita;

    }

    /**

    * set the variance of the gray level distribution around local site

    * @param c : the variance

    */

    public void setCita(double c){

    this.dCita = c;

    }

    }

    28

  • 8/8/2019 Final Report Krishna Minor

    29/29

    6. References:

    Selectionist relaxation: genetic algorithms applied to image segmentation

    Philippe Andrey* AnimatLab, De partement de Biologie, Ecole Normale Supe rieure, 46

    rue dUlm, 75230 Paris Cedex 05, France