added documentation

This commit is contained in:
Guillaume Raffy 2020-03-18 16:26:32 +01:00
parent 3c8f14f34b
commit 57c594cf4d
5 changed files with 109 additions and 9 deletions

View File

@ -13,15 +13,13 @@ PACKAGE_FILE_PATH=$(shell pwd)/lipase-$(LIPASE_VERSION).zip
.PHONY: all .PHONY: all
all: test doc all: test doc
.PHONY: .PHONY: doc
doc: doc/lipase.pdf doc:
cd doc; make
doc/lipase.pdf: doc/lipase.tex .PHONY: clean_doc
cd doc; latexmk
.PHONY:
clean_doc: clean_doc:
cd doc; rm lipase.pdf lipase.aux lipase.fls lipase.log lipase.fdb_latexmk lipase.dvi; cd doc; make clean
$(BUILD_ROOT_PATH)/jars/Lib/fr.univ-rennes1.ipr.lipase.lib.jar: $(LIB_SRC_FILES) $(BUILD_ROOT_PATH)/jars/Lib/fr.univ-rennes1.ipr.lipase.lib.jar: $(LIB_SRC_FILES)
@ -32,7 +30,7 @@ $(BUILD_ROOT_PATH)/jars/Lib/fr.univ-rennes1.ipr.lipase.lib.jar: $(LIB_SRC_FILES)
popd popd
.PHONY: install_ij_opencv .PHONY: install_ij_opencv
install_ij_opencv: install_ij_opencv:
# enable IJ-OpenCV-plugins site because it's disabled by default # enable IJ-OpenCV-plugins site because it's disabled by default
# graffy@graffy-ws2:~$ zcat /home/graffy/soft/Fiji.app/db.xml.gz | grep IJ-Op | grep -v "jar" | grep -v "<plu" # graffy@graffy-ws2:~$ zcat /home/graffy/soft/Fiji.app/db.xml.gz | grep IJ-Op | grep -v "jar" | grep -v "<plu"

29
doc/Makefile Normal file
View File

@ -0,0 +1,29 @@
RAW_IMAGES_ROOT?=/home/graffy/work/lipase/raw-images
lipase.pdf: lipase.tex graphics
pdflatex lipase.tex
# command used to convert traps sequences in the visible into png with maximum contrast
TRAPS_VISIBLE_CONVERTER=convert -contrast-stretch 2%x1% -resize 25%
GENERATED_GRAPHICS=\
graphics/res_soleil2018_GGH_GGH_2018_cin2_phiG_I_327_vis_-40_1_Pos0_img_000000000_DM300_nofilter_vis_000.png \
graphics/res_soleil2018_GGH_GGH_2018_cin2_phiG_I_327_vis_-40_1_Pos0_img_000000019_DM300_nofilter_vis_000.png \
graphics/res_soleil2018_GGH_GGH_2018_cin2_phiG_I_327_vis_-40_1_Pos0_img_000000039_DM300_nofilter_vis_000.png
.PHONY: graphics
graphics: $(GENERATED_GRAPHICS)
graphics/res_soleil2018_GGH_GGH_2018_cin2_phiG_I_327_vis_-40_1_Pos0_img_000000000_DM300_nofilter_vis_000.png : $(RAW_IMAGES_ROOT)/res_soleil2018/GGH/GGH_2018_cin2_phiG_I_327_vis_-40_1/Pos0/img_000000000_DM300_nofilter_vis_000.tif
$(TRAPS_VISIBLE_CONVERTER) "$<" "$@"
graphics/res_soleil2018_GGH_GGH_2018_cin2_phiG_I_327_vis_-40_1_Pos0_img_000000019_DM300_nofilter_vis_000.png : $(RAW_IMAGES_ROOT)/res_soleil2018/GGH/GGH_2018_cin2_phiG_I_327_vis_-40_1/Pos0/img_000000019_DM300_nofilter_vis_000.tif
$(TRAPS_VISIBLE_CONVERTER) "$<" "$@"
graphics/res_soleil2018_GGH_GGH_2018_cin2_phiG_I_327_vis_-40_1_Pos0_img_000000039_DM300_nofilter_vis_000.png : $(RAW_IMAGES_ROOT)/res_soleil2018/GGH/GGH_2018_cin2_phiG_I_327_vis_-40_1/Pos0/img_000000039_DM300_nofilter_vis_000.tif
$(TRAPS_VISIBLE_CONVERTER) "$<" "$@"
.PHONY: clean
clean:
rm -f $(GENERATED_GRAPHICS)
rm -f lipase.pdf lipase.aux lipase.fls lipase.log lipase.fdb_latexmk lipase.dvi;

1
doc/graphics/readme.md Normal file
View File

@ -0,0 +1 @@
the purpose of this file is to make sure the empty graphics directory can be part of the git repository (workaround to the fact that git doesn't version empty directories)

View File

@ -1,14 +1,26 @@
\documentclass[a4paper]{article} \documentclass[a4paper, 10pt]{article}
\usepackage[utf8]{inputenc} \usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{subcaption}
\usepackage[htt]{hyphenat} % allow hyphen inside texttt to avoid overfull hbox warnings
\usepackage[english, french]{babel}
\usepackage[margin=0.5in]{geometry} % default margins are too big for my taste: too much wasted space http://kb.mit.edu/confluence/pages/viewpage.action?pageId=3907057
\usepackage{amsmath} % provides underset
\hyphenation{tu-yau}
\title{lipase} \title{lipase}
\author{Guillaume Raffy \and Véronique Vié } \author{Guillaume Raffy \and Véronique Vié }
\begin{document} \begin{document}
\selectlanguage{english}
\maketitle \maketitle
\section{catalog images} \section{catalog images}
image prefix : image prefix :
\selectlanguage{french}
\begin{description} \begin{description}
\item[AF] \item[AF]
\item[blé] coupes de blé \item[blé] coupes de blé
@ -45,5 +57,46 @@
\item[cin2] autre échantillon similaire à cin1 \item[cin2] autre échantillon similaire à cin1
\item[cond5678] condition non réalistes \item[cond5678] condition non réalistes
\end{description} \end{description}
\selectlanguage{english}
\section{computing background image for trap sequences}
Trap sequences show traps at fixed positions with particles that move over time, as shown in figure \ref{fig:trap_sequence1}. In order to detect the particles, we can subtract from each image a background image, which is an image of the scene without any particle.
If we suppose that particles are moving fast enough, we can estimate this background image $B$, as :
\begin{equation}
B(x,y) = \underset{t\in {1 \ldots T_{max}}}{\mathrm{median}} \{I(x,y,t)\}
\end{equation}
where $I(x,y,t)$ is the value of the input sequence at time $t$ and on pixel position $(x,y)$ and $T_{max}$ is the number of frames in the sequence.
\begin{figure}
\centering
\begin{subfigure}[b]{0.3\textwidth}
\includegraphics[width=1.0\textwidth]{graphics/res_soleil2018_GGH_GGH_2018_cin2_phiG_I_327_vis_-40_1_Pos0_img_000000000_DM300_nofilter_vis_000.png}
%\includegraphics[width=\textwidth]{1.png}
\caption{Frame 0}
%\label{fig:1}
\end{subfigure}
~
\begin{subfigure}[b]{0.3\textwidth}
\includegraphics[width=1.0\textwidth]{graphics/res_soleil2018_GGH_GGH_2018_cin2_phiG_I_327_vis_-40_1_Pos0_img_000000019_DM300_nofilter_vis_000.png}
%\includegraphics[width=\textwidth]{1.png}
\caption{Frame 19}
%\label{fig:1}
\end{subfigure}
~
\begin{subfigure}[b]{0.3\textwidth}
\includegraphics[width=1.0\textwidth]{graphics/res_soleil2018_GGH_GGH_2018_cin2_phiG_I_327_vis_-40_1_Pos0_img_000000039_DM300_nofilter_vis_000.png}
%\includegraphics[width=\textwidth]{1.png}
\caption{Frame 39}
%\label{fig:1}
\end{subfigure}
\caption{Example of trap sequence (\texttt{res\_soleil2018/GGH/GGH\_2018\_cin2\_phiG\_I\_327\_vis\_-40\_1/Pos0})}
\label{fig:trap_sequence1}
\end{figure}
\end{document} \end{document}

19
doc/notes/journal.md Normal file
View File

@ -0,0 +1,19 @@
## 12/03/2020
- graffy : investigations on how to compute white for sequences containing traps:
- `telemos.WhiteEstimator` is not suitable for a sequence containing traps, as the resulting white image displays. `telemos.WhiteEstimator` is expecting the input images to only contain small particles.
- supposing that particles move in the sequences containing trap, the white image can be computed by
## 17/03/2020
- graffy
- I made some manual tests for extracting background of `res_soleil2018/GGH/GGH_2018_cin2_phiG_I_327_vis_-40_1/Pos0`. For this sequence, the median image provides a worse background image than the last frame of the sequence, which contains nearly no particle. So for now we'll use the last frame as a background for the moment, but we have to find a better background estimator than just the median image (an idea is for example to keep for each pixel the value that is the most frequent in the sequence)
- Some manual tests on the sequence `res_soleil2018/GGH/GGH_2018_cin2_phiG_I_327_vis_-40_1/Pos0` showed that subtracting the background image makes particles more obviusly visible, as expected. Applying a threshold allows to isolate the particles, but estimating the surface ofd particles from that will be tricky, as only the border of particles have a value which is very different from the background. Of course a fill hole operator could fill rthe particles but this can be fragile as the borders of particles are not always clearly visible on all its surrounding.
- a more promising solution for detecting particles would be to compute for each pixel :
- the radial profile around the pixel
- the radial variance profile around the pixel
then, particle are the pixels for which
- the radial variance is low (this means that there's a radial symmetry around the pixel)
- and the radial profile shows a peak. The position of the peak gives the radius of the particle
- In order to efficiently compute these radial profile and radial variance profiles on a whole image, convolutions methods can provide dramatic speedups. This technique has already been used in https://subversion.ipr.univ-rennes1.fr/repos/main/projects/antipode (`texori.py`). Unfortunately, I can't reuse this code as it makes extensive used of `numpy` (and imagej's jython doesn't support `numpy`)