Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
function

Subject: function

From: M.Peer

Date: 7 Jul, 2011 10:53:10

Message: 1 of 5

sir,
I had a problem to write this function in matlab.(i.e) i don't know how to write this function in matlab.

http://www.flickr.com/photos/64979555@N08/5911982116/in/photostream

Please help me for writing this function which is a genetic algorithm fitness function.

Subject: function

From: Roger Stafford

Date: 7 Jul, 2011 19:49:10

Message: 2 of 5

"M.Peer" wrote in message <iv436m$li1$1@newscl01ah.mathworks.com>...
> sir,
> I had a problem to write this function in matlab.(i.e) i don't know how to write this function in matlab.
>
> http://www.flickr.com/photos/64979555@N08/5911982116/in/photostream
>
> Please help me for writing this function which is a genetic algorithm fitness function.
- - - - - - - - - -
  If you seriously expect to get answers to your question, you should give a lot more information about it than to simply refer to an image of an equation. What sort of thing is W? Are x and y integer indices or a pair of real (or complex) arguments to a function? What is B? If there are arrays involved, what are their sizes? What is n - is it an integer? Etc., etc., etc., ...

Roger Stafford

Subject: function

From: Peer Mohamed

Date: 8 Jul, 2011 06:00:24

Message: 3 of 5

Sir,
Bmax is the maximum brightness of the image, xSize and ySize are the number of pixels in the horizontal and vertical directions of the image, W is the window, f and f n ,t are the intensity values of the original image and the template image when it is justified for the n-th position of the chromosome, respectively. these are the variables which is used for this fitness function in genetic algorithm face detection.

Subject: function

From: Roger Stafford

Date: 8 Jul, 2011 07:41:10

Message: 4 of 5

"Peer Mohamed" wrote in message <iv66do$r34$1@newscl01ah.mathworks.com>...
> Sir,
> Bmax is the maximum brightness of the image, xSize and ySize are the number of pixels in the horizontal and vertical directions of the image, W is the window, f and f n ,t are the intensity values of the original image and the template image when it is justified for the n-th position of the chromosome, respectively. these are the variables which is used for this fitness function in genetic algorithm face detection.
- - - - - - - - - - - -
  It still isn't clear whether you want a scalar answer for a single value of n or a vector answer for many values of n. As I read your downloaded formula, the scalar answer for a single n is:

 Fn = 1 - sum(abs(f(:)-fnt(:)))/max(f(:))/prod(size(f));

assuming Bmax refers to the maximum intensity of the original image.

Roger Stafford

Subject: function

From: Peer Mohamed

Date: 8 Jul, 2011 09:03:09

Message: 5 of 5

"Roger Stafford" wrote in message <iv6cal$cmt$1@newscl01ah.mathworks.com>...
> "Peer Mohamed" wrote in message <iv66do$r34$1@newscl01ah.mathworks.com>...
> > Sir,
> > Bmax is the maximum brightness of the image, xSize and ySize are the number of pixels in the horizontal and vertical directions of the image, W is the window, f and f n ,t are the intensity values of the original image and the template image when it is justified for the n-th position of the chromosome, respectively. these are the variables which is used for this fitness function in genetic algorithm face detection.
> - - - - - - - - - - - -
> It still isn't clear whether you want a scalar answer for a single value of n or a vector answer for many values of n. As I read your downloaded formula, the scalar answer for a single n is:
>
> Fn = 1 - sum(abs(f(:)-fnt(:)))/max(f(:))/prod(size(f));
>
> assuming Bmax refers to the maximum intensity of the original image.
>
> Roger Stafford
--------------------------------------------------------------------------
 Thank you very much this function is enough. I want to calculate for single value of n only.

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us