Straight Line Detection Based on GA with New Modification on Baron ' s Method

In view of development on feature extraction in digital image based on feature straight line, GA has been used in this paper after hybrid it with Baron's Method to detect straight line, some developments are performed on the Baron's Method and we called it Genetic Developed Baron's Method (GDBM). The proposed method has been applied in many of sample. The experiments show that the proposed hybrid method in this paper is achieves high performance and it produce 90% detection rate.


Introduction:
The edge and line detection operators presented here present the various types of operators in use today.Many methods are implemented with convolution masks, and most are based on discrete approximations to differential operators.The object features of interest include the geometric properties, histogram features, and color features, after extracting the features of interest, could analyze the image.Features extraction is part of the data reduction process and is followed by feature analysis.One of the important aspects of feature analysis is to determine exactly which features are important [2,7].
A.L Kesidis, N.papamarkos have proposed a new window based method for the inversion of the HT (Hough Transform)space.The proposed technique divides the original image to a rectangle window and then applies the IHT algorithm to each of them [1].
A parallel algorithm for HT on linear array with a reconfigurable Pipeline bus system is represented by an approach proposed from Link Chen and Hongjian Chen supposed the number of Q-values to be considered in m for an image with (n × n) Pixels [5]."The Optimization of Edge and Line detections for forest image analysis", was suggested by Zhiling Long and Joseph Picone who designed an objective metric to evaluate the performance of edge and line detectors and then optimized the performance of their image analysis system using this metric.Their best system resulted in an error rate of 29%, and hand an acceptable insertion rate [8].

Artificial Intelligence (AI):
Artificial Intelligence (AI) is exciting new effort to make computers think.Machines with minds, in the full and literal sense.The fact that many artificial intelligence methods are derived from processes within nature or within human thinking makes them, in some way, familiar to persons applying them on their tasks.Artificial intelligence techniques that deal with the unknown or unpredictable consist of neural network, expert system and genetic algorithms [6].
Genetic algorithms try to make our understanding of evolutionary processes available to computational problems.They enable a system to be-self-optimizing.Genetic algorithms are general-purpose search algorithms based upon the principles of evolution observed in nature.Genetic algorithms combine selection, crossover, and mutation operators with the goal of finding the best solution to a problem.Genetic algorithms search for this optimal solution until a specified termination criterion is met.The solution to a problem is called a chromosome.A chromosome is made up of a collection of genes which are simply the parameters to be optimized.A genetic algorithm creates an initial population (a collection of chromosomes), evaluates this population, and then evolves the population through multiple generations in the search for a good solution for the problem at hand [4].

Baron's Method[3]:
Baron Lic suggested a new method for detecting straight line in image depending on Hough transform.This method supposed that there are straight lines for all (P, θ ) values on screen, and calculated the range of the corresponding actual existing line with suppose line if the rate of corresponding is high.This refers to finding line in current (P,θ ), and the following detail explain of this method [3]:-Let us define the distance di in image space, which is Euclidean, as the minimum distance between point P i and the line represented by the parameters P and θ, as follows: ) Where P i is the position vector of point P i and P o is the position vector of the closest point of the line to point P i , this point is readily obtained as follows [3]: The extraction can be formulated as the following optimization problem [3] : Where n is the number of points in the set and di is given by equations ( 2),(3).This equation makes it possible to find a line, which has the maximum likelihood in the set of points while searching in the parameter space.This equation has many local optima and is equivalent to Hough transform [3].This method was represented by algorithm as follows:-1-The value of P and θ would be specified as : 0 lx, ly : represent matrix dimensions 2-Calculate the function : Where n : represents number of white Pixels.P : represents the P., θ : represents the θ .d i : Eclides distance .

2-1 Find p o value whenever :
If , d i =P i -P o Where : P i : is the position vector of actual line.
P o : is the position vector of fanciful line.

Baron's Method (BM) :
Baron's Method is one of the newest straight line detection method, this method depend on (HTM) concepts, but it applies straight-line equation in polar (HT).It supposes that there is a straight line in each place in search space.The corresponding between image's Pixels and fanciful line's Pixel (in polar HT space) has been calculated.If the corresponding is high that indicated to find straight line in location(P,θ )and the converting to Cartesian and found (x,y) that equivalents (P,θ ) in polar HT.
This method has a good property, represented by accuracy of the straight lines number and the accuracy to find locations of the line.At the same time it is suffering from a number of weak points.We can specify it as following points : 1.The method hasn't any ability to detect vertical straight line in search space.2. The line has been detected in this method consists of a number of Pixels which are more than available number of Pixels that make actual line.

Developed Baron Method (DBM):
Some developments and modifications have been performed to the previous method to process a weak points and obtained better results and more accuracy; it is called Developed Baron method(DBM) [3], which consists of the following steps:-1-The value of P and θ would be specified as : θ : represents the θ ., d i : Eclides distance .

2-1 Find p o value wherever :
2 , d i =P i -P o where : P i : is the position vector of actual line.
P o : is the position vector of fanciful line.

2-3 check if di =0 or acc ≤ 1/(1+ di ) ≤ 1 (acc is accuracy rate)
then newsum= oldsum + 1/(1+ di ) 2-4 Repeat steps (from step 2-1) for all θ values and find maximum value of function.The step (2-3) gives the ability of obtaining a better corresponding rate (between actual line and fanciful line) by checking (d i ) value, when d i =0, this means prefect corresponding has been done for Pixel otherwise ,when d i ≠0 the corresponding has been checked if it is around the specific user value this means corresponding has been done, otherwise Pixel will be ignored .

Genetic Developed Baron Method (GDBM ):
We can observe by executing the two traditional methods that the ratio of their accuracy is not satisfactory enough.The first method detects the straight line, but it does not provide accuracy as regard to the number of the actual straight lines because it gives fanciful lines near to the actual line.Accordingly we have significantly more straight lines than the actual number.
The second method offers a relatively accurate numbers of lines after having a suitable decision on the ratio of the symmetric Pixels and this depends on the trial and error procedure being used.Notice that the execution of this method takes time.In order to get more efficient execution the GA has been used since the genetic algorithm is considered as one of the means for achieving optimal output for finding out the optimal solution or the nearest to the optimal as well as the ability to deal with research of huge and complicated area.According to what have been mentioned above we arrived at a solution where we can hybridize the DBM with GA and because this method offers relatively good and accurate results as well as the objective function enables us to use it in the genetic algorithm.The following are the steps that specify the genetic algorithm elements used with the GDBM method.

a-Creating Initial Population:
The population consists of a number of individuals detected by the algorithm designer and according to the nature of the problem.In this work population has been detected by 50 chromosomes.These chromosome consists of a number of values (genes) whose lengths are detected according to the problem.The chromosome, in this work, has been represented by the following Figure:

Figure(2):Chromosome Configuration
The figure of chromosome in this work consists of two genes(P gene,θ gene), where the range of P gene is between (0-142) and the range of θ gene is between (0- 180) degree .

b-Encoding:
The chromosome which was explained in the previous step represented by a binary encode.Each gene is represent by 9 bit to accommodate a maximum value for P and θ (the maximum value of 180 = θ and the maximum value of P =142).

c-Evaluation of The Chromosome:
In the genetic algorithm the chromosome is evaluated by the fitness value in order to check the kind of the solution, therefore, each chromosome (which is born in an initial population or through the antecedent generations) has a fitness value related to the objective function .In this work, individual is evaluated by the number of the Pixels.Individual with high Pixels will get high corresponding, whenever the number of Pixels increase we will gets the best result ,which means that objective function is maximum function and thus the fitness is equal to the objective function as follows:- Fitness degree depending on threshold is specified by a user.This value is different from an image to another.The principle of trial and error is being used to detect this value until we arrive at the best decisions.

d-Selection:
The Elitism method [6]has been used to select a number of the current population individuals to represent the parents of antecedent generation.The selection from the individuals to represents the parents depend on the value of the fitness function for every individual.In this work a number of good chromosome has been copied to antecedent generation, the number has been specified by five chromosomes (best chromosome has been copied to antecedent).The rest of the parent are selected by the Roulette Wheel Selection method.

e-Crossover:
Crossover between parent has been done to produce a new generation that represents the beginning of antecedent genetic cycle.Two-point crossover has been used to Chromosome : P θ suitable chromosomes length, the two point position are located randomly and the crossover ratio was decided to be (0.9).

f-Mutation:
Mutation has been applied to get a chromosome that possesses new characteristics which have not been formed before from the previous generation, in order to extend the possible solution area.The flip bit mutation method has been used, the mutation ratio was decided to be (0.3)after trying different values.

g-Stop Criterion:
The stop criterion in the GA decides whether the algorithm continues researching or stop.The stop criterion is depend on two approaches: generations number and fitness threshold.Each fitness value for chromosome is compared with a fitness threshold and according to the result of comparison the number of the straight lines in the image is specified, when specific number of straight lines are detected, stop the calculations..

Algorithm Evaluation:
To evaluate the proposed algorithm, we calculate the average precision using the following equations: precision average number of slices contain lines.
...( 6) The equation ( 7) calculate slice's accuracy that contain straight lines, the term ( slice i _lines) represents the actual number of straight line existence in straight lines in slice i ,and n represents a number of slices that contain straight lines.The equation ( 6) calculates slice's accuracy average of image by divided the summation of accuracy rate for all slices on slices number.

Discussion of results:
The line detection based on (DBM and GDBM) are carried out for the same sample (the obtained after segmentation step).A threshold of (50 Pixels) for the Pixels number are used to indicate a straight line.Table (1) shows the obtained results for slices 6,7,8,and 9.
It is clear from Table (1) that the two methods are association by detected lines in the same slices.The table also shows that the number of straight lines that are detected using (DBM,GDBM) methods are closed to actual lines number.The comparison between DBM, GDBM and actual lines number is shown in Figure (3) graphs a,b,c respectively, we notice that the results of graphs (b and c) are closed to each other, graph b is a little bit closed to graph c, from the direction of actual number f lines and estimated by the algorithms and it could be considered the optimal result.Actual Line No. 5 The Figure(4) represents the average precision for each method by applying the equations mentioned in section (4-5), the GDBM give perfect detection (precision=1).So the proposed hybrid method (GDBM) is considered the best method for the line detection.
: represents number of white Pixels., p : represents the P.

3 -
Repeat steps (from step 2-1) for all P values.The additional steps that develop the Baron Method are : 1-The step (2-1-2) gives the ability of detecting vertical straight line, by checking θ value (θ = π /2) and find values of x o , y o (location of vertical line ) 2-