Question

4.1 Tas 1 feature : Process a low resolution sensor image with an idealised You are given an idealised test image with a sing

can you just help with the first 3 parts?
0 0
Add a comment Improve this question Transcribed image text
Answer #1

code

solution

matlab code read the image readimg imread (circle.png) readimgrgb2gray (readig [m1, n1] -size (reading ) ; &show image imshpicture start-pointx 0; start pointy0 0; = stop-x % part a and b The radius of the circle and center of the circle for i=1:ml

//output

>>circle Center of circle: (174.00,189. 50) Radius of circle:85. 50 pixels Area of circle:24526.00 pixels

//copyable code

%matlab code

%read the image

readimg= imread('circle.png');

readimg = rgb2gray(readimg );

[m1,n1] = size(readimg );

%show image

imshow(readimg );

%check the data

image_b = zeros(m1,n1);

for i = 1:m1

for j = 1:n1

if readimg(i,j) > 100

image_b(i,j) = 255;

else

image_b(i,j) = 0;

end

end

end

imshow(image_b);

% part c The area of the circle

values = 0;

for i=1:m1

for j=1:n1

if image_b(i,j) == 255

values = values + 1;

end

end

end

picture = 0;

start_pointx = 0;

start_pointy = 0;

stop_x = 0;

stop_y = 0;

% part a and b The radius of the circle and center of the circle.

for i=1:m1

for j=2:n1-1

if image_b(i,j) == 255 && image_b(i,j-1) == 0

start_pointx = i;

start_pointy = j;

end

if image_b(i,j) == 255 && image_b(i,j+1) == 0

stop_x = i;

stop_y = j;

end

end

x = stop_y - start_pointy;

if x > picture

picture = x;

center_x = start_pointx;

center_y = (stop_y + start_pointy)/2;

end

end

radius = picture/2;

% Display Data

fprintf('Center of Circle: (%.2f,%.2f)\n', center_x, center_y);

fprintf('Radius of Circle: %.2f pixels\n', radius);

fprintf('Area of Circle: %.2f pixels\n', values);

Add a comment
Know the answer?
Add Answer to:
can you just help with the first 3 parts? 4.1 Tas 1 feature : Process a low resolution sensor image with an ideali...
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
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