Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write an image processing script to find the average length of the sticks in image 1 . jpg . 1 . Use imread to read
Write an image processing script to find the average length of the sticks in imagejpg
Use imread to read the image from file 'imagejpg into matrix I.
Convert the channel image to grayscale using the mean function.
Create a binary mask of the objects in the image by finding an appropriate intensity threshold such that all the sticks are clearly visible as objects. The binary mask should contain ones where there are objects, and zeros everywhere else.
From the connected components, the area and length of the objects are extracted using the regionprops function this has been done for you Based on the results, remove the lengths of objects which areas are less than or equal to pixels. If done correctly, the number of remaining lengths should match the number of sticks in the image.
Display the object lengths in a histogram with bins. Use the Matlab histogram function
Find the mean of the lengths.
You need to use the variable names given in the skeleton code
Note: Do not include any clc or clear all commands in your MATLAB Grader code.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started