
You are now following this question
- You will see updates in your followed content feed.
- You may receive emails, depending on your communication preferences.
how to create a region of interest in simulink
-
-
Direct link to this question
https://in.mathworks.com/matlabcentral/answers/107556-how-to-create-a-region-of-interest-in-simulink
-
-
Direct link to this question
https://in.mathworks.com/matlabcentral/answers/107556-how-to-create-a-region-of-interest-in-simulink

Accepted Answer

13 Comments
- read image in, convert to grayscale double
- stdfilt to identify areas of low standard deviation within a 9x9 neighborhood (i.e. the compare to 5). This indicates tracks. All numbers were chosen by trial + error
- dilate horizontally (rectangle [1x50]) because tracks are horizontal
- erode vertically to remove noise between tracks
- Sum each row (recieve a column vector)
- if there are more than 100 true pixels in a row, it's a track (wooohoo!)
- Only look at the first row (selector)
- Identify when the first row goes from being a zero to a one (difference - compare to one).
- Use the StopCallback to sum up how many ones there are, i.e. the total number of tracks and put this in the workspace as NTies.
More Answers (2)
21 Comments
4 Comments
See Also
Categories
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!An Error Occurred
Unable to complete the action because of changes made to the page. Reload the page to see its updated state.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom(English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)