Hello, How can i find repeating structures from the image.I actually want to generate a code that can determine the repeating and non repeating structures from an image and put them in separate groups.I need urgent help.Here is my image

Answers (2)

I know there is 3 types of structures.But i actually want a code that can automatically determine repeating objects from an image .I would be grateful if anyone can help me or give me any idea to generate the code .
You're going to have to specify what you're looking for. Sure, some things might be repeated, like squiggly lines and ovals, but on the other hand nothing is repeated because none of those lines or ovals are identical.

7 Comments

I actually want to find how many things look like similar.Here is my new image where some lines and oval shapes are identical i want find this repeated lines and oval shapes.I have no idea how to do this.I would be grateful if you can give me any idea to generate the code.
I tried to use that code
[ I, map] = imread('repeated.jpg');
I = ~I;
[m n]=size(I)
P = [];
for i=1:m
for j=1:n
if I(i,j)==1
P = [P ; i j];
end
end
end
size(P)
MON=P;
%[IDX,ctrs] = kmeans(MON,3);
[idx,C] = kmeans(MON,3,'Distance','cityblock','Replicates',5);
figure;
plot(MON(idx==1,1),MON(idx==1,2),'r.','MarkerSize',12)
figure
plot(MON(idx==2,1),MON(idx==2,2),'b.','MarkerSize',12)
figure
plot(MON(idx==3,1),MON(idx==3,2),'b.','MarkerSize',12)
hold on
plot(C(:,1),C(:,2),'kx','MarkerSize',15,'LineWidth',3)
legend('Cluster 1','Cluster 2','Centroids','Location','NW')
title 'Cluster Assignments and Centroids'
hold off
but it is showing error
Error using kmeans (line 262)
X must have more rows than the number of clusters.
Error in kcltest (line 17)
[idx,C] = kmeans(MON,3,'Distance','cityblock','Replicates',5);
Here's something you can do. Attach repeated.jpg. It's not the RGB image you have posted.
And doing a kmeans clustering will not let you find similar patterns. You need to look up pattern recognition papers - that's a subspecialty of image processing. Look at this link in VisionBib
If you want to look for identical sections, do not use JPEG images. JPEG blurs sharp lines.

Sign in to comment.

Asked:

on 19 Jan 2016

Commented:

on 21 Jan 2016

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!