UniqueTol Exclusion of Similar Points
I am trying to remove detected circles that are too close to one another. My original plan involved indexing through all of the centers (X Y stored in separate columns), determining the distances, and then using those to remove points within a tolerance.
for nn=1:height(location_table)
distances=sqrt(((location_table(nn,1) – location_table(:,1)).^2)+((location_table(nn,2) – location_table(:,2)).^2))
too_close=(0<distances & distances<tolerance);
location_table(too_close,:)=[]
end
I was never able to get the removal to work. It would end up breaking if spots were removed because the index nn would eventually get larger than the current table height.
I discovered the uniquetol command when searching for answers. However, in my use of it, it filters out spots that are not unique (ie, within the tolerance). However, I would want it to remove spots that all spots that are too similar (rather than leaving a representative one behind).
location_table=uniquetol(location_table, closeness_tolerance, ‘ByRows’, true, ‘OutputAllIndices’, true, ‘DataScale’,1);
I plan to do radial intensity line scans starting at the center of all circles (and proceeding past their perimeter by a variable) that make it through this filtering process. If spots are too close, then the scan (improfile) will cross over the border of the intended scan as well as a spot that is too close to it (which will skew the data). For example, circle 4 should be excluded because it is too close to other circles and its scans could be skewed. Uniquetold allowed me to exclude the nearby circles but 4 would ideally not be included either.I am trying to remove detected circles that are too close to one another. My original plan involved indexing through all of the centers (X Y stored in separate columns), determining the distances, and then using those to remove points within a tolerance.
for nn=1:height(location_table)
distances=sqrt(((location_table(nn,1) – location_table(:,1)).^2)+((location_table(nn,2) – location_table(:,2)).^2))
too_close=(0<distances & distances<tolerance);
location_table(too_close,:)=[]
end
I was never able to get the removal to work. It would end up breaking if spots were removed because the index nn would eventually get larger than the current table height.
I discovered the uniquetol command when searching for answers. However, in my use of it, it filters out spots that are not unique (ie, within the tolerance). However, I would want it to remove spots that all spots that are too similar (rather than leaving a representative one behind).
location_table=uniquetol(location_table, closeness_tolerance, ‘ByRows’, true, ‘OutputAllIndices’, true, ‘DataScale’,1);
I plan to do radial intensity line scans starting at the center of all circles (and proceeding past their perimeter by a variable) that make it through this filtering process. If spots are too close, then the scan (improfile) will cross over the border of the intended scan as well as a spot that is too close to it (which will skew the data). For example, circle 4 should be excluded because it is too close to other circles and its scans could be skewed. Uniquetold allowed me to exclude the nearby circles but 4 would ideally not be included either. I am trying to remove detected circles that are too close to one another. My original plan involved indexing through all of the centers (X Y stored in separate columns), determining the distances, and then using those to remove points within a tolerance.
for nn=1:height(location_table)
distances=sqrt(((location_table(nn,1) – location_table(:,1)).^2)+((location_table(nn,2) – location_table(:,2)).^2))
too_close=(0<distances & distances<tolerance);
location_table(too_close,:)=[]
end
I was never able to get the removal to work. It would end up breaking if spots were removed because the index nn would eventually get larger than the current table height.
I discovered the uniquetol command when searching for answers. However, in my use of it, it filters out spots that are not unique (ie, within the tolerance). However, I would want it to remove spots that all spots that are too similar (rather than leaving a representative one behind).
location_table=uniquetol(location_table, closeness_tolerance, ‘ByRows’, true, ‘OutputAllIndices’, true, ‘DataScale’,1);
I plan to do radial intensity line scans starting at the center of all circles (and proceeding past their perimeter by a variable) that make it through this filtering process. If spots are too close, then the scan (improfile) will cross over the border of the intended scan as well as a spot that is too close to it (which will skew the data). For example, circle 4 should be excluded because it is too close to other circles and its scans could be skewed. Uniquetold allowed me to exclude the nearby circles but 4 would ideally not be included either. uniquetol, image analysis, image processing MATLAB Answers — New Questions