interface improvements
Co-authored-by: Alex <AlexanderMcDowell@users.noreply.github.com>master
parent
97ab6a1ed1
commit
8a364b81e6
|
@ -6,6 +6,10 @@
|
|||
| --- | --- | --- |
|
||||
| ![](screenshots/pyro_input.png) | ![](screenshots/pyro_results.png) | ![](screenshots/temp_dist_plot.png)
|
||||
|
||||
| Labeling Input | Labeling Results |
|
||||
| --- | --- |
|
||||
| ![](screenshots/projected_area_in.png) | ![](screenshots/projected_area_out.png) |
|
||||
|
||||
## Using the web version
|
||||
|
||||
### Ratio Pyrometry
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 436 KiB |
Binary file not shown.
After Width: | Height: | Size: 1.8 MiB |
Binary file not shown.
Before Width: | Height: | Size: 826 KiB After Width: | Height: | Size: 1.3 MiB |
|
@ -1,3 +1,7 @@
|
|||
# use headless backend
|
||||
import matplotlib
|
||||
matplotlib.use("Agg")
|
||||
|
||||
import base64
|
||||
import cv2 as cv
|
||||
import numpy as np
|
||||
|
@ -18,7 +22,7 @@ def get_projected_area(image, area_threshold, display_threshold):
|
|||
|
||||
img = morphology.area_closing(thresh_gray, area_threshold=area_threshold, connectivity=1)
|
||||
|
||||
contours = measure.find_contours(array=img, level=100)
|
||||
contours = measure.find_contours(image=img, level=100)
|
||||
|
||||
fig, ax = plt.subplots()
|
||||
ax.imshow(original, cmap=plt.cm.gray, alpha=0.3)
|
||||
|
|
|
@ -33,6 +33,14 @@ html {
|
|||
flex-direction: column;
|
||||
}
|
||||
|
||||
#img-preview {
|
||||
width: 18rem;
|
||||
}
|
||||
|
||||
#pyro-eqn {
|
||||
width: 800px;
|
||||
}
|
||||
|
||||
.img-table-heading {
|
||||
padding: 4px 10px;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
function setOnchange() {
|
||||
let imgPreview = document.getElementById('img-preview');
|
||||
let imgUpload = document.getElementById('img-upload');
|
||||
imgUpload.onchange = event => {
|
||||
const [file] = imgUpload.files;
|
||||
if (file) {
|
||||
console.log(file)
|
||||
imgPreview.src = URL.createObjectURL(file);
|
||||
}
|
||||
};
|
||||
}
|
|
@ -58,25 +58,17 @@
|
|||
<input type="submit" value="Generate Heatmap"/>
|
||||
</form>
|
||||
|
||||
<!-- <script src="/img_preview.js" onload="setOnChange()"></script> -->
|
||||
<script>
|
||||
let imgPreview = document.getElementById('img-preview');
|
||||
let imgUpload = document.getElementById('img-upload');
|
||||
imgUpload.onchange = event => {
|
||||
let imgPreview = document.getElementById('img-preview');
|
||||
let imgUpload = document.getElementById('img-upload');
|
||||
imgUpload.onchange = event => {
|
||||
const [file] = imgUpload.files;
|
||||
if (file) {
|
||||
console.log(file)
|
||||
imgPreview.src = URL.createObjectURL(file);
|
||||
}
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
#img-preview {
|
||||
width: 18rem;
|
||||
}
|
||||
#pyro-eqn {
|
||||
width: 800px;
|
||||
}
|
||||
</style>
|
||||
|
||||
{% endblock %}
|
||||
|
|
|
@ -4,6 +4,9 @@
|
|||
<form action="/projected_area_results" method="POST" enctype="multipart/form-data">
|
||||
<h2>Projected Area Interface</h2>
|
||||
|
||||
<img src="#" id="img-preview" type="file"/>
|
||||
<br>
|
||||
|
||||
<input id="img-upload" type="file" name="file" accept=".png,.jpg,.jpeg,.tiff" value="Choose Image"/>
|
||||
|
||||
<h4>Settings</h4>
|
||||
|
@ -20,4 +23,17 @@
|
|||
<input type="submit" value="Generate Projected Sizes"/>
|
||||
</form>
|
||||
|
||||
<!-- <script src="/img_preview.js" onload="setOnChange()"></script> -->
|
||||
<script>
|
||||
let imgPreview = document.getElementById('img-preview');
|
||||
let imgUpload = document.getElementById('img-upload');
|
||||
imgUpload.onchange = event => {
|
||||
const [file] = imgUpload.files;
|
||||
if (file) {
|
||||
console.log(file)
|
||||
imgPreview.src = URL.createObjectURL(file);
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
{% endblock %}
|
|
@ -5,6 +5,7 @@
|
|||
<tr>
|
||||
<th class="img-table-heading">Input Image</th>
|
||||
<th class="img-table-heading">Output Heatmap</th>
|
||||
<th class="img-table-heading">Legend</th>
|
||||
</tr>
|
||||
<tr>
|
||||
{# Original image #}
|
||||
|
@ -15,11 +16,8 @@
|
|||
<td class="img-table-cell" id="res-cell">
|
||||
<img class="img-out" src="data:image/png;base64,{{ img_res_b64 }}" alt="result image">
|
||||
</td>
|
||||
</tr>
|
||||
{# Legend #}
|
||||
<tr>
|
||||
<td class="img-table-cell"></td>
|
||||
<td class="img-table-cell">
|
||||
<td>
|
||||
<table class="legend" id="legend">
|
||||
<tr>
|
||||
<th class="legend-heading">Color</th>
|
||||
|
|
Loading…
Reference in New Issue