Modify

Opened 5 years ago

Last modified 3 years ago

#18121 new enhancement

[Patch] Align images in the photoadjust plugin

Reported by: francois2 Owned by: holgermappt
Priority: normal Milestone:
Component: Plugin photoadjust Version:
Keywords: Cc:

Description

This feature allow to select 2 images, and interpolate images position between the 2 selected images.
The new menu entry is enabled when 2 images are selected.

Demo:

https://i.imgur.com/b3jGY2a.gif

Attachments (1)

patch_align_images.patch (8.4 KB ) - added by francois2 5 years ago.
Align images in the photoadjust plugin

Download all attachments as: .zip

Change History (11)

comment:1 by holgermappt, 5 years ago

It is nice that you can position a lot of photos that don't have an initial position, i.e. no GPS data, by positioning the first and the last and then everything else between the two with the new function. But for photos that are on the map already it is not that easy to see what is between the two selected, i.e. what will be updated. Would it make sense to draw something like a line from photo to photo in the order they are sorted (just an idea)?

The interpolate() function is a little bit confusing.

  • If the first photo is firstPhoto, then the name of the variable with the position oft that photo should relate to the photo variable, e.g. firstPos instead of pos1.
  • If a variable is named nbPhotos I would assume that it reflects the total number of photos, either including the first and last that are not modified or just the photos that are updated. But it is neither of the two. It is used as number of segments between first and last, so a better name is nbSegments.
  • I would pre-calculate (pos2.getX() - pos1.getX()) / nbPhotos (same for Y) as that is needed for all updated photos. Is there an offset object that can be added to pos1? Then it could be written as newPos = pos1 + i * offset.

My internal rule is to have at least three characters for variables, mainly because I use a text editor and no Java IDE. Search and replace is a lot easier that way. It would be nice if you could use idx instead of i and evt instead of e (try to search for e, it will match almost every line).

I need to read a little more about @Mocked and Expectations to understand what happens in the test.

comment:2 by francois2, 5 years ago

Hi, thanks for the review. I'll improve the code based on your comments. I'm quite busy but I'll try to do it by the end of the week.

by francois2, 5 years ago

Attachment: patch_align_images.patch added

Align images in the photoadjust plugin

comment:3 by francois2, 5 years ago

It is nice that you can position a lot of photos that don't have an initial position, i.e. no GPS data, by positioning the first and the last and then everything else between the two with the new function. But for photos that are on the map already it is not that easy to see what is between the two selected, i.e. what will be updated. Would it make sense to draw something like a line from photo to photo in the order they are sorted (just an idea)?

That would be great! We should add a preview dialog before doing the interpolation and a button to confirm it. Or are you thinking of another way to do it?

Anyway, I updated the patch with your comments.

Last edited 4 years ago by francois2 (previous) (diff)

comment:4 by francois2, 4 years ago

Hi there,

Any update on this?

in reply to:  4 comment:5 by holgermappt, 4 years ago

Replying to francois2:

Any update on this?

I didn't have time to look into this lately, but I plan to do so in a week or so.

in reply to:  3 comment:6 by holgermappt, 4 years ago

Replying to francois2:

But for photos that are on the map already it is not that easy to see what is between the two selected, i.e. what will be updated. Would it make sense to draw something like a line from photo to photo in the order they are sorted (just an idea)?

That would be great! We should add a preview dialog before doing the interpolation and a button to confirm it. Or are you thinking of another way to do it?

I was thinking of a line that is displayed if two photos are selected. The line would connect the first (selected) photo with the second (not selected), third, ... (all not selected), to the last (selected). Or the line is always displayed, like a GPX track with the photos as waypoints.

The question is how generic this should be and what other operations are possible. If different operations are possible based on the selected photos then it would be nice if there is a hint what is possible and how the result would look like. E.g. a panel with buttons for the different operations with the buttons for possible operations active and the others grayed out. If the mouse is over a button a live preview is shown on the map.

Some sort of preview makes sense anyway as there is no easy way to undo the photo operations. Or we add a generic undo first (here is a related post: https://lists.openstreetmap.org/pipermail/josm-dev/2016-January/007605.html)

That are all ideas from the usability point of view. So far I didn't think about how it can be implemented in Java.

comment:7 by francois2, 4 years ago

That are all ideas from the usability point of view. So far I didn't think about how it can be implemented in Java.

These improvements would be great. I need to think of how to do that from an UX point of view. In the meantime, is this patch ready to be merged?

comment:8 by Tyndare, 4 years ago

I love this feature, the patch works well !
Actually I would also need interpolation of photo direction (my camera doesn't have a compass), if I have time I'll try to work on it (as a second menu entry).
I think that the generic "undo" would be more useful than a preview/confirm dialog here.
Thanks.

in reply to:  8 comment:9 by francois2, 4 years ago

Replying to Tyndare:

I love this feature, the patch works well !

Thanks !

Actually I would also need interpolation of photo direction (my camera doesn't have a compass), if I have time I'll try to work on it (as a second menu entry).

You may be interested in this patch (https://github.com/francois2metz/josm-plugins/commit/352b58ea47d3777fc978706650e23e49ecc5bded) that add a menu entry on the geoimagelayer to set every image to look at the next one in the sequence (except the last one, this must be fixed). Tell me if it fit your needs.

comment:10 by Don-vip, 3 years ago

@holgermappt what's the status of this patch?

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain holgermappt.
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from holgermappt to the specified user.
Next status will be 'needinfo'. The owner will be changed from holgermappt to francois2.
as duplicate The resolution will be set to duplicate. Next status will be 'closed'. The specified ticket will be cross-referenced with this ticket.
The owner will be changed from holgermappt to anonymous. Next status will be 'assigned'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.