Forum

Author Topic: How to import a Reality Capture scene?  (Read 12887 times)

3D Make me small

  • Newbie
  • *
  • Posts: 1
    • View Profile
How to import a Reality Capture scene?
« on: January 26, 2017, 07:48:02 PM »
Hello everyone,

is it possible to import a mesh from RC so that i can texture it in Photoscan? Everyway i have tried it did not work.

Kind regards
Mirko

badger

  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: How to import a Reality Capture scene?
« Reply #1 on: February 04, 2017, 02:49:38 PM »
Hello everyone,

is it possible to import a mesh from RC so that i can texture it in Photoscan? Everyway i have tried it did not work.

Kind regards
Mirko

I guess you also agree that RC texturing badly sucks ?  :) :)

However, it is not possible unfortunately, unless you have the pro version.

You need to export from RC as "bundler output with negative Z", but then you can't import it into Photoscan because of a photoscan bug. You import the cameras, but Photoscan translates all their positions, while the imported mesh mesh will not be translated (hence texturing in Photoscan of an RC generated mesh would not work).

There's a workaround, that was kindly provided to me by agisoft customer support, which works through python scripting and therefore only on the professional version of Photoscan.

MeSelfie

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: How to import a Reality Capture scene?
« Reply #2 on: February 04, 2017, 07:40:20 PM »
RC : Present Versions of RC did not support import the model but does not keep custom UVs (RECONSTRUCTION / IMPORT MODEL), the new version of texturing that will enable importing custom UVs ( + many other features ), but it costs
you want a lot of experience to work on it , its not so easy as Photoscan

Regards
http://mephoto.in/meselfie-3d-studio/
The Complete 3D Solutions
Contact: ypr@mephoto.in
« Last Edit: February 04, 2017, 08:23:12 PM by MeSelfie »

Boink

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: How to import a Reality Capture scene?
« Reply #3 on: March 21, 2017, 01:45:00 PM »
Hello everyone,

is it possible to import a mesh from RC so that i can texture it in Photoscan? Everyway i have tried it did not work.

Kind regards
Mirko

I guess you also agree that RC texturing badly sucks ?  :) :)

However, it is not possible unfortunately, unless you have the pro version.

You need to export from RC as "bundler output with negative Z", but then you can't import it into Photoscan because of a photoscan bug. You import the cameras, but Photoscan translates all their positions, while the imported mesh mesh will not be translated (hence texturing in Photoscan of an RC generated mesh would not work).

There's a workaround, that was kindly provided to me by agisoft customer support, which works through python scripting and therefore only on the professional version of Photoscan.

Can you share us the workaround regarding this process? I've been looking if it's really possible to import RC to Agi.
Btw, I'm using PRO version.

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14843
    • View Profile
Re: How to import a Reality Capture scene?
« Reply #4 on: March 21, 2017, 03:31:32 PM »
Best regards,
Alexey Pasumansky,
Agisoft LLC

Boink

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: How to import a Reality Capture scene?
« Reply #5 on: March 21, 2017, 03:53:42 PM »
Hello Boink,

Please check this thread:
http://www.agisoft.com/forum/index.php?topic=6270.msg32344#msg32344

Thanks for the link Alexey. I've tried it but it seems to not work on my end. The mesh that I imported is still not aligned with the cameras.
Here's what I did:
Import photos > Import Cameras (select the .out file) > run the script > import the mesh

I'm not sure if I missed something.

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14843
    • View Profile
Re: How to import a Reality Capture scene?
« Reply #6 on: March 21, 2017, 04:07:56 PM »
Hello Boink,

Are there any error messages in the Console pane?

I suggest the following:
- load photos,
- import cameras (cancel build points dialog),
- import mesh,
- run script.
Best regards,
Alexey Pasumansky,
Agisoft LLC

Boink

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: How to import a Reality Capture scene?
« Reply #7 on: March 21, 2017, 04:33:58 PM »
There are no error messages in the Console pane.
I followed the steps that you said and it's still not working  :-\
I'm using 1.2.6 version. I also tried to remove the comment of 'for version1.2' in the script but there's still no luck.

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14843
    • View Profile
Re: How to import a Reality Capture scene?
« Reply #8 on: March 21, 2017, 04:37:20 PM »
Hello Boink,

For the version 1.2.6 you also need to comment the line for 1.3:

Code: [Select]
import PhotoScan

doc = PhotoScan.app.document
chunk = doc.chunk
path = PhotoScan.app.getOpenFileName("Specify bundler.out file used:")
file = open(path, "rt")

coords = list()

line = file.readline()
line = file.readline()
for i in range(0, len(chunk.cameras)):
    line = file.readline()
    line = file.readline()
    line = file.readline()
    line = file.readline()
    line = file.readline()
    x, y, z = line.split()
    coords.append(PhotoScan.Vector([float(x), float(y), float(z)]))

T = chunk.cameras[i].transform

###for version 1.3:
        #R = chunk.cameras[i].transform.rotation() * PhotoScan.Matrix.Diag([1,-1,-1]) #for version 1.3
###end of code for version 1.3

###for version 1.2:
R = PhotoScan.Matrix([[T[0,0], T[0,1], T[0,2]],
[T[1,0], T[1,1], T[1,2]],
[T[2,0], T[2,1], T[2,2]]])
R = R * PhotoScan.Matrix.Diag([1,-1,-1]) #for version 1.2
###end of code for version 1.2

    v = (-1) * R * coords[-1]

chunk.cameras[i].transform = PhotoScan.Matrix([[T[0,0], T[0,1], T[0,2], v.x],
[T[1,0], T[1,1], T[1,2], v.y],
[T[2,0], T[2,1], T[2,2], v.z],
[0, 0, 0, 1]])

file.close()

print("finished")
Best regards,
Alexey Pasumansky,
Agisoft LLC