Sitemap
Sebastian Smith

Sebastian Smith

DFO With Pixel Brightness

2 min readDec 22, 2017

After learning about the core concepts of DFO, we were tasked with using the algorithm to locate the brightest area of an image by building on an already implemented version of DFO in Java. I did this by filling in the empty brightness function located in the Utils file with the following code.

This would return a value ranging from 0 to 255 representing the brightness of a chosen pixel. The swarm of flies would then seem to locate this part of the image instantly as the program started running.

If the task was to locate two optima within an image then there must be two instances of DFO running separately on the same image with each swarm converging at different points. In order for the swarms not to converge at the same point, once one optima is found, a boundary must be set around that point so that the 2nd swarm converges on a different part of the image and does not use the first located optimum as part of its search space.

Get Sebastian Smith’s stories in your inbox

Join Medium for free to get updates from this writer.

For tracing a moving object, the optimum pixel would be updated with every frame but wouldn’t change drastically from it’s previous location, making it somewhat easy for the flies to converge towards the new marker. This will make it virtually impossible to return an absolute perfect fitness value unless the object being traced stayed still for a good amount of frames as the swarm of flies will always be converging on a point that the object will have moved away from by the time they get there. Since there is no way for DFO to look into the future, it will always be following closely behind the moving object, forming the same general path.

--

--