Hello,
we are using the -setReconstructionRegion command to set the bounding box.
Unfortunately for some cases the processed model results in a model that is too big and has blurry outlines.
When I checked the .rcbox file it has the correct width/height etc. Also sometimes if we retrigger the exact same pipeline the reconstruction region was set correctly and has the correct size.
As you can see in the images the models are blurry on the outside and the surface is at least twice or three times the size we specified in the rcbox file.
Do you know what would cause such a situation, or what we could do to prevent it?
Thanks for your response. We run a custom custom script that provides a .rcbox file to the -setReconstructionRegion command.
But the same command with the same file sometimes doesn’t actually set the reconstruction region. When I checked the Reality Capture UI while the automated script was running, I noticed that the reconstruction region was never set. Even if we saw that the -setReconstructionRegion ran and no error was thrown.
Is it possible to check whether the reconstruction region was successfully set via a cli command?
As Daniele said, the weird thing is that if we rerun the same project for a 2nd or 3rd time, the BB will be there and it’ll work. This happens for a wide variety of projects and I couldn’t find any correlation between them. We also can’t do this manually.
I do have additional questions:
Is it possible for the bounding box to fail when it’s being applied but for no error to be raised by the command?
Hi Matej,
this is quite unusual workflow.
Are you using that region in the same project? Do you have set the project and output coordinate system properly? How are you getting the elevation? Are you changing that value in the rcbox file?
Also, I exported the rcbox file and checked it and it is different to yours. Are you adding some lines into that file? As you have widthHeightDepth line twice…
Also, for the centre, are you using the degree coordinates or radians?
As you are running it more times, is that a fresh start of the project?
Regarding the manual testing, I was curious, if it is possible to import the rcbox into your project using the Import Reconstruction Region tool.
I suppose there is no error for the importing of the region in the system.
It seems I gave you some wrong information at the start. I’m not familiar much with RC and was just starting to debug this so sorry for that.
It seems this bug is always constant so it won’t fix by itself after the 1st or 2nd try. I’m guessing that the problem here is with the RC box file.
Regarding the elevation, we parse the rcbox file and read the last value of the CentreEuclid tag. We the increase it by 10 (constant) and set it in the new rcbox file along with the other values such as yaw, width, height, depth, long and lat.
Would RC throw an error if the rcbox file is not formatted correctly or has some incorrect values?
I tried importing it manually by going to Mesh Model → Reconstruction Region in the Import section and then selecting this rcbox file but nothing happens.
Hi Matej, thank you for your file.
I tested it and it looks I am able to import your region (I used original one and also changed the values for my project).
Can you check your Project and Output coordinate system settings?
Also, are the images from the attached picture georeferenced (because I don’t see any orange lines for the images)?
Can you try the application reset (Reset RealityCapture) and then try the import again?
The coordinate system on the Project and the Output is epsg:4326 - GPS (WGS 84).
The component is not Geo-references but I am not sure how or whether there exists a setting for each image.
OK, the usage of different coordinate systems could be a problem there.
Can you show me also the 1Ds view with one selected input image in the component?
As the reconstruction region is georeferenced, also the component must be georeferenced. As it is not for you, it is placed in different position, which is far away from the component and therefore it is not imported.
I tested this on my dataset, turned off the camera priors and nothing happened. To use the reconstruction region I had to turn on the priors and create georeferenced component.
The setting for separated images is in 1Ds view after image selection:
It seems the no Georeference components was my mistake since my local testing env wasn’t the same as production. I’ve changed it and it now applies the BB locally which is even stranger since it’s still not working in production for some buildings.
I’m not quite sure how to continue, do you have an idea of what might go wrong in those cases?
Can you let me know why are the coordinate systems wrong since they both match and are the same as the one in the rcbox file?
Hi Matej,
as the region is now working for you I suppose it is better, as it wasn’t working at all.
I suppose that in the production project will be some similar error. Is it possible to share the failing project with its reconstruction region with us?
RealityCapture uses different coordinate systems. Project shows the coordinate’s values in chosen system, but if the Output system is set to different one, you will see those values as exports.
For the reconstruction region, as it was created from georeferenced data, it says so in the file. But it can be used also for local system, which uses georeferenced data and the coordinates are different to WGS. In your case, you used the georeferenced region for not georeferenced component. The component in this case is close to system’s origin and the values for region are too big to be imported (or something like that).
You’re correct as I’m using the local coordinate system of the model to set the BB, but It’s still not clear to me what changes need to be made to the rcbox file in order to let RC know this?
As you’re using local system, are you sure that all projects are in the same local system?
In that case also the reconstruction region should be exported in the same local system. But (according to your shared data) it was created for georeferenced component, so also the component where you want to use that region should be georeferenced.
RCBOX file for not georeferenced component looks like this:
For local coordinates, are you keeping the image’s geoinfo or are you turning it off? And for local system, do you have some GCPs to get the component to the wanted position? As without knowing this, the component could be on slightly different positions for each alignment, as there is no information about where to place the component without those data.
We’re applying the BB based on some GPS coordinates we have. The process is that we’re converting these GPS coords to find the smallest possible rectangular containing them in order to then set this as a BB. The resulting values are put in the rcbox file and this is always relative to the local coordinate system. The component though is georeferenced, which I guess is because of the true value for isGeoreferenced in the rcbox file.
But the problem for me now, why does it not work on the 1st try but works on 2nd or 3rd one? For some other projects, this works on the 1st try so I’m guessing RC is converting the values correctly. Can there be an error in the conversion if it happens to soon after alignment or? Also, the 2nd and 3rd try are started from scratch, just FYI.
Any pros/cons that you could think of on using the WGS versus the local system?
I think at the moment we’d want to keep the images geoinfo and we also don’t have any GCPs. I’m guessing we would have to apply these if we want to use the local system in order to get the correct BB? Also, do we need these if we’re using WGS instead?
Also, thank you for the help so far, RC is a very new thing to me.
How are you getting those coordinates? Are you just rewriting the RCBOX file or are you adding some lines there?
You can check if the component is georeferenced in the application in 1Ds view next to the component name. If it is you’ll see the georeferencing icon there (a pin). isGeoreferenced value is valid only for the rcbox file (how it was created).
What is the difference between 1st and 2nd try? As you are writing it is started from scratch, there has to be something different in the way of the process… The best option there will be to share your project with us (the failing one) also with the original and modified rcbox. Could it be possible?
If everything is set up properly, then the conversion should be applied.
I think the local system should be more readable (as it in metric system, mostly). But in general, it doesn’t matter what kind of system are you using.
I think it is not necessary, but using GCPs you can get more precise models (as geoinfo from drones is not so precise).
Regarding the project sharing, let me check with my team on whether this is possible and I’ll let you know. While we’re on that topic, is it possible to set up a call whenever you’re available?
Regarding the GPS coordinates, we get them from Google maps where the end-user marks the building so that we can only process it and not the surroundings. We then use this data to calculate the bounding box (as a rectangle) and set the coordinates in a new rcbox file which we use to apply the BB. Regarding the 1st and 2nd try, strangely there is no difference and is processed with the same exact data.
I am sorry, but we don’t do calls. Only written help is available there.
As you are getting the coordinates from Google maps, it is possible that the data won’t be so precise. Also, there could be a difference between the model height computed from drone’s data and the height obtained from the maps… I suppose it is not an ideal workflow, as there is a place for quite a lot of mistakes.