简体   繁体   中英

Computer Vision: Generating 3D model of droplet on a surface

Consider a drop of liquid on a plane horizontal surface. I need to generate a 3D model of the droplet by taking images from various angles.

Assumptions:

  1. The droplet is symmetric about the vertical axis.

  2. The surface is ideally plane and smooth.

Queries:

  1. How many such images do I need to be able to process the 3D model?

  2. Which orientations of the camera do I choose?

  3. How can I implement this?

Edit: This is an image taken using the DropSnake plugin which is used to measure the contact angle of droplets. However, I have been told that it takes a lot of time and effort in calibration otherwise errors can creep in. Most time is taken in achieving the perfect alignment and errors are due to interference of shadows and bending of light by droplet.

在此处输入图片说明

My approach: We can position multiple cameras to take many photos of droplet from every angle without the need to calibrate. Then extract the information about the contact angle, by creating a 3D model if need be.

The precision provided by DropSnake is 0.001 degrees, so even 0.01 is okay.

I am afraid that there are no features to lock onto near the edges of the droplet so stereoscopy is out of question. That means you have to use only single image with camera facing perpendicularly the droplet like this:

2D-> 3D

You should also put some markers on the floor or put the camera into known distance from the droplet to ease up this. So now what to do:

  1. extract the droplet 2D edge pixels

    exactly as in your image the red or blue points. So just extract all edge points and ideally sort them by angle so they form a polyline contour... If the camera view is perpendicular to our droplet then the contour will be parallel to camera focal plane so all its points are at the same perpendicular distance... That is crucial for conversion to 3D from single image only...

  2. convert contour to 3D relative to camera

    that is simple math so if you look at the image above on the left is the topside overview and on the right is captured image. Let us consider that 2D magenta point (x,y) from the captured image. Let assume 3D coordinate system where point (0,0,0) is the middle of focal plane (center of image) Z is the distance from focal point and x,y directions matches the image.

    So the 2D (x,y) we can convert to 3D by using triangle similarity:

     (x - xs/2) / focal_length = X/distance (y - ys/2) / focal_length = Y/distance 

    so the 3D position will be:

     X = (x - xs/2) * distance / focal_length Y = (y - ys/2) * distance / focal_length Z = distance 
  3. create mesh

    As the droplet is symmetrical use just half of contour and simply rotate the 3D contour around droplet central axis and reorder the resulting points into some mesh topology forming the 3D droplet surface. Or just compute perpendicular distance of each contour point to the axis and use it as radius for parametric circle equation and compute the mesh as set of circles one for each y slice

Accuracy is determined by camera FOV, resolution and distance to droplet. So if it is not enough you can:

  • place the camera closer to droplet
  • use bigger resolution of camera (or interpolate it)
  • use sub-pixel precision while extracting the contour

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM