Day 8

Here is the input image i.e. Robotic Vision Worksheet. The motive is to identify the shapes and colors out of it.Robotic Vision Worksheet

In this post: http://wp.me/p3CX0w-aD  I created function getColor to take input the image above and the color and result we get is a binary image.

I started with MATLAB shape detection project problem. After getting the binary images from getColor function that I created (as in previous post) it’s now time to identify shapes (blobs) within the binary image (having two values 0 or 1, black or white). Here is the rough example:

function ans = getShape(im, shape)
  b=iblobs(im);
  [row, col] = size(b);
  
  for i = 1:col
    if(b(i).circularity >=0.90 & b(i).circularity <=1.1 & shape=='circle')
      ans = b(i);
    elseif(b(i).circularity >=0.60 & b(i).circularity <=0.62 & shape=='triangle')
      ans = b(i);
    else
      ans = b(i);
    end
  end
end

Here im is the binary image created from the getColor function and shape may be ‘circle’, ‘triangle’ or ‘square’ etc. Actually this function doesn’t solves the problem.

The iblobs function of the Machine Vision Toolbox was taking too much to respond. After computing, it results into some blobs with area = 1, that means there are some white points (dots) in the binary image.

And later evening, the function stopped working and gave some error, I don’t know the reason behind it.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s