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 image1.jpg.
1. Use imread to read the image from file 'image1.jpg' into matrix I.
2. Convert the 3-channel image to grayscale using the mean function.
3. 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.
4. 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 20 pixels. If done correctly, the number of remaining lengths should match the number of sticks in the image.
5. Display the object lengths in a histogram with 5 bins. [Use the Matlab histogram function]
6. 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 blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!