Code covered by the BSD License  

Highlights from
Massive Uniform Manipulation: Control Large Populations of Simple Robots with a Common Input Signal

image thumbnail
from Massive Uniform Manipulation: Control Large Populations of Simple Robots with a Common Input Signal by Aaron Becker
rearranges n robots controlled to move in unison {up, down, left, right} using 1 obstacle

BinaryImage(image,c)
function [BW , px] = BinaryImage(image,c)
%clear all
format compact
clc
imgname = image;

if c==0 
   [BW,map] = imread(imgname);
else
    
[rgb,map] = imread(imgname);
size(rgb)

gray = rgb2gray(rgb);


thresh = 100;
BW= gray>thresh;


BW = imresize(BW, 0.8)
end
pxx = (sum(BW));
px = sum(pxx);





Contact us