Forum

Author Topic: when using mesh from depth maps deleted areas reappear  (Read 1005 times)

Steve003

  • Full Member
  • ***
  • Posts: 166
    • View Profile
when using mesh from depth maps deleted areas reappear
« on: August 11, 2022, 10:26:24 PM »
Hi,
Metashape 1.8.2
I like to tidy up the model, when after align photos I delete the base its sitting on for example, currently a newspaper is my victim !
I am using mesh from Depth maps to see if its better, HOWEVER the base (newspaper) keeps reappearing.

It is NOT POSSIBLE to delete an unwanted base a model sits on, when using workflow ' mesh from depth maps' is my conclusion.

Am I right ?

surely we dont want that tedious time spent erasing up to the model to be wasted,  what is the solution to this ?

Steve003

Arie

  • Full Member
  • ***
  • Posts: 134
    • View Profile
Re: when using mesh from depth maps deleted areas reappear
« Reply #1 on: August 12, 2022, 10:28:00 AM »
Deleting points from the sparse cloud does not affect which areas will be reconstructed. The sparse cloud represents image feature points that were used for computing the camera pose. Removing those points is only helpful for optimizing the camera alignment.

In your case you could either adjust the reconstruction region (bounding box) to exclude certain areas from reconstruction. Alternatively, you could delete unwanted points from the sparse cloud, mesh it and use the "import masks from model" to mask the images. Masked areas will not be reconstructed.
Cheers.

PolarNick

  • Jr. Member
  • **
  • Posts: 73
    • View Profile
Re: when using mesh from depth maps deleted areas reappear
« Reply #2 on: August 12, 2022, 11:34:41 AM »
Also you can try to delete unwanted triangles from built model directly (using Free-Form Selection for example).

Steve003

  • Full Member
  • ***
  • Posts: 166
    • View Profile
Re: when using mesh from depth maps deleted areas reappear
« Reply #3 on: August 12, 2022, 03:33:15 PM »
Hi, I will try both suggestions.
As the region is a box and as this is an arched item standing on the newspaper, its a sort of W shape, the region cannot be made to exclude the newspaper under the arched item.

If the background is such that its confusing the build, and as 'mask from model' apply to all cameras,  clearly requires the build to succeed to be used, it strikes me that mask from model has a use after the model is made, and cannot help make the model in the first place.

Could someone explain the steps involved from importing photos,  and how useful mask from model is and its use and purpose and how it avoids an apparent catch22 situation ?

Steve

Arie

  • Full Member
  • ***
  • Posts: 134
    • View Profile
Re: when using mesh from depth maps deleted areas reappear
« Reply #4 on: August 12, 2022, 04:01:53 PM »
I thought this topic is related to what is being reconstructed and not alignment errors? If you can't get the images to align, the mask from model workflow will not help.

Steve003

  • Full Member
  • ***
  • Posts: 166
    • View Profile
Re: when using mesh from depth maps deleted areas reappear
« Reply #5 on: August 12, 2022, 04:25:07 PM »
Hi,
No alignment errors in the project I am running (though in 2 of the sets of photos one wouldnt align, no apparent reason,  solved by using photoscan. as always.)

but in an 'its possible' scenario, for us all,  still hoping someone somewhere can explain the role 'masks' play or could play if a background was causing problems, lets say a human was in a few shots moving about., when photographing a tractor at a show for example. the workflow steps to solve such.

good for us all to know.

Steve003
« Last Edit: August 12, 2022, 09:20:20 PM by Steve003 »

Arie

  • Full Member
  • ***
  • Posts: 134
    • View Profile
Re: when using mesh from depth maps deleted areas reappear
« Reply #6 on: August 12, 2022, 04:32:40 PM »
Masks exclude areas from processing. This includes alignment, dense cloud/ depth map based mesh and texturing. Everything masked will not be used whatsoever.

It seems you might want to optimize your data acquisition methods. I've been using Metashape for a long time and can't even remember the last time I had alignment issues.

PolarNick

  • Jr. Member
  • **
  • Posts: 73
    • View Profile
Re: when using mesh from depth maps deleted areas reappear
« Reply #7 on: August 12, 2022, 04:59:06 PM »
Also if you are using Metashape Pro - you can try to use this AI-driven script - https://github.com/agisoft-llc/metashape-scripts/blob/master/src/automatic_masking.py (but "How to install" requires some efforts)

Steve003

  • Full Member
  • ***
  • Posts: 166
    • View Profile
Re: when using mesh from depth maps deleted areas reappear
« Reply #8 on: August 12, 2022, 09:31:12 PM »
Hi,
Quote
Arie...It seems you might want to optimize your data acquisition methods. I've been using Metashape for a long time and can't even remember the last time I had alignment issues.

All my photos are correctly exposed evenly lit, 12 out of 22 failed the other day, ran them in photoscan and they all were aligned.
I had 1 fail in each of 2 sets, subject very matt, rusty covered in the most ideal surface pattern sat on newspaper, looking at the failure it had good progression from the previous one and into the next one that got aligned.

the photos couldnt be better, bounce flash off the ceiling in all cases or direct flash, only suitable of item has very matt surface, all are adjusted in camera raw in photoshop, detailed revealed in shadows, lighting variances evened out, honesyly those that fail have no apparent reason to at all.

Now if I feel the background might be causing issues then I want to mask it out of the process, and thats why I want to know the easy way of doing so on 144 photos for example.

But if one has to make the model before using mask from model, thats a catch 22, how does one overide that one ?

I am still baffled by that.

if only someone would even reply to my asking how to use Photoshop to make a mask.
https://www.agisoft.com/forum/index.php?topic=14717.0

I will be sending Agisoft the photo sets of those that fail align in metashape and get aligned by photoscan.

usually metashape lets me down on alignment and photoscan never ever does.

polarnick, unfortunately I dont use metashape pro.  I do wonder if pro also fails in same way as Standard.

Steve
« Last Edit: August 12, 2022, 09:35:04 PM by Steve003 »

Steve003

  • Full Member
  • ***
  • Posts: 166
    • View Profile
Re: when using mesh from depth maps deleted areas reappear
« Reply #9 on: August 13, 2022, 01:22:27 AM »
Hi,

Quote
In your case you could either adjust the reconstruction region (bounding box) to exclude certain areas from reconstruction.

newspaper has appeared, the region box wont allow non box shapes to be drawn, as the newspaper sees a W shaped item standing on it I cant get that box to delete the paper the item stands on, as it would need to be drawn onto thhe newspaper in the V area.

so I need to edit it out manually

Quote
Alternatively, you could delete unwanted points from the sparse cloud, mesh it and use the "import masks from model" to mask the images. Masked areas will not be reconstructed.

the sparse cloud is I presume the somewhat non dense dotty mess after align photos, impossible to see what you are doing trimming up close to the model.
the next option exists with the violet coloured mesh, or with the not so bad image mapped to it.

I do so.

then I follow 'import mesh from model, right clicking on an image, choosing that from the list, apply to all cameras, it does its green bar progress thing, then I click the mask icon above the photos, AND SHOCK HORROR THE W SHAPE ITEM BUT ALSO THE NEWSPAPER IS IN WHITE, its ignored the fact that just the W is the model and showing as such in that mesh violet stage, with all newspaper removed.

WHAT THE HECK IS IT UP TO ?

Steve003

Arie

  • Full Member
  • ***
  • Posts: 134
    • View Profile
Re: when using mesh from depth maps deleted areas reappear
« Reply #10 on: August 13, 2022, 06:00:54 PM »
Quote
the sparse cloud is I presume the somewhat non dense dotty mess after align photos
That is an indication that your image capture method is flawed. Usually the sparse cloud should look like a clean, low resolution point cloud of the object.

Quote
12 out of 22 failed the other day, ran them in photoscan and they all were aligned.
22 images seems very little. Try capturing the object with the double or even triple the amount of images.
There have been quite some optimizations done to the alignment algorithm, greatly increasing the processing speed. If you capture your object correctly, you should not have those problems.

Mask from model requires a accurate image alignment.

Have you even tried importing masks from Photoshop? Just create a alpha channel with the mask, save as tiff and use "import mask from alpha".

Steve003

  • Full Member
  • ***
  • Posts: 166
    • View Profile
Re: when using mesh from depth maps deleted areas reappear
« Reply #11 on: August 13, 2022, 06:51:33 PM »
Hi, I have sent the photos and .psx and also .psz to Agisoft. Wait and see what they say.
I am happy for you to see it if you wish, as it will take ages to hear back from Agisoft and I am 'on this' and needing results now.
So I need to know now what to do next.

I can wetransfer it to you.

does this forum have pm system else I need your email address somehow.

You will see the lighting and image quality was very good, dSLR EOS 70D efl 17-40 lens on 40mm, acclaimed as a very good lens. speedlight 580ex bounce off the ceiling.
background was 'the lounge, somewhat cluttered. No items moved. I am so careful, so to hear that I am poor at capture, I need to know just what was poor, so as to improve.

my reference to the bitty sparse cloud was a quickly thought up term. see attached what I had (after I trim the surroundings and base away)
I didnt think it was at all bad.

Steve003

Arie

  • Full Member
  • ***
  • Posts: 134
    • View Profile
Re: when using mesh from depth maps deleted areas reappear
« Reply #12 on: August 13, 2022, 07:34:39 PM »
There is a PM system here, send me the WeTransfer link and I'll take a look.
Cheers.

Steve003

  • Full Member
  • ***
  • Posts: 166
    • View Profile
Re: when using mesh from depth maps deleted areas reappear
« Reply #13 on: August 13, 2022, 09:19:54 PM »
Hi, PM sent.
Steve003

Steve003

  • Full Member
  • ***
  • Posts: 166
    • View Profile
Re: when using mesh from depth maps deleted areas reappear
« Reply #14 on: August 13, 2022, 10:51:08 PM »
Hi Again,
 recieved a PM, there is no reply to PM option in this system, crazy as that may sound, so unable to rpely.

doing so here,
wetransfer requires entry of an email for recipient, they send the download link to that email address. Its always how its been for me, its what they present you as a sending panel.

PM me again with an email please.

and where is the reply button option to PM's ?

I have typed in the panel under your lettering and hit send message.

Steve003