Forum

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - robertomstocker

Pages: [1]
1
Perfect! Thanks a lot Alexey!

2
That is exactly what I need! But my Raster Calculator window does not display the band color (maybe because of what I said previously about the exif data). I've attached a screenshot of it.


3
Thanks for the answer =)!
I'm in fact using the Micasense Rededge camera. Photoscan version: 1.3.2.

Everything you said should work fine, but let me rephrase my problem.

Once I export the GeoTiff with the default options, the output is a single file with the 5 bands in it (so far so good). If I use visualize it using QGIS or a similar software I can see the 5 bands, but I don't know if "Band 1" is blue, green, red, rededge or NIR (I had to manually find the RGB order to get the correct visualization colors). Photoscan also uses the B1 to B5 notation, so what I want to do is figure out which band is which color.

Since I used a custom script to transform the raw camera images to reflectance images (and some exif data lost in the way), I had to use the folder structure to create the multispectral cameras in Photoscan (Worflow menu -> Add folder -> I select a folder containing 5 folders named "blue", "green", "red", "rededge", "nir"). The result is correctly created cameras, but can't find the correspondence between original folder name and band number assigned in Photoscan.

4
General / Identifying bands from multispectral images in folder structure
« on: December 20, 2017, 12:48:09 AM »
I've imported multispectral images using the folder structure following the instruction from section "To create a chunk from multifolder layout" in document www.agisoft.com/pdf/photoscan-pro_1_3_en.pdf

It works perfectly, except that I can't find a way to identify output bands. I imported a folder containing 5 folders names: "blue", "green", "red", "rededge" and "nir", but Photoscan produces a Band 1, Band 2, Band 3, Band 4, Band 5 structure when I export a GeoTIFF and I don't know the correspondence between my folders and the band numbers.

Thanks!

5
Ok, I think I got it.

1. From (imX, imY) pixels on camera 0 to v_out_world = (lng, lat, alt) on world map

Code: [Select]
doc = PhotoScan.app.document
chunk = doc.chunk
camera = chunk.cameras[0]
point2D = PhotoScan.Vector([imX, imY])
sensor = camera.sensor
v = chunk.model.pickPoint(camera.center, camera.transform.mulp(sensor.calibration.unproject(point2D)))
v_t = chunk.transform.matrix.mulp(v)
v_t.size = 3
v_out_world = chunk.crs.project(v_t)


2. From v_proj = (lng, lat, alt) on world map to camera v_out_pix = (x, y) pixels

Code: [Select]
v_unproj = chunk.crs.unproject(v_proj)
v_inv = chunk.transform.matrix.inv().mulp(v_unproj)
v_inv.size = 3
v_out_pix = sensor.calibration.project(camera.transform.inv().mulp(v_inv))

References:
http://www.agisoft.com/forum/index.php?topic=6176.0
http://www.agisoft.com/forum/index.php?topic=7446.0
http://www.agisoft.com/forum/index.php?topic=6053.msg29355#msg29355

6
I'm trying to achieve two coordinate conversions:

1. Using (x, y) from a photo, determine the corresponding (lng, lat) coordinates.

For this part, I believe the code posted here http://www.agisoft.com/forum/index.php?topic=7446.0 should work:

Code: [Select]
chunk = PhotoScan.app.document.chunk
camera = chunk.cameras[0]
point2D = PhotoScan.Vector([imgX,imgY]) # coordinates of the point on the given photo
sensor = camera.sensor
calibration = sensor.calibration
x = chunk.point_cloud.pickPoint(camera.center, camera.transform.mulp(sensor.calibration.unproject(point2D)))

adding

Code: [Select]
result = chunk.crs.project(x)

I can't find the "pickPoint" function in the API Reference document, but would this return the expected result?

2. Using a (lng, lat) to determine the corresponding (x, y) pixel coordinates in each photo of the project.

For this case, I was thinking on creating a Marker to simplify the code

Code: [Select]
chunk = PhotoScan.app.document.chunk
pointWorld2D = PhotoScan.Vector([lng, lat])
x = crs.unproject(pointWorld2D)
chunk.addMarker(point = x)

and then loop over "marker.projections" to obtain the (x, y) pairs for each camera.

Am I on the correct path?

Thanks!

P.S: This post also gave me a couple of clues: http://www.agisoft.com/forum/index.php?topic=6053.msg29355#msg29355

Pages: [1]