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 - Romarb

Pages: [1]
1
General / Re: unpin markers
« on: September 16, 2016, 03:57:39 PM »
Alexey - thank you for you reply.

Can anyone give me a clue how to do it by using Python scripting?
For one marker, which is visible on many images, I would like to measure this marker only on some images and then choose the rest of images and unpin the marker.

2
General / unpin markers
« on: July 29, 2016, 04:32:43 PM »
Is it possible to unpin markers from several photos at the same time? Now I can only unpin markers by clicking on each photo separately.

3
Python and Java API / Re: Setting mapping region
« on: July 23, 2014, 04:58:19 PM »
I haven't solved this problem yet:/
Maybe it is caused somehow by transformation?

4
Python and Java API / Re: Setting mapping region
« on: July 23, 2014, 09:18:21 AM »
Thank you Alexey, your advice was helpful and now it works fine:)

EDIT
unfortunately not everything is right
I think that my units are wrong. I set bounding box size as 1x1 and when I checked reg.size it shows values correctly. But when I analyzed result I  saw that region is much more bigger (~40). Further, reg.center is placed in wrong place- I set it as a point 105.


5
Python and Java API / Re: Setting mapping region
« on: July 22, 2014, 04:30:44 PM »
Hello!
I tried to use this script:

Code: [Select]
# Define: Map region
#MapRegionVec = [CenterX, CenterY, SizeX0, SizeY0, ZRotationDeg]
MapRegionVec = [304331.4, 5740607.3, 173.8, 143.6, -25.0]

# ALIGN PHOTOS
chunk.alignPhotos()

# SET MAPPING REGION (BOUNDING BOX)
# create new region object
newregion = PhotoScan.Region()
# Set region center:
centerUTM = PhotoScan.Vector([MapRegionVec[0], MapRegionVec[1], 0])
centerGEO = chunk.crs.unproject(centerUTM)
centerGEO.size = 4
centerGEO.w = 1
centerLocal = chunk.transform.inv() * centerGEO
newregion.center = PhotoScan.Vector([centerLocal[0], centerLocal[1], chunk.region.center[2]])
# Set region size
newregion.size = PhotoScan.Vector([MapRegionVec[2], MapRegionVec[3], chunk.region.size[2]])
# Set region rotation
# build rotation matrix in our coordinate system
RotZDeg = -MapRegionVec[4]
SinRotZ= math.sin(math.radians(RotZDeg))
CosRotZ= math.cos(math.radians(RotZDeg))
RotMat = PhotoScan.Matrix([[CosRotZ,-SinRotZ,0,0],[SinRotZ,CosRotZ,0,0],[0,0,1,0],[0,0,0,1]])
#  rotate region bounding box
T = chunk.transform
v = PhotoScan.Vector( [0,0,0,1] )
v_t = T * v
v_t.size = 3
m = chunk.crs.localframe(v_t)
m = m * T
m = RotMat*m
s = math.sqrt(m[0,0]**2 + m[0,1]**2 + m[0,2]**2) #scale factor
R = PhotoScan.Matrix( [[m[0,0],m[0,1],m[0,2]], [m[1,0],m[1,1],m[1,2]], [m[2,0],m[2,1],m[2,2]]])
R = R * (1. / s)
newregion.rot = R.t()
# put newregion to chunk
chunk.region = newregion

But it didn't work. I've changed: MapRegionVec = [5592663.063, 5840723.167, 500, 500, 0] and disable "Allign Photos" option because my photos are already alligned.
I set correct coordinate system in my project and assumed that CRS [in scritpt] is loaded from project.
What could be wrong?

Pages: [1]