Answered step by step
Verified Expert Solution
Link Copied!

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 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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Expert Oracle Database Architecture

Authors: Thomas Kyte, Darl Kuhn

3rd Edition

1430262990, 9781430262992

More Books

Students also viewed these Databases questions