Message Boards Message Boards

Use Predict command for counting dots in images?

I deeply appreciate your time.

enter image description here

Attachments:
POSTED BY: M.A. Ghorbani
2 Replies
Posted 5 years ago

If you assign the argument to Predict to data then

data // Map[Head]
(* {RightArrow, RightArrow, RightArrow, RightArrow, RightArrow, 
RightArrow, RightArrow, RightArrow, RightArrow, RightArrow, 
RightArrow, RightArrow, RightArrow, RightArrow, RightArrow, 
RightArrow, RightArrow, RightArrow, RightArrow, RightArrow} *)

Not sure how that argument list was generated, but it needs to be a list of Rule.

data = Rule @@@ data;
p = Predict[data]

test = {your list of test images}
p[test]
(* {5., 27., 73.}*)

You could try a different Method and/or have more examples to train on to improve accuracy.

If the dots in your image are so well defined then this is probably a better way to count them

test // Map[MorphologicalComponents /* Max]
{8, 25, 71}
POSTED BY: Rohit Namjoshi

Rohit, thank you so much :)

POSTED BY: M.A. Ghorbani
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract