필터 지우기
필터 지우기

Detection / Identification of a curve in an image

조회 수: 35 (최근 30일)
Muskan Agrawal
Muskan Agrawal 2020년 5월 23일
답변: Muskan Agrawal 2020년 5월 26일
Well I need help in how to identify a curve in image.
Like we can use hough transform for lines and circles. Is there any function, which I can use for this purpose. I am attaching an image on which I have to work.
Please do help. The image has curves which I have to detect.

채택된 답변

Image Analyst
Image Analyst 2020년 5월 23일
Call bwlabel() to give each curve it's own unique ID number.
  댓글 수: 2
Muskan Agrawal
Muskan Agrawal 2020년 5월 26일
Thank you so much for your help. I continued with using bwselect. However, in it i had to manually pick up points of the curve that I want to be identified.
Could you please help me with any function which is used for identification of curves. Like houh transfor gives me an identified line or hough tranform for circles marks the circle in the given range.
It would be great if you could help with this.
Image Analyst
Image Analyst 2020년 5월 26일
You shouldn't have to do it manually with bwselect. bwlabel() does it for you. Look:
grayImage = imread('image.jpeg');
binaryImage = grayImage(:,:,1) > 200;
% Crop off huge white frame surrounding the image.
binaryImage = binaryImage(46:1058, 1094:1295);
subplot(1, 2, 1);
imshow(binaryImage);
fontSize = 15;
title('Binary Image', 'FontSize', fontSize);
% Label each blob with 8-connectivity, so we can make measurements of it
[labeledImage, numberOfBlobs] = bwlabel(binaryImage, 8);
% Apply a variety of pseudo-colors to the regions.
coloredLabelsImage = label2rgb (labeledImage, 'hsv', 'k', 'shuffle');
% Display the pseudo-colored image.
subplot(1, 2, 2);
imshow(coloredLabelsImage);
title('Labeled Image', 'FontSize', fontSize);
impixelinfo
% Get all the blob properties. Can only pass in originalImage in version R2008a and later.
blobMeasurements = regionprops(labeledImage, 'all');
numberOfBlobs = size(blobMeasurements, 1);
See, each individually colored connected region is one blob.
To get a histogram of orientations, do this:
allOrientations = [blobMeasurements.Orientation];
figure
numBins = 180;
histogram(allOrientations, numBins);
caption = sprintf('Histogram of %d Orientations', numberOfBlobs);
title(caption, 'FontSize', fontSize);
grid on;

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Muskan Agrawal
Muskan Agrawal 2020년 5월 26일
Oh I got it.
Thank you for your help.

카테고리

Help CenterFile Exchange에서 Image Filtering and Enhancement에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by