detection and counting inside a ROI using simulink

4 views (last 30 days)
Hello, I am very new to Matlab and am trying to figure out how to detect a feature in a region of interest and count that feature. I have looked through the simulink examples and there are pieces of them that would work for this but I don't understand some of the detailed settings or the filtering that is needed to perform the task.
This is the workflow that I have come up with so far: 1) load video (its full color) 2) perform edge detection or some filtering to show the shapes in each frame 3) establish an ROI in the filtered image (can't figure this part out) 4) If zero intensity area is greater than say roughly 30 by 30 pixels then count (working on this part) 5) Display video, overlay ROI, overlay edge detection, overlay count.
I am not looking for someone to do this for me b/c it defeats the purpose but I welcome hints and some explanation of the logic process or clarity on the tools to be used.
Thanks so much.
  1 Comment
Kean
Kean on 20 Nov 2013
Update: I have been working in simulink today and have made a small bit of progress. Right now the model includes: open multimedia file -> edge detection using sobel with output as a binary and a threshold -> bottom-hat using strel rectangle -> output to an image. Attached is a frame from the video. I am trying to count the ties in the video.
My first question is: Is Sobel Edge detection the best method to isolate the ties? I have been playing around with the threshold but I don't quite understand the meaning of the threshold values.

Sign in to comment.

Answers (1)

Madhavan V K
Madhavan V K on 27 Nov 2013
Hi Kean,
I am sorry that I would not be able to help you with detecting the ties. But once you have the thresholded image containing just the ties, I could help you with the overlaying part. Here it is, I assume that you have the thresholded binary image (lets call it BW) containing the ties. You would have to take the perimeter of the objects (ties) present in BW.
perimeter_ties = bwperim(BW)
Once you have obtained the perimeter of the objects, you could overlay it to any image of your choice. You could use, imoverlay function written by Steven L. Eddins. Here is the link http://www.mathworks.fr/matlabcentral/fileexchange/10502-image-overlay Download the file.
This function makes the overlay extremely simple, all you would have to do is this,
overlayed_image = imoverlay(image_of_your_choice, perimeter_ties, [0 1 0]);
From your question, I understand that you wanted to establish ROI just for the purpose of overlaying. By using imoverlay, I reckon you would no more have the need to establish ROIs.
Hope this helps, Cheers, M.
  2 Comments
Kean
Kean on 28 Nov 2013
Madhavan...thanks for the response...I haven't had time to look at it yet but I will in the next couple of days...thanks so much for your response.
vcmorini
vcmorini on 22 Feb 2017
Kean have you reached an answer ? If yes, can you share? Thanks

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!