Skip to content

Commit

Permalink
Added all registration parameters to (collapsed) UI element.
Browse files Browse the repository at this point in the history
  • Loading branch information
maubreville committed Jun 28, 2024
1 parent 2e6cd5e commit 6ac50b6
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 1 deletion.
82 changes: 82 additions & 0 deletions exact/exact/images/templates/images/imageset_v2.html
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,88 @@ <h3>{{imageset.name}} : Registration
</table>
<div>
<input class="btn btn-primary" type="submit" value="Register">
<button class="btn btn-secondary" type="button" data-toggle="collapse" data-target="#collapseOptions" aria-expanded="false" aria-controls="collapseOptions">
Options &#9660;
</button>

<div class="collapse" id="collapseOptions">
<div class="card card-body">
<table><tr><td>
maxFeatures:
</td><td><select name="maxFeatures">
<option value=256>256</option>
<option value=512>512</option>
<option value=1024 selected>1024</option>
<option value=2048>2048</option>
<option value=4096>4096</option>
</select>
</td></tr>
<tr><td>thumbnail_size</td>
<td>
<select name="thumbnail_size_1">
<option value=512>512</option>
<option value=1024 selected>1024</option>
<option value=2048>2048</option>
<option value=4096>4096</option>
<option value=8192>8192</option>
</select> x
<select name="thumbnail_size_2">
<option value=512>512</option>
<option value=1024 selected>1024</option>
<option value=2048>2048</option>
<option value=4096>4096</option>
<option value=8192>8192</option>
</select>
</td></tr>
<tr><td>
filter outliers:
</td><td><select name="filter_outliner">
<option value=0 selected>no</option>
<option value=1>yes</option>
</select>
</td></tr>
<tr><td>
use_gray:
</td><td><select name="use_gray">
<option value=0 selected>no</option>
<option value=1>yes</option>
</select>
</td></tr>
<tr><td>
target_depth:
</td><td><select name="target_depth">
<option value=1>1</option>
<option value=2>2</option>
<option value=3>3</option>
<option value=4 selected>4</option>
<option value=5>5</option>
<option value=6>6</option>
<option value=7>7</option>
<option value=8>8</option>
</select>
</td></tr>
<tr><td>
point_extractor
</td><td>
<select name="point_extractor">
<option selected value="sift">SIFT</option>
<option value="orb">ORB</option>
</select>
</td></tr>
<tr><td>
feature matching
</td><td>
<select name="flann">
<option selected value=1>FLANN</option>
<option value=0>brute force</option>
</select>
</td></tr>
<tr><td>scale</td>
<td><input type=text value='0.7' name="scale"></td></tr>

</table>
</div>
</div>
</div>

<div class="row" style="padding-top: 20px;">
Expand Down
15 changes: 14 additions & 1 deletion exact/exact/images/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -727,12 +727,25 @@ def view_imageset(request, image_set_id):

image_registration = ImageRegistration.objects.filter(source_image=source_image, target_image=target_image).first()

maxFeatures=int(request.POST['maxFeatures'])
thumbnail_size=(int(request.POST['thumbnail_size_1']),int(request.POST['thumbnail_size_2']))
filter_outliner=int(request.POST['filter_outliner'])
maxFeatures=int(request.POST['maxFeatures'])
use_gray=int(request.POST['use_gray'])
target_depth=int(request.POST['target_depth'])
point_extractor='orb' if (request.POST['point_extractor'] == 'orb') else 'sift'
flann=1 if (request.POST['flann']=='1') else 0
scale=float(request.POST['scale'])


# register the two images
if image_registration is None:

image_registration = ImageRegistration(source_image=source_image, target_image=target_image)

image_registration.perform_registration() # use default parameters for now
image_registration.perform_registration(maxFeatures=maxFeatures, thumbnail_size=thumbnail_size, filter_outliner=filter_outliner,
use_gray=use_gray, target_depth=target_depth, point_extractor=point_extractor, flann=flann,
scale=scale) # use default parameters for now

image_registration_src = ImageRegistration.objects.filter(source_image_id__in=imageset.images.all())
image_registration_trg = ImageRegistration.objects.filter(target_image_id__in=imageset.images.all())
Expand Down

0 comments on commit 6ac50b6

Please sign in to comment.