Agisoft Metashape

Agisoft Metashape => General => Topic started by: Brit on September 14, 2014, 10:53:32 PM

Title: Bumpy suface
Post by: Brit on September 14, 2014, 10:53:32 PM
The higher the cloud density, the more bumpy the surface. Does anyone know why. Also, how would I improve the quality? I have uploaded 4 images. One is an image of the original sculpture (with white where the mask is). The second (that looks like porcelain) was form Catch 123, the second (less bumpy) was using high quality dense loud and the third using a ultra high cloud (very bumpy). I can't remember but I don' think I reused the map.
Title: Re: Bumpy suface
Post by: bigben on September 15, 2014, 12:11:55 AM
You're also increasing the resolution of the surface, so you will also start to see more noise. This will partly be related to the distance at which you photographed the object, so if you want a smoother model it's easiest to move closer to the object, remembering that you don't have to include the whole object in each image.

Using gradual selection to delete "bad" points from the sparse cloud can also improve the result. As a quick starting point I use 0.5 for reprojection error and 35 for reconstruction uncertainty
Title: Re: Bumpy suface
Post by: FoodMan on September 15, 2014, 08:31:46 AM
how many images are you using..? what res..?

f/
Title: Re: Bumpy suface
Post by: Brit on September 15, 2014, 01:40:12 PM
I used 49 images at 10 mega-pixels in raw format. The statue was high up so this is a close as I could get. I'm not sure what "I use 0.5 for reprojection error and 35 for reconstruction uncertainty". means? ......I just found it on the Help for the software...and I'll try an digest it later. Where do you find these settings? The Help guide doesn't say.
Title: Re: Bumpy suface
Post by: FoodMan on September 15, 2014, 02:26:46 PM
mmm 10 mpixels is pretty low considering the statue fills only 30% of the images...

f/
Title: Re: Bumpy suface
Post by: bigben on September 15, 2014, 05:16:32 PM
It's mentioned in the Help under Editing Point Cloud
View sparse point cloud
Menu: Edit > Gradual Selection
Move slider to desired level
Delete the selected points.
Build dense point cloud
(You need to do this separately for each criterion)

Given the size and number of images I think you may be close to as good a result as you can expect though.
Title: Re: Bumpy suface
Post by: chrisd on September 15, 2014, 07:43:10 PM
Given the size and number of images I think you may be close to as good a result as you can expect though.

Given that the size of the object cannot be increased in the frame, do you have an idea of how many more pictures might improve the result. Like 2x as many, 3x as many, etc?
Title: Re: Bumpy suface
Post by: bigben on September 16, 2014, 12:30:33 AM
It's the combination of factors...  If it's a single row of photos (i.e. you can't get a higher view) then the number of photos is OK, in which case it's the size of the images (or rather the size of the statue within the images) that is the limiting factor and taking more photos won't get you any significant improvement.

If you could zoom in more that would increase your effective resolution, remembering that the entire object doesn't need to be visible in the frame
Title: Re: Bumpy suface
Post by: Alexey Pasumansky on September 16, 2014, 09:40:57 AM
Hello Brit,

We are currently checking this dataset. It seems that many images have different size - were they cropped prior to processing?
Title: Re: Bumpy suface
Post by: Brit on September 16, 2014, 03:34:19 PM
Yes they are cropped for the statue to fit as much as possible of the frame. Is cropping incorrect? I am in the middle of cropping and making 80 images of the Birkenau Gate. It has taken hours. (I hope I don' have to retrieve the originals...if I still have them, and start over.)
Title: Re: Bumpy suface
Post by: Brit on September 16, 2014, 04:10:19 PM
Sorry I meant "masking", not "making". I did save the originals, so I'll hold off to get the answer (to whether not to crop) before masking and cropping the rest...

...I just read the instructions on the PDF and it says "Do not crop or geometrically transform the images". yikes. I guess I have to start over masking? The gate is quite small in some images since there were obsticals in the way, and it was especially small in the frame when the long wide gate was taken at the side view.
Title: Re: Bumpy suface
Post by: Brit on September 16, 2014, 05:04:29 PM
here are 2 images (misspelled) before ...and after they were cropped and masked (saved as jpgs and downsized to 110 ppi  to upload here). Should I redo them without cropping?
Title: Re: Bumpy suface
Post by: Alexey Pasumansky on September 16, 2014, 05:49:03 PM
Cropping is strongly unrecommended.
Title: Re: Bumpy suface
Post by: DCK on September 16, 2014, 08:58:42 PM
bigben (and others),

really useful post. thanks.

do you use the "image count" criterion on gradual selection? at all levels, it seems to want to remove a very substantial number of points from the sparse cloud.

also, anecdotally, i get the sense that when part of the object is out of focus and not excluded by masking, this affects the quality of the texture model moreso than the geometric accuracy of the mesh. is this correct?
Title: Re: Bumpy suface
Post by: Brit on September 16, 2014, 10:46:39 PM
Oh well, back to the masking. I'll start over ...I had finished 20 out of 85 images (in 2 hours). Hopefully I'll be faster this time around.
Title: Re: Bumpy suface
Post by: Brit on September 16, 2014, 10:49:40 PM
"the entire object doesn't need to be visible in the frame." That is good to know! So just part of it will work, as long as all of it is in some frames?
Title: Re: Bumpy suface
Post by: bigben on September 17, 2014, 01:26:53 AM
Yes, and there's plenty of overlap so that each point on the object is in at least 3 images.
Title: Re: Bumpy suface
Post by: Alexey Pasumansky on September 17, 2014, 12:53:10 PM
Hello Brit,

The basic principles of image acquisitions and pre-processing are the following:
- do not crop original images,
- do not apply geometrical transformations (rotations or deformations) to the images,
- use image frame effectively,
- provide sufficient overlap and coverage of the surface being reconstructed.

Additional recommendations:
- use lower ISO values,
- provide good focusing and sufficient focal depth to acquire sharp images,
- avoid using flash,
- if different focal length are used, make sure that cameras are grouped correctly into calibration groups (in Tools Menu -> Camera Calibration window).

Masking can be performed semi-automatically - at first you can generate masks from model and then adjust them manually.
Title: Re: Bumpy suface
Post by: Brit on September 17, 2014, 03:08:44 PM
Thank you for all the help!
Title: Re: Bumpy suface
Post by: Brit on September 17, 2014, 03:10:36 PM
What do you mean by: "Masking can be performed semi-automatically - at first you can generate masks from model and then adjust them manually."?
Title: Re: Bumpy suface
Post by: Alexey Pasumansky on September 17, 2014, 03:32:42 PM
Hello Brit,

I mean that you can build rough model, use Import Masks -> From Model option, then adjust automatically generated masks manually.
Title: Re: Bumpy suface
Post by: Brit on September 17, 2014, 06:19:49 PM
It what you are saying that I make masks roughly in Photoshop, then it is easier to adjust the masks more accurately in Photoscan?
Title: Re: Bumpy suface
Post by: meshmixup on September 17, 2014, 07:50:20 PM
Hi Brit, what Alexey means:

1. Align the photo, dense cloud and build the mesh without any masking
2. The generated mesh is roughly formed
3. Now, select the import mask -> from model! you can see the photos are masked with the rough model but not very fine
4. Then you can check the photo and edit the mask of each photo manually.
5. Once you have edited a better set of masks, you can re-run the process again  :)
Title: Re: Bumpy suface
Post by: Brit on September 17, 2014, 10:08:16 PM
1. Align the photo, dense cloud and build the mesh without any masking
2. The generated mesh is roughly formed

3. Now, select the import mask -> from model! you can see the photos are masked with the rough model but not very fine

This is the part I am unclear about - in order to import masks, I need to have masked all the photos in advance. I though that this method was to avoid making detailed masks? Do you mean > mask the images, then import and build cloud and mesh without the masks first? And then import the detailed masks?

4. Then you can check the photo and edit the mask of each photo manually.

How do I edit masks once they are imported (and the mesh is already made)? 

Title: Re: Bumpy suface
Post by: DCK on September 18, 2014, 04:06:02 AM
Holy crap. I've always masked before alignment. I just tried the procedure above: aligning, making a mesh, and building a texture model, all prior to masking.

The results are excellent. My question now is, WHY MASK AT ALL?

I shot my images against a black background, with the object mounted on a ball of plasticine and rotated on a turntable. As you can see from the attachment, PhotoScan picks up a few pieces of the plasticine and background, but I could easily cut these away without compromising my model.

Seriously, why mask at all?

DCK
Title: Re: Bumpy suface
Post by: meshmixup on September 18, 2014, 05:43:37 AM
Hi DCK, I think as your object is placed in controlled environment, you can easily take background photos and do masking nicely. Even without masking, i think you can still generate good results. So masking prior or after gives similar result.  But sometimes it is not possible to take background photos or there are other unwanted objects in the photos such as moving people. The above procedures can help to mask out these factors based on the rough model. But do not expect the masking result is very accurate therefore you have to modify it manually ;)

Hi Brit,
3. no masking -> align photo -> generate dense cloud -> generate mesh -> import mask -> from model. Done!
4. click the photo, you can edit the mask with the buttons given on the tool bar. just like photoshop
5. re-run align photo...... again. The model will be regenerated will new mask information

Anything I am missing or incorrect?  :)
Title: Re: Bumpy suface
Post by: Brit on September 18, 2014, 03:29:26 PM
Darn, I just spent 2 days (off and on..and until midnight last night) masking 85 images of a building -with a lot of obstructions such as signs and cars as well as people in front of it. After trying to produce the mesh from these, I'm not sure that I'll have the stamina to try again with his new method. ...Which I still can't get my head around for now.... :'(
Title: Re: Bumpy suface
Post by: Brit on September 18, 2014, 04:27:05 PM
I aligned the masked photos ...and came up with this the 2 sides of the building crossed in an x. any idea how to get them aligned correctly?
Title: Re: Bumpy suface
Post by: bigben on September 18, 2014, 04:44:32 PM
I occasionally get this, and have seen it in many posts.  There's usually 1 or 2 things to do to fix this.

Firstly, check the chunk info and see how many images are not aligned.
Select these images (the ones with NA next to them), right click on one and "align selected cameras". You usually find that a number of them will become aligned.

Secondly, rerun the image alignment.

In the attached screen grab the images that didn't align are at the end of the laneway. So one set of images aligned together quite nicely, but there was no overlap between these and the other images, so you effectively end up with two nicely aligned point clouds in random orientations.

Final model:
https://sketchfab.com/models/c0c1934004f14221b87c38e0e9bba820 (https://sketchfab.com/models/c0c1934004f14221b87c38e0e9bba820)
Title: Re: Bumpy suface
Post by: Brit on September 18, 2014, 04:51:52 PM
Hmm I did notice that the numbers were not in order in the cameras folder.. What could this be about? 

but now I understand how to edit masks later in Photoscan. It is still much easier in Photoshop.
Title: Re: Bumpy suface
Post by: Brit on September 18, 2014, 04:58:05 PM
The chunk info says that they are all aligned?  The order is weird. There seems to be two of each and they go up from 0 to 1 to 10 to number 19, then number 2


Title: Re: Bumpy suface
Post by: Brit on September 18, 2014, 05:04:12 PM
Cool scan by the way!
Title: Re: Bumpy suface
Post by: Alexey Pasumansky on September 18, 2014, 05:07:09 PM
Hello Brit,

The order of images in the Workspace pane doesn't matter.

Title: Re: Bumpy suface
Post by: Brit on September 18, 2014, 05:16:25 PM
I aligned it again removing the second set and got this.
Title: Re: Bumpy suface
Post by: David Cockey on September 18, 2014, 05:46:44 PM
1. Align the photo, dense cloud and build the mesh without any masking
2. The generated mesh is roughly formed

3. Now, select the import mask -> from model! you can see the photos are masked with the rough model but not very fine

This is the part I am unclear about - in order to import masks, I need to have masked all the photos in advance. I though that this method was to avoid making detailed masks? Do you mean > mask the images, then import and build cloud and mesh without the masks first? And then import the detailed masks?

4. Then you can check the photo and edit the mask of each photo manually.

How do I edit masks once they are imported (and the mesh is already made)?

Masks are created, not imported, for each photo based on the existing model when the "from model" option is selected for "Import Masks".
Title: Re: Bumpy suface
Post by: David Cockey on September 18, 2014, 05:51:19 PM
I only mask when the background has changes or moves between photos. My experience is a person walking through or a car driving through which only appear on one or two photos do not cause any problems. Also I have not had problems if an object is present in the background but stationary for some of the photos and completely out of other photos with similar alignment.

A stationary background can help alignment.
Title: Re: Bumpy suface
Post by: bigben on September 18, 2014, 06:38:24 PM
In theory, the order of images shouldn't matter but I'd suggest renaming images anyway so that the number at the end has the same number of digits and windows sorts correctly. Yours are sorting alpha numerically (left to right) so 1, 10, 100 and 1000 all come before 2. I have experienced similar outcomes in the same situation (but not always), and having the images in the right order can help.
Title: Re: Bumpy suface
Post by: Brit on September 18, 2014, 08:45:59 PM
How would I rename - to what?
Title: Re: Bumpy suface
Post by: bigben on September 19, 2014, 12:39:46 AM
We use Adobe Bridge because it sorts the files correctly with the shorter names and has a nice batch naming tool.
You just need to use a filename that has the same number of digits for all of the numbers, using leading zeros to make them the same length.

file1 > file001
file10 > file010 etc

If you've got less than 100 images then it's just as easy to manually rename images 1-9 with an additional 0 in front of the number