Thang Nguyen Posted June 1, 2015 Report Share Posted June 1, 2015 (edited) Hi, I have data from laser scan of a circular surface. I converted data to image and using circular edge detection to mask out the background. What I like to do next is to fit the surface then subtract my original data from it. I am not sure if there is any function I can use to fit specifically in the boundary of the object only. Please let me know what function that I should use. Thanks you. Edited June 1, 2015 by Thang Nguyen Quote Link to comment
infinitenothing Posted June 1, 2015 Report Share Posted June 1, 2015 Something like this?: http://zone.ni.com/reference/en-XX/help/370281P-01/imaqvision/imaq_fit_circle_2/ Quote Link to comment
Thang Nguyen Posted June 1, 2015 Author Report Share Posted June 1, 2015 I am sorry, I was not clear but I mean a 3D scan of circular surface, not a circular fit. Quote Link to comment
infinitenothing Posted June 1, 2015 Report Share Posted June 1, 2015 (edited) You might have to show us some pictures. It sounded like you had some edge detection which should give you points that make a circle on the edge of the cylinder. You can use a circle fit to get the radius which will give you an area. If you need, you can take an average inside the circle to get the height of the cylinder. Edited June 1, 2015 by infinitenothing Quote Link to comment
Thang Nguyen Posted June 1, 2015 Author Report Share Posted June 1, 2015 @infinitenothing: Thanks for your reply. One of the issue is the surface can be tilt, so I cannot use the average value. I also have the case the cylinder diameter is greater than the range of the laser scan which I need to do 2 scan. In this case, I have to fit two half circle before I can stitch them together. To generalize my question, I am looking for a method to fit a 3D surface with some certain shape. Quote Link to comment
infinitenothing Posted June 1, 2015 Report Share Posted June 1, 2015 A tilted circle projects to an ellipse right? http://zone.ni.com/reference/en-XX/help/370281M-01/imaqvision/imaq_fit_ellipse_2/ Not sure about the general solution but maybe something involving this solver http://zone.ni.com/reference/en-XX/help/371361J-01/gmath/find_all_minima_nd/ Quote Link to comment
Thang Nguyen Posted June 2, 2015 Author Report Share Posted June 2, 2015 @ininitenothing: I would like to fit the plane not the boundary. Thanks. Quote Link to comment
infinitenothing Posted June 2, 2015 Report Share Posted June 2, 2015 (edited) That makes sense. Let me throw out an idea: So you're trying to find the coefficients in this formula: Z=a1x+a2y+C. You might be able to use this: http://zone.ni.com/reference/en-XX/help/371361H-01/gmath/general_ls_linear_fit/ Where Y is an array of all the pixel intensities and H is {x1,y1,c}, ... You might want to use real world coordinates instead of pixel coordinates. Edited June 2, 2015 by infinitenothing Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.