Question

Image processing Matlab problem. Could you please help me to write a Matlab code to read...

Image processing Matlab problem. Could you please help me to write a Matlab code to read images, equalize contrasts, covert images to grayscale and binary, then display on same windows. Then perform SOBEL and CANNY edge detection on images. Final make MATLAB to count the number of circles in images (circles and red circles)

And how can we distinguish circles by color? and how to count number of red, green and blue circles separately for example.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer:

Please find the below steps to get to solve your problem in MatLab

1. To read an image: Use imread() function to read images

Syntax:   A = imread(filename, fmt);

Here fmt is optional. Ex: im = imread("image1.jpg");

2. To convert image to grayscale: Use im2gray() function to convert input color image to gray

Syntax: A = rgb2gray(RGB)

Ex: im_gray = rgb2gray(im); % converting above read image im to im_gray

3. To equalize contrast of an image: Use histeq() function

Syntax: J = histeq(I);

Ex: im_cc = histeq(im_gray); % here cc means contrast corrected

4. To convert image to binary: Use im2bw() function

Syntax: BW = im2bw(I,level)

Ex: im_bw = im2bw(im_cc);

5. To display all images in diffrent windows: Use figure and imshow() function

Syntax: figure, imshow(I);

Ex:

figure, imshow(im);

figure, imshow(im_gray);

figure, imshow(im_cc);

figure, imshow(im_bw);

6. To do edge detection for both Sobel and Canny : Use edge() function

Syntax: BW1 = edge(I,'Canny');

BW2 = edge(I,'Sobel');

Ex:

BW1 = edge(im, 'Canny');

BW2 = edge(im, 'Sobel');

7. To do circles detection: Use imfindcircles()

Syntax: [centers,radii,metric] = imfindcircles(A,radiusRange)

Ex: [centers, radii, metric] = imfindcircles(im, [15 30]);

Add a comment
Know the answer?
Add Answer to:
Image processing Matlab problem. Could you please help me to write a Matlab code to read...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Hello, I need help with the following question in MATLAB for digital image processing, thank you ...

    Hello, I need help with the following question in MATLAB for digital image processing, thank you for your help in advance Convolution operations using mask are commonly applied in image enhancement. Even edge detection is based on convolution with a specially designed mask. The assignment here is to write your own function for convolution and test it in edge detection. 1. Write a function in Matlab as follows: function Img2 Convolution(Img, mask); %Input: Img is the original image data matrix,...

  • use MATLAB to upload the following: an image that you want to process (can be taken...

    use MATLAB to upload the following: an image that you want to process (can be taken yourself or downloaded from the internet) a script that processes the image in TWO ways. manipulates the colors averages pixels together Please make sure the script displays the images (like how I did with the 40 and 80 pixel averaging) so I can easily compare them to the original. Make sure to COMMENT your code as well. Homework 13 Please upload the following: an...

  • The ACME Manufacturing Company has hired you to help automate their production assembly line. Cameras have...

    The ACME Manufacturing Company has hired you to help automate their production assembly line. Cameras have been placed above a conveyer belt to enables parts on the belt to be photographed and analyzed. You are to augment the system that has been put in place by writing C code to detect the number of parts on the belt, and the positions of each object. The process by which you will do this is called Connected Component Labeling (CCL). These positions...

  • WRITE A C++ PROGRAM TO ANSWER THE QUESTIONS BELOW. You are provided with an image in...

    WRITE A C++ PROGRAM TO ANSWER THE QUESTIONS BELOW. You are provided with an image in a new file format called JBC Here is an example of the format: 2 3 100 50 40 200 66 56 12 45 65 23 67 210 0 255 100 45 32 123 The first line means that this is a 2 (width) by 3 (height) image of pixels. Then, each line represents the color of a pixel. The numbers are from 0 to...

  • Instructions: Below are both crater images (some of the work is already done for you on...

    Instructions: Below are both crater images (some of the work is already done for you on the Southern image). At the bottom left you will see scale bars and a set of circles to help you do the actual counting. We have already identified craters that are 8 km across with red dots, so you only need to worry about craters greater than the outlined ones. Do not recount those craters that have already been marked with red dots. To...

  • could you please help me with this problem, also I need a little text so I...

    could you please help me with this problem, also I need a little text so I can understand how you solved the problem? import java.io.File; import java.util.Scanner; /** * This program lists the files in a directory specified by * the user. The user is asked to type in a directory name. * If the name entered by the user is not a directory, a * message is printed and the program ends. */ public class DirectoryList { public static...

  • Mountain Paths (Part 1) Objectives 2d arrays Store Use Nested Loops Parallel data structures (i.e...

    Mountain Paths (Part 1) in C++ Objectives 2d arrays Store Use Nested Loops Parallel data structures (i.e. parallel arrays … called multiple arrays in the zyBook) Transform data Read from files Write to files structs Code Requirements Start with this code: mtnpathstart.zip Do not modify the function signatures provided. Do not #include or #include Program Flow Read the data into a 2D array Find min and max elevation to correspond to darkest and brightest color, respectively Compute the shade of...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT