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

Pages: [1]
1
General / Re: Importing IMU
« on: August 09, 2016, 08:14:32 PM »
Hi,

I am currently working on a dam inspection. I have mounted 2 DLSR ( Pentax K3II - Pentax K50 ) for the aerial part  and 4 GoPros ( 2 Hero 4 and 2 Hero 2) for the underwater part,  on a bar fixed to a boat. During the acquisition I have recorded IMU data and I would like to import them in PhotoScan. In attachment you can find a drawing that shows how the cameras and the IMU are installed. The Position and IMU data that I am trying to import are referenced at my cameras location. Up until now, I haven't been able to import them correctly. I know I should put some angular offsets in the "Camera Calibration" menu, but I don't know what are the suitable values.

From what I have understood the Photocan Manual  (see the attachment "PhotoScan_Sing_Convention.png"), the PhotoScan frame is the same as the one from my IMU. However, my cameras are  "looking" perpendicularly to my boat's heading ("Mounting.jpg").

I hope someone can shed some light about this. If I am not clear don't hesitate to contact me.

Thank you in advance !

2
Hi and thank you for your answer.

I haven't calibrated the GoPro beforehand and the lens type is checked as "fisheye".

The thing is, I made two acquisition of the same object (rocks of a seawall in my case) the same day. One in the morning around 9:30 am and the other one at 6pm. The aim was to see the impact of light for underwater photogrammetry. With the data set of the evening I get very good results ( I attached a picture of the evening session  to show you the difference between them). Therefore I know that, even without calibration, I should at least align cameras. But from what you said, the constant change in light would prevent PhotoScan from finding matches. What I don't understand is that, for somes pictures of the morning session, PhotoScan manage to align cameras although the light changes a lot between pictures as well.

I don't know if I am clear, but thank you very much Justin for your time and your answer. Have you some experience and feedback to share about underwater photogrammetry ?

3
General / Underwater Photogrammetry with GoPros - Alignment failures
« on: July 27, 2016, 03:55:26 PM »
Hi everyone,

I am using some GoPros (Hero 4 Black) for underwater photogrammetry. In order to have enough overlap between pictures, I have extracted every 10 frames an image from the 4K video. As almost no exif data is available in the extracted frames, I copied the meta data from an usual GoPro picture to all of my frames.

During the acquisition, I also recorded the GNSS Positions ( I have a position every second). The Hero 4 records 30 frames per second, so when I extract 10 frames, I have three consecutive frames that are within the same second. For those frames, I give the same position.

When I try to align thoses images I met some failures. In some cases, PhotoScan can't find any matches between two overlaping pictures.

I cannot send in attachment the pictures as the zip file is too big. Here is a link to download it :
 
https://we.tl/WDPgM0brs8

In this  zip file  you can find two overlaping pictures, "GOPR0827 1232.jpg" and "GOPR0827 1233.jpg". Although the overlap is superior to 80%, I don't have any matches between them ("1232_Matches.png" and "1233_Matches.png").

For my whole project I have almost 1300 cameras. I have tested on a small set of cameras (9 cameras) and I cannot align them. I would like to know what I am doing wrong or what I should do.

Kind regards, Simon

4
Python and Java API / Re: Retrieving Chunk information
« on: July 15, 2016, 06:01:50 PM »
Thanks !

5
Python and Java API / Re: Retrieving Chunk information
« on: July 15, 2016, 05:07:35 PM »
Hi,
 
I would like to know if there were a command to check if a camera is not aligned in a chunk. I could not find anything in the python reference pdf ( version 1.2.5).

Thank you in advance !

6
Hi everybody,

I have been trying to add some external packages to the PhotoScan Python distribution. I managed to add a package called "utm" but I haven't been able to add the numpy package. In attachment I put some printscreens that point out the error I get from PhotoScan.

It seems like my numpy package is incomplete or that Photoscan can't find some files. I downloaded my numpy package directly from the numpy website "http://www.numpy.org".

If anyone knows why it is not working for the numpy package and could help me, I will be very grateful.

Thanks in advance.

Simon

7
Yes this is what I plan to do. I will look at the pixels across the middle line of my image: (1,2000) to (6016,2000) that fit with the strucutre I am studying.

Code: [Select]
steps = list(zip(list(range(0, sensor.width - 1, step)), [1]*((sensor.height - 1)/2)))

As a result I should get the borders of my image footprint, right ?

8
I think I get what you are saying. The four corners of my pictures corresponds whether to the sky or the sea (background with non relevant information for me, I have attached a printscreen ), so it is logical that the four corners don't intersect with my mesh.

Thank you for noticing it. I will try to estimate which are the last pixels that "see" my structure.

Thank you for your answer.


9
Hello Alexey, first thank you very much for such a quick answer! I have sent the psz file to support@agisoft.com. You have probably received a download link. Just tell me if I need to sent it back.

Simon

10
Hello everybody !

I would like to compute the area covered for each of my cameras. I have already tried to use the code given as an example. I added the loop to go through each camera of my chunk. I also tried to select only the four corners. As a result i got ... nothing. It seems like it doesn't find any intersections with the faces of my mesh. Therefore I tried to add some pixels.  I got some results but it is not satisfying as I don't get the vertices positions corresponding to my corners.  I attached the txt file that I have at the end so taht you can see for yourself.

During the process I printed the position of the pixel I am using. It seems like I go through all of my corners [(0,0), (6015,0), (6015,399),(0,3999)] as my sensor.width=6016 and my sensor.height=4000. Nevertheless I don't get any vertices coordinates.

It is always for the same pixels that I manage to have intersections but never the four corners. I don't know what I am doing wrong. I barely changed the code from Alexey. I have tried many things but I don't have any ideas left. This is why I would like to know if there is anybody who met the same problem.

Here is the code:

Code: [Select]
import time
import PhotoScan

def cross(a, b):
result = PhotoScan.Vector([a.y*b.z - a.z*b.y, a.z*b.x - a.x*b.z, a.x*b.y - a.y *b.x])
return result

print("Script started")


#cam_index = PhotoScan.app.getInt("Input camera index (starting from zero): ") Manual selection of the camera
save_path = PhotoScan.app.getSaveFileName("Specify output file:")


t0 = time.time()
file = open(save_path, "wt")
file.write('FileName    Pixel x    Pixel y    Vertex Lon    Vertex Lat    Vertex Alt\n') # Header
doc = PhotoScan.app.document
chunk = doc.chunk
model = chunk.model
faces = model.faces
vertices = model.vertices

for camera in chunk.cameras:
    sensor = camera.sensor
    print(camera) #camera label

    step = 1000 #bigger value - faster processing.
    steps = list(zip(list(range(0, sensor.width - 1, step)), [0]*((sensor.width - 1)// step)))
    steps.extend( list(zip([sensor.width - 1]*((sensor.height - 1) // step), list(range(0, sensor.height - 1, step)))) )
    steps.extend( list(zip(list(range((sensor.width - 1), 0, -step)), [sensor.height - 1]*((sensor.width - 1)// step))))
    steps.extend( list(zip([0]*((sensor.height - 1) // step), list(range(sensor.height - 1, 0, -step)))) )
   
# Selection of the four corners:   
    #ltop_corner=PhotoScan.Vector([0, 0]) # left top corner
    #rtop_corner=PhotoScan.Vector([sensor.width - 1, 0]) # right top corner
    #rbottom_corner=PhotoScan.Vector([sensor.width - 1, sensor.height - 1]) # right bottom corner
    #lbottom_corner=PhotoScan.Vector([0, sensor.height - 1]) # left bottom corner
    #
    # List of the four corners
    #steps=[ltop_corner,rtop_corner,rbottom_corner,lbottom_corner]     
   
    print(steps)
 
    for x,y in steps:
        point = PhotoScan.Vector([x, y])
        point = sensor.calibration.unproject(point)
        point = camera.transform.mulv(point)
        vect = point
        p = PhotoScan.Vector(camera.center)
        for face in faces:
            v = face.vertices
            E1 = PhotoScan.Vector(vertices[v[1]].coord - vertices[v[0]].coord)
            E2 = PhotoScan.Vector(vertices[v[2]].coord - vertices[v[0]].coord)
            D = PhotoScan.Vector(vect)
            T = PhotoScan.Vector(p - vertices[v[0]].coord)
            P = cross(D, E2)
            Q = cross(T, E1)
            result = PhotoScan.Vector([Q * E2, P * T, Q * D]) / (P * E1)
            if (0 < result[1]) and (0 < result[2]) and (result[1] + result[2] <= 1):
                t = (1 - result[1] - result[2]) * vertices[v[0]].coord
                u = result[1] * vertices[v[1]].coord
                v_ = result[2] * vertices[v[2]].coord
               
                res = chunk.transform.matrix.mulp(u + v_ + t)
                res = chunk.crs.project(res)
               
                #file.write( "{:>04d}".format(x + 1) + "\t" + "{:04d}".format(y + 1) + "\t" + "{:.8f}".format(res[0]) + "\t" + "{:.8f}".format(res[1]) + "\t" + "{:.4f}".format(res[2]) + "\n")
                file.write("%s""\t""%d""\t""%d""\t""%.08f""\t""%.08f""\t""%.3f \n" % (camera.label, x+1,y+1,res[0],res[1],res[2]))
                break #finish when the first intersection is found

file.close()
t1 = time.time()
t1 -= t0
t1 = float(t1)
print("Script finished in " + "{:.2f}".format(t1) + " seconds.")

I am not sure I have understood everything about the code, especially this step:

Code: [Select]
result = PhotoScan.Vector([Q * E2, P * T, Q * D]) / (P * E1)
 if (0 < result[1]) and (0 < result[2]) and (result[1] + result[2] <= 1):
                t = (1 - result[1] - result[2]) * vertices[v[0]].coord
                u = result[1] * vertices[v[1]].coord
                v_ = result[2] * vertices[v[2]].coord

If someone feels like explaining it to me, I would be very grateful. I am quite new to Photoscan so I don't really know if I should post my question in this topic or somewhere else.

Best wishes,

Simon



Pages: [1]