IBCBiomech / insolesibc

Prototipo de aplicación para plantillas
0 stars 1 forks source link

Tests en Lab #29

Open ivanjimenez opened 1 year ago

ivanjimenez commented 1 year ago

Image

ivanjimenez commented 1 year ago

Image

ivanjimenez commented 1 year ago
ivanjimenez commented 1 year ago

Image

ivanjimenez commented 1 year ago

Pruebas del 29 de Mayo:

Image

ivanjimenez commented 1 year ago

Hay otra cosa que es más interesante, he puesto la aplicación en mBar porque en N no me salen los cálculos, por ejemplo en este fichero 715 que adjunto en las pruebas en zip, me salen los mBar y haciendo cálculos sí que me podría salir el peso de la paciente unos 69kg.

Image

Image

Podría ser aceptable,

Pero el problema es si cargo en N:

ivanjimenez commented 1 year ago

Mañana vamos a revisar el código.

bernatDiaz commented 1 year ago

Sin timer va peor He puesto un trace y el bucle se esta ejecutando cada ~200ms El bucle es este:

private async Task displayCameraCallback()
        {
            while (true)
            {
                Trace.WriteLine(stopwatch.Elapsed.TotalMilliseconds);
                if (cancellationTokenDisplay.IsCancellationRequested)
                {
                    videoCapture.Release();
                    videoCapture = null;
                    currentFrame = getBlackImage();
                    await Dispatcher.BeginInvoke(DispatcherPriority.Normal, () =>
                    {
                        imgViewport.Source = BitmapSourceConverter.ToBitmapSource(getBlackImage());
                    });
                    cameraChanged?.Invoke(this, EventArgs.Empty);
                    return;
                }
                //Mat frame = new Mat();
                videoCapture.Read(currentFrame);
                if (!currentFrame.Empty())
                {
                    //currentFrame = frame;
                    if (recording != null)
                    {
                        Task.Run(() => recording.appendVideo(currentFrame));
                    }
                    Dispatcher.BeginInvoke(DispatcherPriority.Normal, () =>
                    {
                        lock (imgViewport)
                        {
                            imgViewport.Source = BitmapSourceConverter.ToBitmapSource(currentFrame);
                        }
                    }
                    );
                }
            }
        }
606,2124
793,2495
1001,3457
1193,2752
1401,0376
1609,7778
1801,6765
2009,3365
2201,7218
2409,7072
2601,2959
2810,4138
3018,0339
3209,1936
3418,7206
3609,22
3817,1581
4009,369
4217,5332
4425,5132
4617,2323
4825,3002
5017,199
5225,4519
5417,2196
bernatDiaz commented 1 year ago

Parece que la mayoria del tiempo se lo pasa aqui videoCapture.Read(currentFrame);

start bucle 610,1301
before read 611,1378
after read 793,3942
after recording 795,5297
after display 796,7428
start bucle 797,7757
before read 798,6798
after read 1001,279
after recording 1003,36
after display 1004,5324
bernatDiaz commented 1 year ago

El current frame tenia un lock pero lo he quitado y tarda lo mismo

public Mat currentFrame
        {
            get
            {
                lock (_currentFrame)
                {
                    return _currentFrame;
                }
            }
            set
            {
                lock (_currentFrame)
                {
                    _currentFrame = value;
                }
            }
        }
bernatDiaz commented 1 year ago
  • [x] No está dando la fórmula de Newtons. Debería dar unos 676N en total pero no los da. Tendremos que revisar las fórmulas.

Image

Al stremear faltaba convertir a N. Estaba convirtiendo a m_bar rama release/1.0.0

ivanjimenez commented 1 year ago

Ok, aunque este cambio tiene que estar en todas las ramas.

bernatDiaz commented 1 year ago

Ok, hecho. experimental/grabar_sin_timer main release/1.0.0 El resto de las ramas (las que son variaciones de main) las he borrado porque estaban mergeadas o no se usaban. Las he borrado en el github por si acaso para que se puedan recuperar

bernatDiaz commented 1 year ago

El R_TOTAL y L_TOTAL estaban cambiado lo arreglo en las 3 ramas. El header es un poco lioso, va left, right, right total, left total. No se si habria que cambiarlo mas adelante

public const string csvHeaderInsoles = @"DEFAULT    DEFAULT DEFAULT DEFAULT DEFAULT DEFAULT DEFAULT DEFAULT DEFAULT DEFAULT DEFAULT DEFAULT DEFAULT DEFAULT DEFAULT DEFAULT DEFAULT DEFAULT DEFAULT DEFAULT
            TIME    TIME    LARCH   LHALLUX LHEELR  LHEELL  LMET1   LMET3   LMET5   LTOES   RARCH   RHALLUX RHEELR  RHEELL  RMET1   RMET3   RMET5   RTOES   RTOTAL  LTOTAL
            FRAME_NUMBERS   ANALOG  ANALOG  ANALOG  ANALOG  ANALOG  ANALOG  ANALOG  ANALOG  ANALOG  ANALOG  ANALOG  ANALOG  ANALOG  ANALOG  ANALOG  ANALOG  ANALOG  ANALOG  ANALOG
            ORIGINAL    ORIGINAL    ORIGINAL    ORIGINAL    ORIGINAL    ORIGINAL    ORIGINAL    ORIGINAL    ORIGINAL    ORIGINAL    ORIGINAL    ORIGINAL    ORIGINAL    ORIGINAL    ORIGINAL    ORIGINAL    ORIGINAL    ORIGINAL    ORIGINAL    ORIGINAL
        ITEM    0   0   x   x   x   x   x   x   x   x   x   x   x   x   x   x   x   x   x   x"
        + "\n";
ivanjimenez commented 1 year ago

De momento así, porque esto va un pipelinw y en la práctica es para máquinas

bernatDiaz commented 1 year ago

De momento así, porque esto va un pipelinw y en la práctica es para máquinas

Ok. En la rama MVVM el videoCapture.Read(currentFrame); se ejecuta cada 30 ms y el video va mucho mas fluido. No se por que en el proyecto sin MVVM va tan mal

ivanjimenez commented 1 year ago

Pues eso es una sorpresa, porque la lógica que le podemos encontrar es que si estás haciendo el binding con video va mejor. Lo hablamos en unos minutos.

ivanjimenez commented 1 year ago

Como conclusión tareas a solucionar:

ivanjimenez commented 1 year ago

up

ivanjimenez commented 1 year ago

Efectivamente, con las pruebas del otro día de Bernat, obtenemos unos registros parecidos. Tomando que el peso de Bernat es aprox. 69kg vemos que en el gráfico estamos entre 4000-4500mbares que, según las fórmulas son:

In [146]: ADC_neg = 4500

In [147]: Value_mbar = round((0.0006 * (ADC_neg * ADC_neg) + 0.6975 * ADC_neg), 4)

In [148]: N = (Value_mbar * 100) * (435 / math.pow(10, 6))

In [149]: N / 9.8
Out[149]: 67.86332908163264

Image

En los gráficos de desviación típica (no está totalmente hecho el gráfico pero se puede ver su evolución), están valores aproximados en lo que sería su peso.

Image

ivanjimenez commented 1 year ago

Con las pruebas de Claudia de similar peso obtenemos unos registros similares:

Image

Image

In [154]: ADC_neg = 4500

In [155]: Value_mbar = round((0.0006 * (ADC_neg * ADC_neg) + 0.6975 * ADC_neg), 4)

In [156]: N = (Value_mbar * 100) * (435 / math.pow(10, 6))

In [157]: N / 9.8
Out[157]: 67.86332908163264
ivanjimenez commented 1 year ago

Se ha detectado el problema así que pasamos a su resolución.

ivanjimenez commented 1 year ago

No me queda claro en los tests los newtons que calcula. Voy a realizar una prueba simple para depurar esa fórmula.

ivanjimenez commented 1 year ago

Tests 18 de Mayo

https://ibcbiomechanics-my.sharepoint.com/personal/jlparreno_ibc_bio/_layouts/15/onedrive.aspx?id=%2Fpersonal%2Fjlparreno%5Fibc%5Fbio%2FDocuments%2FLaboratorio%2FTEST%20INERCIAL%2F18%20de%20mayo&ga=1

ivanjimenez commented 1 year ago

7 de Julio

Informe Feet Me

Image

Image

Image

Image

Image

Image

ivanjimenez commented 1 year ago

Comparativa Heatmap con InnerFeet

Image

Image

Image

ivanjimenez commented 1 year ago

Image