Skip to content

Commit

Permalink
v0.1.6 (Name change)
Browse files Browse the repository at this point in the history
Squashed commit of the following:

commit 10db948
Author: Ricard Lado <ricardlado@hotmail.com>
Date:   Wed Nov 23 13:20:02 2022 +0100

    Updated README images (name change)
    - Eliminated the images from the repo and use a github issue instead (avoids bloating the repo with binaries)

commit 45dd378
Author: Ricard Lado <ricardlado@hotmail.com>
Date:   Tue Nov 22 14:22:27 2022 +0100

    Removed unnecessary code

commit 645ae8b
Author: Ricard Lado <ricardlado@hotmail.com>
Date:   Tue Nov 22 14:08:42 2022 +0100

    Update package name to comply with npm
    - Updated dependencies versions

commit c9d81bf
Author: Ricard Lado <ricardlado@hotmail.com>
Date:   Tue Nov 22 11:01:34 2022 +0100

    Version bump

commit 12cb7b8
Author: Ricard Lado <ricardlado@hotmail.com>
Date:   Tue Nov 22 10:51:09 2022 +0100

    Changed project name to ViMag
  • Loading branch information
RLado committed Nov 24, 2022
1 parent a370cc9 commit 7c63e45
Show file tree
Hide file tree
Showing 18 changed files with 1,276 additions and 1,341 deletions.
23 changes: 12 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

# <img title="Logo" alt="Logo: A tuning fork with an eye" src="./img/icon.svg" width="40px"></img> Vibrolab: *A Visual Vibration Toolbox*
# <img title="Logo" alt="Logo: A tuning fork with an eye" src="./img/icon.svg" width="40px"></img> ViMag: *A Visual Vibration Toolbox*

Vision-based damage detection techinques can reduce sensor deployment costs while providing accurate, useful, and full-field readings of structural behaviour. Our work presents a video processing methodology based on [STB-VMM](https://github.com/RLado/STB-VMM) implemented in a software toolbox that allows the processing of video data to obtain vibrational signatures of complex structures. Our [tests](https://papers.ssrn.com/sol3/papers.cfm?abstract_id=4229935) have demonstrated that this technique enables the identification of very light structural damage in a controlled lab environament. This vision-based technique may not be as precise as other contact-based or laser methods, but on the other hand, it offers an easy to use, efective, full-field, tool for structural health monitoring at a fraction of the cost.

Expand All @@ -15,36 +15,36 @@ Vision-based damage detection techinques can reduce sensor deployment costs whil

## Use instrucctions

To start working with VibroLab import a video file using the *File>Import video* menu or click the import icon in the left:
To start working with ViMag import a video file using the *File>Import video* menu or click the import icon in the left:

<img src="./img/readme_assets/screen02.png" width="600px"></img>
<img src="https://user-images.githubusercontent.com/25719985/203530586-c6216f03-5cdb-4226-bdd1-7cd3635ce857.png" width="600px"></img>

A dialog will open and let you select your desired video file(s). It is advised that input videos be recorded using a tripod and be no longer than 10 seconds approx.

Next, add slices to the areas in which you want to monitor vibration. This areas must have a contrasting color from the background. To add slices switch *Slice Mode* on by clicking the button. Then click once on the video to define the first point of the slice and again to define a second. Now your first slice should appear on screen.

<img src="./img/readme_assets/screen03.png" width="600px"></img>
<img src="./img/readme_assets/screen04.png" width="600px"></img>
<img src="https://user-images.githubusercontent.com/25719985/203531232-98eb8e3f-d559-4c7d-8ba7-fa83923ff05f.png" width="600px"></img>
<img src="https://user-images.githubusercontent.com/25719985/203531284-d5542d4e-17af-4665-8d01-5761acf24d18.png" width="600px"></img>

Note that you may click on the left navigation bar to unfold its contents. Further, right clicking each item will allow you to rename or delete the entry. When video items are double clicked they appear on the main window video player.

<img src="./img/readme_assets/screen05.png" width="600px"></img>
<img src="https://user-images.githubusercontent.com/25719985/203531424-59c9509b-3898-46b2-a7f4-e0d2bb11a27b.png" width="600px"></img>

Once the slices have been defined it is time for motion magnification computation. Save your project as a **.vl** file and click the cog icon on the left. The icon should spin until calculation is finished. (This may take several minutes)

<img src="./img/readme_assets/screen09.png" width="600px"></img>
<img src="https://user-images.githubusercontent.com/25719985/203531613-ba0a7f18-77c7-4946-b65c-45cc747fa1e7.png" width="600px"></img>

Once the calculation is finished unfold the bottom menu to see the magnified slices.

<img src="./img/readme_assets/screen10.png" width="600px"></img>
<img src="https://user-images.githubusercontent.com/25719985/203531979-dffe4e3f-666c-4dad-a31e-51f97d31f13a.png" width="600px"></img>

To obtain a numeric signal out of an image you must tell VibroLab which colors define the upper and lower bounds of the signal. This can be done by clicking on the image twice once for upper and a second time for lower. In scenarios like the one on the following picture you might click twice on the black line. Take as many attempts as you need to get a good signal, test the available tunnig parameters.
To obtain a numeric signal out of an image you must tell ViMag which colors define the upper and lower bounds of the signal. This can be done by clicking on the image twice, once for upper and a second time for lower. In scenarios like the one on the following picture you might click twice on the white line. Take as many attempts as you need to get a good signal, test the available tunnig parameters.

<img src="./img/readme_assets/screen11.png" width="600px"></img>
<img src="https://user-images.githubusercontent.com/25719985/203532454-595fbe58-1ef3-4090-87a9-4bd0bdc090a8.png" width="600px"></img>

Once a good signal has been obtained. You may compute the FFT by clicking the compute button. Note that changing the FFT parameters require FFT recalculation.

<img src="./img/readme_assets/screen12.png" width="600px"></img>
<img src="https://user-images.githubusercontent.com/25719985/203532581-f083cba2-af91-4cf2-a508-376fe55077ba.png" width="600px"></img>

If you need the raw data used by the application you may find it in the folder *[name of the project]_data* once the project has been saved.

Expand All @@ -56,6 +56,7 @@ If you need the raw data used by the application you may find it in the folder *
- Next, run the build scripts and let them package the application for you:

- On Linux:

```bash
npm run dev_setup
npm run package
Expand Down
4 changes: 2 additions & 2 deletions build_scripts/linux_x86_64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ make -j 32

# Create a venv
echo "Create a venv"
./python -m venv --copies vibrolab_venv
source vibrolab_venv/bin/activate
./python -m venv --copies ViMag_venv
source ViMag_venv/bin/activate
pip install --upgrade pip
pip install -r ../STB-VMM/requirements.txt
pip install -r ../TempSlice/requirements.txt
Expand Down
16 changes: 8 additions & 8 deletions build_scripts/windows_x86_64.bat
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ call .\PCbuild\build.bat

rem Create a venv
echo "Create a venv"
call .\python.bat -m venv --copies vibrolab_venv
ren .\vibrolab_venv\Scripts\ bin
call .\vibrolab_venv\bin\activate.bat
call .\vibrolab_venv\bin\pip.exe install --upgrade pip
call .\vibrolab_venv\bin\pip.exe install -r ../STB-VMM/requirements.txt
call .\vibrolab_venv\bin\pip.exe install -r ../TempSlice/requirements.txt
call .\vibrolab_venv\bin\pip.exe install -r ../requirements.txt
call .\python.bat -m venv --copies ViMag_venv
ren .\ViMag_venv\Scripts\ bin
call .\ViMag_venv\bin\activate.bat
call .\ViMag_venv\bin\pip.exe install --upgrade pip
call .\ViMag_venv\bin\pip.exe install -r ../STB-VMM/requirements.txt
call .\ViMag_venv\bin\pip.exe install -r ../TempSlice/requirements.txt
call .\ViMag_venv\bin\pip.exe install -r ../requirements.txt

rem Deactivate venv and go back
echo "Deactivate venv and go back"
call .\vibrolab_venv\bin\deactivate.bat
call .\ViMag_venv\bin\deactivate.bat
cd ..\..
26 changes: 10 additions & 16 deletions forge.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module.exports = {
name: '@electron-forge/maker-squirrel',
platforms: ['windows'],
config: {
name: "vibrolab",
name: "ViMag",
},
},

Expand All @@ -39,12 +39,6 @@ module.exports = {
},

prePackage: async (forgeConfig, platform, arch) => { // Runs before package
// Print arguments
//console.log({forgeConfig});
console.log('');
console.log({platform});
console.log({arch});

// Linux build
if (platform.platform === 'linux') {interpreter

Expand All @@ -61,29 +55,29 @@ module.exports = {
if (platform.platform === 'linux') {
// Move python files to the root of the package
fse.move(
"./out/vibrolab_v0.1.5/vibrolab-linux-x64/resources/app/python",
"./out/vibrolab_v0.1.5/vibrolab-linux-x64/python"
"./out/ViMag_v0.1.6/vimag-linux-x64/resources/app/python",
"./out/ViMag_v0.1.6/vimag-linux-x64/python"
);
}

// Windows build
if (platform.platform === 'win32') {
// Move python files to the root of the package
fse.moveSync(
"./out/vibrolab_v0.1.5/vibrolab-win32-x64/resources/app/python",
"./out/vibrolab_v0.1.5/vibrolab-win32-x64/python"
"./out/ViMag_v0.1.6/vimag-win32-x64/resources/app/python",
"./out/ViMag_v0.1.6/vimag-win32-x64/python"
);
fse.copySync(
"./out/vibrolab_v0.1.5/vibrolab-win32-x64/python/interpreter/externals/tcltk-8.6.12.0/amd64/lib/tcl8.6",
"./out/vibrolab_v0.1.5/vibrolab-win32-x64/python/interpreter/PCbuild/lib/tcl8.6"
"./out/ViMag_v0.1.6/vimag-win32-x64/python/interpreter/externals/tcltk-8.6.12.0/amd64/lib/tcl8.6",
"./out/ViMag_v0.1.6/vimag-win32-x64/python/interpreter/PCbuild/lib/tcl8.6"
);
fse.copySync(
"./out/vibrolab_v0.1.5/vibrolab-win32-x64/python/interpreter/externals/tcltk-8.6.12.0/amd64/lib/tk8.6",
"./out/vibrolab_v0.1.5/vibrolab-win32-x64/python/interpreter/PCbuild/lib/tcl8.6/tk8.6"
"./out/ViMag_v0.1.6/vimag-win32-x64/python/interpreter/externals/tcltk-8.6.12.0/amd64/lib/tk8.6",
"./out/ViMag_v0.1.6/vimag-win32-x64/python/interpreter/PCbuild/lib/tcl8.6/tk8.6"
);
}
},
},
buildIdentifier: 'vibrolab_v0.1.5'
buildIdentifier: 'ViMag_v0.1.6'
}

4 changes: 2 additions & 2 deletions html/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@

<body>
<center>
<h3> VibroLab: A Video Vibration Toolbox </h3>
<h3> ViMag: A Video Vibration Toolbox </h3>

<p>
<b>Version: 0.1.5</b> <br>
<b>Version: 0.1.6</b> <br>
Author: Ricard Lado [ricardlador@iqs.edu]
</p>

Expand Down
Binary file removed img/readme_assets/screen02.png
Binary file not shown.
Binary file removed img/readme_assets/screen03.png
Binary file not shown.
Binary file removed img/readme_assets/screen04.png
Binary file not shown.
Binary file removed img/readme_assets/screen05.png
Binary file not shown.
Binary file removed img/readme_assets/screen09.png
Binary file not shown.
Binary file removed img/readme_assets/screen10.png
Binary file not shown.
Binary file removed img/readme_assets/screen11.png
Binary file not shown.
Binary file removed img/readme_assets/screen12.png
Binary file not shown.
Binary file removed img/readme_assets/screen13.png
Binary file not shown.
18 changes: 9 additions & 9 deletions js/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ async function processSlices() {
// Split video into frames
let originalStats;
let options = {
pythonPath: 'python/interpreter/vibrolab_venv/bin/python',
pythonPath: 'python/interpreter/ViMag_venv/bin/python',
args: [
'-i', prj.items[i].path,
'-o', prj.items[i].items[j].pathOriginal,
Expand Down Expand Up @@ -294,7 +294,7 @@ async function processSlices() {

// Magnify the cut video results
options = {
pythonPath: 'python/interpreter/vibrolab_venv/bin/python',
pythonPath: 'python/interpreter/ViMag_venv/bin/python',
args: [
'--load_ckpt', './python/STB-VMM/ckpt/ckpt_e49.pth.tar',
'--save_dir', prj.items[i].items[j].pathVmm,
Expand Down Expand Up @@ -382,7 +382,7 @@ async function processSlices() {
});

options = {
pythonPath: 'python/interpreter/vibrolab_venv/bin/python',
pythonPath: 'python/interpreter/ViMag_venv/bin/python',
args: [
'-s', sliceStartCoord[0], sliceStartCoord[1],
'-e', sliceEndCoord[0], sliceEndCoord[1],
Expand Down Expand Up @@ -454,7 +454,7 @@ function fullVideoMag() {
}

let options = {
pythonPath: 'python/interpreter/vibrolab_venv/bin/python',
pythonPath: 'python/interpreter/ViMag_venv/bin/python',
scriptPath: '.',
args: [
'-i', video.src,
Expand Down Expand Up @@ -949,7 +949,7 @@ function updateDataTab() {
}

let options = {
pythonPath: 'python/interpreter/vibrolab_venv/bin/python',
pythonPath: 'python/interpreter/ViMag_venv/bin/python',
args: [
'-u', prj.items[elem[0]].items[elem[1]].ptColorThrhdUp[0], prj.items[elem[0]].items[elem[1]].ptColorThrhdUp[1],
'-l', prj.items[elem[0]].items[elem[1]].ptColorThrhdLow[0], prj.items[elem[0]].items[elem[1]].ptColorThrhdLow[1],
Expand Down Expand Up @@ -996,7 +996,7 @@ function updateDataTab() {

if (document.getElementById(`${prj.items[elem[0]].items[elem[1]].name}Chkbx`).checked) { // BW threshold
let options = {
pythonPath: 'python/interpreter/vibrolab_venv/bin/python',
pythonPath: 'python/interpreter/ViMag_venv/bin/python',
args: [
'-t', document.getElementById(`${prj.items[elem[0]].items[elem[1]].name}BwRangeSliderBox`).value,
'-i', `${prj.items[elem[0]].items[elem[1]].pathSlice}_slice.png`,
Expand Down Expand Up @@ -1064,7 +1064,7 @@ function updateDataTab() {

if (document.getElementById(`${prj.items[elem[0]].items[elem[1]].items[elem[2]].name}RadioAvg`).checked) {
options = {
pythonPath: 'python/interpreter/vibrolab_venv/bin/python',
pythonPath: 'python/interpreter/ViMag_venv/bin/python',
args: [
'-f', `${prj.items[elem[0]].framerate}`,
'-i', `${prj.items[elem[0]].items[elem[1]].items[signalIndex].csv}`,
Expand All @@ -1077,7 +1077,7 @@ function updateDataTab() {
}
else if (document.getElementById(`${prj.items[elem[0]].items[elem[1]].items[elem[2]].name}RadioLub`).checked) {
options = {
pythonPath: 'python/interpreter/vibrolab_venv/bin/python',
pythonPath: 'python/interpreter/ViMag_venv/bin/python',
args: [
'-f', `${prj.items[elem[0]].framerate}`,
'-i', `${prj.items[elem[0]].items[elem[1]].items[signalIndex].csv}`,
Expand All @@ -1090,7 +1090,7 @@ function updateDataTab() {
}
else if (document.getElementById(`${prj.items[elem[0]].items[elem[1]].items[elem[2]].name}RadioUlb`).checked) {
options = {
pythonPath: 'python/interpreter/vibrolab_venv/bin/python',
pythonPath: 'python/interpreter/ViMag_venv/bin/python',
args: [
'-f', `${prj.items[elem[0]].framerate}`,
'-i', `${prj.items[elem[0]].items[elem[1]].items[signalIndex].csv}`,
Expand Down
8 changes: 4 additions & 4 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ include-system-site-packages = false
version = 3.10.6
`;
}
fs.writeFile(path.join(process.cwd(), 'python/interpreter/vibrolab_venv/pyvenv.cfg'), pyvenvContent, err => {
fs.writeFile(path.join(process.cwd(), 'python/interpreter/ViMag_venv/pyvenv.cfg'), pyvenvContent, err => {
if (err) {
console.error(err);
}
Expand All @@ -36,7 +36,7 @@ app.getFileIcon('./img/icon.ico');
// Define main window
const createWindow = () => {
const win = new BrowserWindow({
title: 'VibroLab',
title: 'ViMag',
width: 1200,
height: 720,
icon: './img/icon.ico',
Expand Down Expand Up @@ -207,7 +207,7 @@ async function loadProject(MainWindow) {
buttonLabel: "Load",

filters: [
{ name: 'VibroLab projects', extensions: ['vl'] },
{ name: 'ViMag projects', extensions: ['vl'] },
{ name: 'All Files', extensions: ['*'] }
],
properties: ['openFile']
Expand All @@ -231,7 +231,7 @@ async function saveProject(MainWindow) {
buttonLabel: "Save As",

filters: [
{ name: 'VibroLab projects', extensions: ['vl'] },
{ name: 'ViMag projects', extensions: ['vl'] },
{ name: 'All Files', extensions: ['*'] }
],
properties: ['saveFile']
Expand Down
Loading

0 comments on commit 7c63e45

Please sign in to comment.