How to use hough transform to detect and identify a circle in an image.
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello everybody,
Actually I have got an 23 sec video which is captured by fish-eye camera and two color laser light as a source in a 3 inches PVC pipe. My goal is to do the distortion correction which happened in the pipe. The image I attached is one of the frame I got from my video.

I have checked on the Math Works file "Detect and Measure Circular Objects in an Image". Then I realized that these circles are all in good conditions. As well as the file "identifying round objects". Then I realized some of the objects in this file is not a circle. The goal is to identify. Then consider if I can use Hough transforms to detect the circles. Still in the process of reading papers that is related.
My first idea was :
1.Extract each frame from the video.
2. Find the center of each frame.
3. Determine the final center location of the circle(which shows up most)(Or maybe take the average value of the center pixel?)
4. Determine the final radius of the circle
5. Generate the final circle with the final center and the final radius.
6. Combine all the frames to one video which is the final result.
While I found it is hard to determine the final center and radius. I could not do distortion correction frame by frame. In that case, I could not guarantee each frames' circle center are all aligned.
In Matlab, use "imfindcircles" to find the circles, I have no clue on how to determine the value range on the bracket.The area after the "rgb" in the following code given:
[centers, radii] = imfindcircles(rgb,[15 20],'ObjectPolarity','dark','Sensitivity',0.9);
I started over the processing. Then here is the code I have already got. I use rgb2gray, edge detection and imdilate for better result.
clc
clear all
%SE = strel('arbitrary',ones(2,2));
I1 = imread('Picture1.png');
figure(1);imshow(I1);
%I2 = imdilate(I1,SE,'same');
%f123=imdilate(f12,SE,'same');
%imshow(f123)
fb = rgb2gray(I1)
c = edge(fb,'canny')
figure(2);imshow(c);
%circle =
d = bwmorph(c,'dilate',1);
figure(3);imshow(d)
Result image:



Thank you in advance if anybody could give me some of the suggestions.
0 Kommentare
Antworten (0)
Siehe auch
Kategorien
Mehr zu Computer Vision with Simulink finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!