Question: 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
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
