How do I determine how do these black dots vary by location in an equal spaced magnetic field.

2 views (last 30 days)
I circled some of the black dots I want to count in the red circle. I want to segment each area equally across the image in the same crescent shape as I have drawn but equally spaced apart. But I only want to segment the areas that are filled with black dots and not segment the areas with the magnetic field (where the magnet is). This is because since the magnet expels all of the black dots away to other regions if I segment and count the space where the magnet is it wouldn't give an accurate account of the number of cells when I compare it to other cells where the magnet is a different location.
How can I detect where to start segmenting such that I only segment the areas with the black dots and around the areas without them?
I attempted to make a for loop code that starts segmenting by columns and substract by 1 before it starts counting but sometimes the magnetic field varies in location so I can't always do that, so is there a way to detect that this area shouldnt counted and count around this area then uniformly segment the remainder of the image like in the crescent shape i've drawn? I attached a picture of a pond that gives an idea of what I am attempting to try. the rock is the area I don't want to count, the cirlce around it would be the starting counting and the subsequent waves produced would be the other counts until the last column in the image. Please advise for an old R user who now loves MATLAB. Thanks.

Accepted Answer

Image Analyst
Image Analyst on 15 Feb 2023
Moved: Image Analyst on 16 Feb 2023
Do you have some equation for where the lines are? Like ar they perfect circles centered at the magnet or have some other formula? If you do then you can make a mask for each zone and compute the mean gray level in that zone. Can you attach the original, un-annotated image?
In the meantime, I'm attaching a few demos.
  14 Comments
Neo
Neo on 22 Feb 2023
@Image Analyst Check this out. But I still get an error and I have done everything suggested (or maybe I need to restart my computer not sure at this point). What do you think?

Sign in to comment.

More Answers (2)

Neo
Neo on 15 Feb 2023
Edited: Neo on 15 Feb 2023

Neo
Neo on 15 Feb 2023
Edited: Neo on 15 Feb 2023
This looks like something that I recently learned to do in Matlab with one of @Image Analyst analyst demo. Look at my question with his response (can’t remember which but it was recent) and you’ll see you could use that code and change the shape of the segments to get what you want.
  1 Comment
Neo
Neo on 15 Feb 2023
Edited: Neo on 15 Feb 2023
Try this:
startingColumns = round(linspace(1, columns+1, 10))
endingColumns = startingColumns(2:end) - 1
in your for loop. This would segment 9 columns equally across your image BUT IN STRIPS.
Something like this could give you the semi circle (half moon shape segmentation) that you want:
theta = linspace( pi/2, -pi/2, 100); So maybe you could add that into the starting columns. I am not sure how to detect the non black dot area though. I will have to think about that.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!