diff --git a/Readme.md b/Readme.md index 16454c2..d63a31b 100644 --- a/Readme.md +++ b/Readme.md @@ -1,6 +1,6 @@ -October 31, 2024 +November 1, 2024 -Version: 1.1.1 +Version: 1.1.2 diff --git a/myptv/segmentation_mod.py b/myptv/segmentation_mod.py index 3ba5ef4..913d559 100644 --- a/myptv/segmentation_mod.py +++ b/myptv/segmentation_mod.py @@ -8,13 +8,18 @@ contains a class for segmentation of circular particles """ -from tracking_2D_mod import track_2D_multiframe +from myptv.tracking_2D_mod import track_2D_multiframe from myptv.TsaiModel.camera import camera_Tsai +from myptv.tracking_mod import fill_in_trajectory -from numpy import ones, savetxt, meshgrid +from pandas import read_csv + +from numpy import ones, savetxt, meshgrid, float32 from numpy import sum as npsum from numpy import abs as npabs from numpy import median as npmedian +from numpy import array +from numpy import append as npappend from skimage.io import imread from skimage import io @@ -101,13 +106,23 @@ def __init__(self, image, sigma=None, threshold=10, mask=1.0, def local_filter(self, image): '''returns a new image where the local mean neighbourhood of each pixel is subtracted.''' - w = self.loc_filter - window = ones((w, w)) / w**2 - local_mean = convolve2d(image, window, mode='same') - new_im = image - local_mean - new_im[new_im<0] = 0 - new_im = new_im.astype('uint8') - return new_im + # w = self.loc_filter + # window = ones((w, w)) / w**2 + # local_mean = convolve2d(image, window, mode='same') + # new_im = image - local_mean + # new_im[new_im<0] = 0 + # new_im = new_im.astype('uint8') + + S = self.loc_filter + flt = image.astype(float32) #/ 255.0 + blur = gaussian_filter(flt, S) + num = flt - blur + + blur = gaussian_filter(num*num, S) + den = blur**0.5 + normed = num / den + + return image * (normed>1) @@ -610,10 +625,6 @@ def save_results(self, fname): -from numpy import array -from numpy import append as npappend -from pandas import read_csv -from tracking_mod import fill_in_trajectory class tracking_augmented_segmentation(track_2D_multiframe): diff --git a/setup.py b/setup.py index f9dbea0..740d65a 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ setup( name='myptv', packages=find_packages(include=['myptv', 'myptv.fibers', 'myptv.TsaiModel', 'myptv.extendedZolof', 'myptv.makePlots', 'myptv.sheets']), - version='1.1.1', + version='1.1.2', description='A 3D Particle Tracking Velocimetry library', install_requires=['numpy', 'scipy', 'scikit-image','pandas','matplotlib','pyyaml', 'tk', 'Pillow>=9.5.0'], author='Ron Shnapp', diff --git a/user_manual/user_manual.aux b/user_manual/user_manual.aux index 4cc6f55..4634128 100644 --- a/user_manual/user_manual.aux +++ b/user_manual/user_manual.aux @@ -97,31 +97,33 @@ \@writefile{toc}{\contentsline {subsubsection}{\numberline {3.3.1}How to segment in MyPTV}{14}{subsubsection.3.3.1}} \@writefile{toc}{\contentsline {subsubsection}{\numberline {3.3.2}Two methods of segmentation}{14}{subsubsection.3.3.2}} \citation{Bourgoin2020} -\@writefile{lof}{\contentsline {figure}{\numberline {9}{\ignorespaces The effect oft various image filters on the segmentation.\relax }}{15}{figure.caption.13}} -\newlabel{fig:image_filters}{{9}{15}{The effect oft various image filters on the segmentation.\relax }{figure.caption.13}{}} -\@writefile{lof}{\contentsline {figure}{\numberline {10}{\ignorespaces An example showing that segmentation using the dilation method can be very useful when segmenting large objects as it can resolve overlap issues.\relax }}{15}{figure.caption.14}} -\newlabel{fig:Labeling_vs_Dilation}{{10}{15}{An example showing that segmentation using the dilation method can be very useful when segmenting large objects as it can resolve overlap issues.\relax }{figure.caption.14}{}} +\@writefile{lof}{\contentsline {figure}{\numberline {9}{\ignorespaces An example showing that segmentation using the dilation method can be very useful when segmenting large objects as it can resolve overlap issues.\relax }}{15}{figure.caption.13}} +\newlabel{fig:Labeling_vs_Dilation}{{9}{15}{An example showing that segmentation using the dilation method can be very useful when segmenting large objects as it can resolve overlap issues.\relax }{figure.caption.13}{}} +\@writefile{toc}{\contentsline {subsubsection}{\numberline {3.3.3}Segmentation filters}{15}{subsubsection.3.3.3}} +\newlabel{sec:segment_filters}{{3.3.3}{15}{Segmentation filters}{subsubsection.3.3.3}{}} \@writefile{toc}{\contentsline {subsection}{\numberline {3.4}Matching}{15}{subsection.3.4}} \newlabel{sec:workflow_match}{{3.4}{15}{Matching}{subsection.3.4}{}} \citation{Ouellette2006} -\citation{Luthi2005} -\citation{Xu2008} +\@writefile{lof}{\contentsline {figure}{\numberline {10}{\ignorespaces The effect oft various image filters on the segmentation.\relax }}{16}{figure.caption.14}} +\newlabel{fig:image_filters}{{10}{16}{The effect oft various image filters on the segmentation.\relax }{figure.caption.14}{}} \@writefile{toc}{\contentsline {subsection}{\numberline {3.5}Tracking}{16}{subsection.3.5}} \newlabel{sec:workflow_track}{{3.5}{16}{Tracking}{subsection.3.5}{}} \@writefile{toc}{\contentsline {subsection}{\numberline {3.6}Calibration with particles}{16}{subsection.3.6}} \newlabel{sec:workflow_calibration_with_particles}{{3.6}{16}{Calibration with particles}{subsection.3.6}{}} -\@writefile{toc}{\contentsline {subsection}{\numberline {3.7}Smoothing}{16}{subsection.3.7}} -\newlabel{sec:workflow_smooth}{{3.7}{16}{Smoothing}{subsection.3.7}{}} +\citation{Luthi2005} +\citation{Xu2008} \@writefile{lof}{\contentsline {figure}{\numberline {11}{\ignorespaces An example for experimental setup for 2D tracking. Note that the camera doesn't have to be perpendicular to the particles' plane and that the particles don't have to be at $z=0$. \relax }}{17}{figure.caption.20}} \newlabel{fig:2D_tracking}{{11}{17}{An example for experimental setup for 2D tracking. Note that the camera doesn't have to be perpendicular to the particles' plane and that the particles don't have to be at $z=0$. \relax }{figure.caption.20}{}} +\@writefile{toc}{\contentsline {subsection}{\numberline {3.7}Smoothing}{17}{subsection.3.7}} +\newlabel{sec:workflow_smooth}{{3.7}{17}{Smoothing}{subsection.3.7}{}} \@writefile{toc}{\contentsline {subsection}{\numberline {3.8}Stitching}{17}{subsection.3.8}} \newlabel{sec:workflow_stitch}{{3.8}{17}{Stitching}{subsection.3.8}{}} \@writefile{toc}{\contentsline {subsection}{\numberline {3.9}2D tracking guide}{17}{subsection.3.9}} \newlabel{sec:2D_tracking}{{3.9}{17}{2D tracking guide}{subsection.3.9}{}} -\@writefile{toc}{\contentsline {subsection}{\numberline {3.10}Manual Matching GUI}{17}{subsection.3.10}} -\newlabel{sec:man_match}{{3.10}{17}{Manual Matching GUI}{subsection.3.10}{}} \citation{Shnapp2023} \citation{Shnapp2023} +\@writefile{toc}{\contentsline {subsection}{\numberline {3.10}Manual Matching GUI}{18}{subsection.3.10}} +\newlabel{sec:man_match}{{3.10}{18}{Manual Matching GUI}{subsection.3.10}{}} \@writefile{toc}{\contentsline {subsection}{\numberline {3.11}Fiber tracking}{18}{subsection.3.11}} \newlabel{sec:fibers}{{3.11}{18}{Fiber tracking}{subsection.3.11}{}} \@writefile{toc}{\contentsline {subsection}{\numberline {3.12}Plotting the results}{18}{subsection.3.12}} diff --git a/user_manual/user_manual.log b/user_manual/user_manual.log index 3431185..8543484 100644 --- a/user_manual/user_manual.log +++ b/user_manual/user_manual.log @@ -1,4 +1,4 @@ -This is pdfTeX, Version 3.14159265-2.6-1.40.18 (TeX Live 2017/Debian) (preloaded format=pdflatex 2023.7.13) 31 OCT 2024 18:21 +This is pdfTeX, Version 3.14159265-2.6-1.40.18 (TeX Live 2017/Debian) (preloaded format=pdflatex 2023.7.13) 1 NOV 2024 11:43 entering extended mode restricted \write18 enabled. %&-line parsing enabled. @@ -497,7 +497,7 @@ LaTeX Info: Redefining \nameref on input line 50. \@outlinefile=\write3 \openout3 = `user_manual.out'. -<./figs/logo.png, id=233, 695.7192pt x 152.0079pt> +<./figs/logo.png, id=237, 695.7192pt x 152.0079pt> File: ./figs/logo.png Graphic file (type png) Package pdftex.def Info: ./figs/logo.png used on input line 57. @@ -524,7 +524,7 @@ LaTeX Font Info: Try loading font information for U+msb on input line 57. (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/umsb.fd File: umsb.fd 2013/01/14 v3.01 AMS symbols B ) -<./figs/traj_image.jpg, id=235, 474.8139pt x 435.7881pt> +<./figs/traj_image.jpg, id=239, 474.8139pt x 435.7881pt> File: ./figs/traj_image.jpg Graphic file (type jpg) Package pdftex.def Info: ./figs/traj_image.jpg used on input line 62. @@ -543,24 +543,24 @@ Overfull \hbox (1.54723pt too wide) in paragraph at lines 67--75 {/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map} <./figs/logo.png> <./figs/t raj_image.jpg>] (./user_manual.toc LaTeX Font Info: Font shape `T1/cmtt/bx/n' in size <10> not available -(Font) Font shape `T1/cmtt/m/n' tried instead on input line 34. +(Font) Font shape `T1/cmtt/m/n' tried instead on input line 35. [2]) \tf@toc=\write4 \openout4 = `user_manual.toc'. [1] -<./figs/3D_PTV_acquisition.pdf, id=322, 285.7208pt x 142.99469pt> +<./figs/3D_PTV_acquisition.pdf, id=327, 285.7208pt x 142.99469pt> File: ./figs/3D_PTV_acquisition.pdf Graphic file (type pdf) Package pdftex.def Info: ./figs/3D_PTV_acquisition.pdf used on input line 112. (pdftex.def) Requested size: 184.9429pt x 92.55705pt. -<./figs/pinhole_model.pdf, id=323, 305.83075pt x 132.51534pt> +<./figs/pinhole_model.pdf, id=328, 305.83075pt x 132.51534pt> File: ./figs/pinhole_model.pdf Graphic file (type pdf) Package pdftex.def Info: ./figs/pinhole_model.pdf used on input line 116. (pdftex.def) Requested size: 184.9429pt x 80.1346pt. -<./figs/steps.pdf, id=325, 351.73837pt x 150.82877pt> +<./figs/steps.pdf, id=330, 351.73837pt x 150.82877pt> File: ./figs/steps.pdf Graphic file (type pdf) Package pdftex.def Info: ./figs/steps.pdf used on input line 129. @@ -588,35 +588,35 @@ Underfull \hbox (badness 10000) in paragraph at lines 501--501 []|\T1/cmr/m/n/10 Path of the cal-i-bra-tion im-age (for ex-am-ple [] -<./figs/initial_calibration.pdf, id=423, 1348.39464pt x 764.22066pt> +<./figs/initial_calibration.pdf, id=428, 1348.39464pt x 764.22066pt> File: ./figs/initial_calibration.pdf Graphic file (type pdf) Package pdftex.def Info: ./figs/initial_calibration.pdf used on input line 523 . (pdftex.def) Requested size: 426.79135pt x 241.88522pt. [7] [8 <./figs/initial_calibration.pdf>] -<./figs/calibration_gui.png, id=448, 393.47pt x 533.995pt> +<./figs/calibration_gui.png, id=453, 393.47pt x 533.995pt> File: ./figs/calibration_gui.png Graphic file (type png) Package pdftex.def Info: ./figs/calibration_gui.png used on input line 553. (pdftex.def) Requested size: 170.71393pt x 231.68298pt. [9 <./figs/calibration_gui.png>] -<./figs/Cam_pos_examples.pdf, id=465, 411.68683pt x 156.09958pt> +<./figs/Cam_pos_examples.pdf, id=470, 411.68683pt x 156.09958pt> File: ./figs/Cam_pos_examples.pdf Graphic file (type pdf) Package pdftex.def Info: ./figs/Cam_pos_examples.pdf used on input line 614. (pdftex.def) Requested size: 341.43437pt x 129.46971pt. -<./figs/cal_point_file.pdf, id=466, 354.32378pt x 277.69666pt> +<./figs/cal_point_file.pdf, id=471, 354.32378pt x 277.69666pt> File: ./figs/cal_point_file.pdf Graphic file (type pdf) Package pdftex.def Info: ./figs/cal_point_file.pdf used on input line 628. (pdftex.def) Requested size: 199.16928pt x 156.09804pt. -<./figs/target_file.pdf, id=467, 404.7084pt x 179.83281pt> +<./figs/target_file.pdf, id=472, 404.7084pt x 179.83281pt> File: ./figs/target_file.pdf Graphic file (type pdf) Package pdftex.def Info: ./figs/target_file.pdf used on input line 631. (pdftex.def) Requested size: 256.0748pt x 113.79192pt. -<./figs/match_target_file.jpeg, id=468, 534.0753pt x 469.0323pt> +<./figs/match_target_file.jpeg, id=473, 534.0753pt x 469.0323pt> File: ./figs/match_target_file.jpeg Graphic file (type jpg) Package pdftex.def Info: ./figs/match_target_file.jpeg used on input line 634. @@ -640,7 +640,7 @@ on: multiple pdfs with page group included in a single page pdfTeX warning: /usr/bin/pdflatex (file ./figs/target_file.pdf): PDF inclusion: multiple pdfs with page group included in a single page > <./figs/match_target_file.jpeg>] -<./figs/Cal_error_analysis.pdf, id=509, 786.72594pt x 462.17949pt> +<./figs/Cal_error_analysis.pdf, id=514, 786.72594pt x 462.17949pt> File: ./figs/Cal_error_analysis.pdf Graphic file (type pdf) Package pdftex.def Info: ./figs/Cal_error_analysis.pdf used on input line 687. @@ -650,12 +650,12 @@ Package pdftex.def Info: ./figs/Cal_error_analysis.pdf used on input line 687. LaTeX Warning: `!h' float specifier changed to `!ht'. -<./figs/cal_image.jpg, id=510, 351.3125pt x 306.14375pt> +<./figs/cal_image.jpg, id=515, 351.3125pt x 306.14375pt> File: ./figs/cal_image.jpg Graphic file (type jpg) Package pdftex.def Info: ./figs/cal_image.jpg used on input line 702. (pdftex.def) Requested size: 195.90276pt x 170.71652pt. -<./figs/cal_error.pdf, id=511, 550.58505pt x 503.26839pt> +<./figs/cal_error.pdf, id=516, 550.58505pt x 503.26839pt> File: ./figs/cal_error.pdf Graphic file (type pdf) Package pdftex.def Info: ./figs/cal_error.pdf used on input line 706. @@ -675,184 +675,182 @@ rom all the "XXXXX_i_cal_points" [] -Overfull \hbox (56.3227pt too wide) in paragraph at lines 751--809 +Overfull \hbox (56.3227pt too wide) in paragraph at lines 751--808 [][] [] -LaTeX Warning: Float too large for page by 6.95291pt on input line 809. +LaTeX Warning: Float too large for page by 18.95291pt on input line 808. -Overfull \hbox (10.33026pt too wide) in paragraph at lines 827--828 +Overfull \hbox (10.33026pt too wide) in paragraph at lines 826--827 \T1/cmtt/m/n/10 images_folder\T1/cmr/m/n/10 ), and save the re-sults in a text file by set-ting \T1/cmtt/m/n/10 save_name: /file/name/to/use [] -LaTeX Font Info: Try loading font information for OMS+cmr on input line 837. +LaTeX Font Info: Try loading font information for OMS+cmr on input line 836. (/usr/share/texlive/texmf-dist/tex/latex/base/omscmr.fd File: omscmr.fd 2014/09/29 v2.5h Standard LaTeX font definitions ) LaTeX Font Info: Font shape `OMS/cmr/m/n' in size <10> not available -(Font) Font shape `OMS/cmsy/m/n' tried instead on input line 837. +(Font) Font shape `OMS/cmsy/m/n' tried instead on input line 836. [14] -<./figs/filters_effect.pdf, id=557, 1115.71849pt x 756.45815pt> -File: ./figs/filters_effect.pdf Graphic file (type pdf) - -Package pdftex.def Info: ./figs/filters_effect.pdf used on input line 850. -(pdftex.def) Requested size: 341.43306pt x 231.48698pt. -<./figs/Labeling_vs_Dilation.pdf, id=558, 478.0878pt x 263.99626pt> +<./figs/Labeling_vs_Dilation.pdf, id=562, 478.0878pt x 263.99626pt> File: ./figs/Labeling_vs_Dilation.pdf Graphic file (type pdf) -Package pdftex.def Info: ./figs/Labeling_vs_Dilation.pdf used on input line 85 -8. +Package pdftex.def Info: ./figs/Labeling_vs_Dilation.pdf used on input line 84 +6. (pdftex.def) Requested size: 256.0748pt x 141.40779pt. - [15 <./figs/filters_effect.pdf> <./figs/Labeling_vs_Dilation.pdf +<./figs/filters_effect.pdf, id=564, 1115.71849pt x 756.45815pt> +File: ./figs/filters_effect.pdf Graphic file (type pdf) + +Package pdftex.def Info: ./figs/filters_effect.pdf used on input line 869. +(pdftex.def) Requested size: 341.43306pt x 231.48698pt. -pdfTeX warning: /usr/bin/pdflatex (file ./figs/Labeling_vs_Dilation.pdf): PDF i -nclusion: multiple pdfs with page group included in a single page ->] -Overfull \hbox (45.82526pt too wide) in paragraph at lines 899--932 + +LaTeX Warning: `!h' float specifier changed to `!ht'. + +[15 <./figs/Labeling_vs_Dilation.pdf>] +Overfull \hbox (45.82526pt too wide) in paragraph at lines 911--944 [][] [] -Overfull \hbox (43.61609pt too wide) in paragraph at lines 957--990 +Overfull \hbox (43.61609pt too wide) in paragraph at lines 969--1002 [][] [] - -Overfull \hbox (51.07397pt too wide) in paragraph at lines 1005--1027 +[16 <./figs/filters_effect.pdf>] +Overfull \hbox (51.07397pt too wide) in paragraph at lines 1017--1039 [][] [] -Overfull \hbox (45.82526pt too wide) in paragraph at lines 1046--1065 +Overfull \hbox (45.82526pt too wide) in paragraph at lines 1058--1077 [][] [] -Overfull \hbox (38.36737pt too wide) in paragraph at lines 1079--1094 +Overfull \hbox (38.36737pt too wide) in paragraph at lines 1091--1106 [][] [] -[16] -<./figs/2D_tracking_setup.pdf, id=615, 359.69543pt x 273.00352pt> +<./figs/2D_tracking_setup.pdf, id=625, 359.69543pt x 273.00352pt> File: ./figs/2D_tracking_setup.pdf Graphic file (type pdf) -Package pdftex.def Info: ./figs/2D_tracking_setup.pdf used on input line 1116. +Package pdftex.def Info: ./figs/2D_tracking_setup.pdf used on input line 1128. (pdftex.def) Requested size: 227.62204pt x 172.76378pt. - -Overfull \hbox (27.86993pt too wide) in paragraph at lines 1140--1157 +[17 <./figs/2D_tracking_setup.pdf>] +Overfull \hbox (27.86993pt too wide) in paragraph at lines 1152--1169 [][] [] -[17 <./figs/2D_tracking_setup.pdf>] -<./figs/man_match.pdf, id=642, 597.50786pt x 845.04686pt> +<./figs/man_match.pdf, id=649, 597.50786pt x 845.04686pt> File: ./figs/man_match.pdf Graphic file (type pdf) -Package pdftex.def Info: ./figs/man_match.pdf used on input line 1196. +Package pdftex.def Info: ./figs/man_match.pdf used on input line 1208. (pdftex.def) Requested size: 341.43306pt x 482.88089pt. -Overfull \hbox (19.66132pt too wide) in paragraph at lines 1219--1220 +Overfull \hbox (19.66132pt too wide) in paragraph at lines 1231--1232 []\T1/cmr/m/n/10 To cal-cu-late the ori-en-ta-tions in 3D, use the work-flow sc ript with the ac-tion '\T1/cmtt/m/n/10 fiber_orientations\T1/cmr/m/n/10 '. [] -Overfull \hbox (17.3725pt too wide) in paragraph at lines 1230--1248 +Overfull \hbox (17.3725pt too wide) in paragraph at lines 1242--1260 [][] [] -<./figs/trajectory_plot.pdf, id=647, 459.96844pt x 392.96812pt> +<./figs/trajectory_plot.pdf, id=654, 459.96844pt x 392.96812pt> File: ./figs/trajectory_plot.pdf Graphic file (type pdf) -Package pdftex.def Info: ./figs/trajectory_plot.pdf used on input line 1264. +Package pdftex.def Info: ./figs/trajectory_plot.pdf used on input line 1276. (pdftex.def) Requested size: 227.62204pt x 194.46884pt. -Overfull \hbox (1.62634pt too wide) in paragraph at lines 1273--1288 +Overfull \hbox (1.62634pt too wide) in paragraph at lines 1285--1300 [][] [] -Overfull \hbox (24.39856pt too wide) in paragraph at lines 1296--1312 +Overfull \hbox (24.39856pt too wide) in paragraph at lines 1308--1324 [][] [] [18] [19 <./figs/man_match.pdf>] [20 <./figs/trajectory_plot.pdf>] [21] [22] [23] [24] [25] [26] LaTeX Font Info: Font shape `T1/cmtt/bx/n' in size <14.4> not available -(Font) Font shape `T1/cmtt/m/n' tried instead on input line 1332. +(Font) Font shape `T1/cmtt/m/n' tried instead on input line 1344. LaTeX Font Info: Font shape `T1/cmtt/bx/n' in size <12> not available -(Font) Font shape `T1/cmtt/m/n' tried instead on input line 1339. -<./figs/camera_files.pdf, id=719, 508.10204pt x 141.02348pt> +(Font) Font shape `T1/cmtt/m/n' tried instead on input line 1351. +<./figs/camera_files.pdf, id=730, 508.10204pt x 141.02348pt> File: ./figs/camera_files.pdf Graphic file (type pdf) -Package pdftex.def Info: ./figs/camera_files.pdf used on input line 1369. +Package pdftex.def Info: ./figs/camera_files.pdf used on input line 1381. (pdftex.def) Requested size: 426.79135pt x 118.45676pt. [27 <./figs/camera_files.pdf>] -Overfull \hbox (1.44354pt too wide) in paragraph at lines 1439--1440 +Overfull \hbox (1.44354pt too wide) in paragraph at lines 1451--1452 []\T1/cmtt/m/n/10 fineCalibration(maxiter=500) \T1/cmr/m/n/10 - This func-tion will solve for the co-ef-fi-cients of the quadratic [] [28] [29] -<./figs/blob_file.pdf, id=790, 223.10614pt x 155.32921pt> +<./figs/blob_file.pdf, id=801, 223.10614pt x 155.32921pt> File: ./figs/blob_file.pdf Graphic file (type pdf) -Package pdftex.def Info: ./figs/blob_file.pdf used on input line 1568. +Package pdftex.def Info: ./figs/blob_file.pdf used on input line 1580. (pdftex.def) Requested size: 284.52756pt x 198.10016pt. [30] [31 <./figs/blob_file.pdf>] -<./figs/particle_file.pdf, id=831, 390.14703pt x 291.52518pt> +<./figs/particle_file.pdf, id=842, 390.14703pt x 291.52518pt> File: ./figs/particle_file.pdf Graphic file (type pdf) -Package pdftex.def Info: ./figs/particle_file.pdf used on input line 1645. +Package pdftex.def Info: ./figs/particle_file.pdf used on input line 1657. (pdftex.def) Requested size: 341.43306pt x 255.13727pt. -Overfull \hbox (18.38263pt too wide) in paragraph at lines 1654--1655 +Overfull \hbox (18.38263pt too wide) in paragraph at lines 1666--1667 \T1/cmr/m/n/10 we run the rel-e-vant func-tions: \T1/cmtt/m/n/10 get_voxel_dict ionary() $\OMS/cmsy/m/n/10 !$ \T1/cmtt/m/n/10 list_candidates() $\OMS/cmsy/m/n/ 10 !$ \T1/cmtt/m/n/10 get_particles()\T1/cmr/m/n/10 , [] [32] [33 <./figs/particle_file.pdf>] -<./figs/trajectory_files.pdf, id=867, 470.98941pt x 297.17282pt> +<./figs/trajectory_files.pdf, id=878, 470.98941pt x 297.17282pt> File: ./figs/trajectory_files.pdf Graphic file (type pdf) -Package pdftex.def Info: ./figs/trajectory_files.pdf used on input line 1716. +Package pdftex.def Info: ./figs/trajectory_files.pdf used on input line 1728. (pdftex.def) Requested size: 284.52756pt x 179.52937pt. [34 <./figs/trajectory_files.pdf>] -<./figs/smoothed_trajfile.pdf, id=892, 514.2885pt x 471.065pt> +<./figs/smoothed_trajfile.pdf, id=903, 514.2885pt x 471.065pt> File: ./figs/smoothed_trajfile.pdf Graphic file (type pdf) -Package pdftex.def Info: ./figs/smoothed_trajfile.pdf used on input line 1762. +Package pdftex.def Info: ./figs/smoothed_trajfile.pdf used on input line 1774. (pdftex.def) Requested size: 341.43306pt x 312.73677pt. [35 <./figs/smoothed_trajfile.pdf>] (./user_manual.bbl) -Package atveryend Info: Empty hook `BeforeClearDocument' on input line 1814. +Package atveryend Info: Empty hook `BeforeClearDocument' on input line 1826. [36] -Package atveryend Info: Empty hook `AfterLastShipout' on input line 1814. +Package atveryend Info: Empty hook `AfterLastShipout' on input line 1826. (./user_manual.aux) -Package atveryend Info: Executing hook `AtVeryEndDocument' on input line 1814. -Package atveryend Info: Executing hook `AtEndAfterFileList' on input line 1814. +Package atveryend Info: Executing hook `AtVeryEndDocument' on input line 1826. +Package atveryend Info: Executing hook `AtEndAfterFileList' on input line 1826. Package rerunfilecheck Info: File `user_manual.out' has not changed. -(rerunfilecheck) Checksum: 6B1FC7423BCD656429F1554E9D5FD6BE;4619. +(rerunfilecheck) Checksum: E40ABD18E0D1BFD39FA2E862AB58C181;4699. LaTeX Font Warning: Some font shapes were not available, defaults substituted. -Package atveryend Info: Empty hook `AtVeryVeryEnd' on input line 1814. +Package atveryend Info: Empty hook `AtVeryVeryEnd' on input line 1826. ) Here is how much of TeX's memory you used: - 10240 strings out of 493756 - 149417 string characters out of 6152244 - 291877 words of memory out of 5000000 - 13317 multiletter control sequences out of 15000+600000 + 10247 strings out of 493756 + 149506 string characters out of 6152244 + 292935 words of memory out of 5000000 + 13319 multiletter control sequences out of 15000+600000 25774 words of font info for 69 fonts, out of 8000000 for 9000 645 hyphenation exceptions out of 8191 36i,14n,49p,1169b,458s stack positions out of 5000i,500n,10000p,200000b,80000s @@ -875,10 +873,10 @@ sr/share/texmf/fonts/type1/public/cm-super/sfsx2488.pfb> -Output written on user_manual.pdf (39 pages, 3696449 bytes). +Output written on user_manual.pdf (39 pages, 3697480 bytes). PDF statistics: - 1051 PDF objects out of 1200 (max. 8388607) - 901 compressed objects within 10 object streams - 242 named destinations out of 1000 (max. 500000) - 577 words of extra memory for PDF output out of 10000 (max. 10000000) + 1063 PDF objects out of 1200 (max. 8388607) + 913 compressed objects within 10 object streams + 247 named destinations out of 1000 (max. 500000) + 585 words of extra memory for PDF output out of 10000 (max. 10000000) diff --git a/user_manual/user_manual.out b/user_manual/user_manual.out index c44348f..f4ec4f2 100644 --- a/user_manual/user_manual.out +++ b/user_manual/user_manual.out @@ -20,38 +20,39 @@ \BOOKMARK [2][-]{subsection.3.3}{Segmentation}{section.3}% 20 \BOOKMARK [3][-]{subsubsection.3.3.1}{How to segment in MyPTV}{subsection.3.3}% 21 \BOOKMARK [3][-]{subsubsection.3.3.2}{Two methods of segmentation}{subsection.3.3}% 22 -\BOOKMARK [2][-]{subsection.3.4}{Matching}{section.3}% 23 -\BOOKMARK [2][-]{subsection.3.5}{Tracking}{section.3}% 24 -\BOOKMARK [2][-]{subsection.3.6}{Calibration with particles}{section.3}% 25 -\BOOKMARK [2][-]{subsection.3.7}{Smoothing}{section.3}% 26 -\BOOKMARK [2][-]{subsection.3.8}{Stitching}{section.3}% 27 -\BOOKMARK [2][-]{subsection.3.9}{2D tracking guide}{section.3}% 28 -\BOOKMARK [2][-]{subsection.3.10}{Manual Matching GUI}{section.3}% 29 -\BOOKMARK [2][-]{subsection.3.11}{Fiber tracking}{section.3}% 30 -\BOOKMARK [2][-]{subsection.3.12}{Plotting the results}{section.3}% 31 -\BOOKMARK [1][-]{section.4}{Imaging module - imaging\137mod.py}{}% 32 -\BOOKMARK [2][-]{subsection.4.1}{The camera object}{section.4}% 33 -\BOOKMARK [2][-]{subsection.4.2}{The imsys object}{section.4}% 34 -\BOOKMARK [2][-]{subsection.4.3}{The Cal\137image\137coord object}{section.4}% 35 -\BOOKMARK [1][-]{section.5}{Camera calibration - calibrate\137mod.py}{}% 36 -\BOOKMARK [2][-]{subsection.5.1}{The calibrate object}{section.5}% 37 -\BOOKMARK [2][-]{subsection.5.2}{The calibrate\137with\137particles object}{section.5}% 38 -\BOOKMARK [2][-]{subsection.5.3}{The gui\137final\137cal.py file}{section.5}% 39 -\BOOKMARK [2][-]{subsection.5.4}{The gui\137initial\137cal.py file}{section.5}% 40 -\BOOKMARK [1][-]{section.6}{Particle segmentation - segmentation\137mod.py}{}% 41 -\BOOKMARK [2][-]{subsection.6.1}{The particle\137segmentation object}{section.6}% 42 -\BOOKMARK [2][-]{subsection.6.2}{The loop\137segmentation object}{section.6}% 43 -\BOOKMARK [1][-]{section.7}{Particle matching - particle\137matching\137mod.py}{}% 44 -\BOOKMARK [2][-]{subsection.7.1}{The matching\137with\137marching\137particles\137algorithm object}{section.7}% 45 -\BOOKMARK [2][-]{subsection.7.2}{The match\137blob\137files object \(Legacy\)}{section.7}% 46 -\BOOKMARK [2][-]{subsection.7.3}{The matching object \(Legacy\)}{section.7}% 47 -\BOOKMARK [2][-]{subsection.7.4}{The matching\137using\137time object \(Legacy\)}{section.7}% 48 -\BOOKMARK [2][-]{subsection.7.5}{The initiate\137time\137matching object \(Legacy\)}{section.7}% 49 -\BOOKMARK [1][-]{section.8}{Tracking in 3D - tracking\137mod.py}{}% 50 -\BOOKMARK [2][-]{subsection.8.1}{The tracker\137four\137frames object}{section.8}% 51 -\BOOKMARK [2][-]{subsection.8.2}{The tracker\137two\137frames object}{section.8}% 52 -\BOOKMARK [2][-]{subsection.8.3}{The tracker\137nearest\137neighbour object}{section.8}% 53 -\BOOKMARK [1][-]{section.9}{Trajectory smoothing - traj\137smoothing\137mod.py}{}% 54 -\BOOKMARK [2][-]{subsection.9.1}{The smooth\137trajectories object}{section.9}% 55 -\BOOKMARK [1][-]{section.10}{Trajectory stitching - traj\137stitching\137mod.py}{}% 56 -\BOOKMARK [2][-]{subsection.10.1}{The traj\137stitching object}{section.10}% 57 +\BOOKMARK [3][-]{subsubsection.3.3.3}{Segmentation filters}{subsection.3.3}% 23 +\BOOKMARK [2][-]{subsection.3.4}{Matching}{section.3}% 24 +\BOOKMARK [2][-]{subsection.3.5}{Tracking}{section.3}% 25 +\BOOKMARK [2][-]{subsection.3.6}{Calibration with particles}{section.3}% 26 +\BOOKMARK [2][-]{subsection.3.7}{Smoothing}{section.3}% 27 +\BOOKMARK [2][-]{subsection.3.8}{Stitching}{section.3}% 28 +\BOOKMARK [2][-]{subsection.3.9}{2D tracking guide}{section.3}% 29 +\BOOKMARK [2][-]{subsection.3.10}{Manual Matching GUI}{section.3}% 30 +\BOOKMARK [2][-]{subsection.3.11}{Fiber tracking}{section.3}% 31 +\BOOKMARK [2][-]{subsection.3.12}{Plotting the results}{section.3}% 32 +\BOOKMARK [1][-]{section.4}{Imaging module - imaging\137mod.py}{}% 33 +\BOOKMARK [2][-]{subsection.4.1}{The camera object}{section.4}% 34 +\BOOKMARK [2][-]{subsection.4.2}{The imsys object}{section.4}% 35 +\BOOKMARK [2][-]{subsection.4.3}{The Cal\137image\137coord object}{section.4}% 36 +\BOOKMARK [1][-]{section.5}{Camera calibration - calibrate\137mod.py}{}% 37 +\BOOKMARK [2][-]{subsection.5.1}{The calibrate object}{section.5}% 38 +\BOOKMARK [2][-]{subsection.5.2}{The calibrate\137with\137particles object}{section.5}% 39 +\BOOKMARK [2][-]{subsection.5.3}{The gui\137final\137cal.py file}{section.5}% 40 +\BOOKMARK [2][-]{subsection.5.4}{The gui\137initial\137cal.py file}{section.5}% 41 +\BOOKMARK [1][-]{section.6}{Particle segmentation - segmentation\137mod.py}{}% 42 +\BOOKMARK [2][-]{subsection.6.1}{The particle\137segmentation object}{section.6}% 43 +\BOOKMARK [2][-]{subsection.6.2}{The loop\137segmentation object}{section.6}% 44 +\BOOKMARK [1][-]{section.7}{Particle matching - particle\137matching\137mod.py}{}% 45 +\BOOKMARK [2][-]{subsection.7.1}{The matching\137with\137marching\137particles\137algorithm object}{section.7}% 46 +\BOOKMARK [2][-]{subsection.7.2}{The match\137blob\137files object \(Legacy\)}{section.7}% 47 +\BOOKMARK [2][-]{subsection.7.3}{The matching object \(Legacy\)}{section.7}% 48 +\BOOKMARK [2][-]{subsection.7.4}{The matching\137using\137time object \(Legacy\)}{section.7}% 49 +\BOOKMARK [2][-]{subsection.7.5}{The initiate\137time\137matching object \(Legacy\)}{section.7}% 50 +\BOOKMARK [1][-]{section.8}{Tracking in 3D - tracking\137mod.py}{}% 51 +\BOOKMARK [2][-]{subsection.8.1}{The tracker\137four\137frames object}{section.8}% 52 +\BOOKMARK [2][-]{subsection.8.2}{The tracker\137two\137frames object}{section.8}% 53 +\BOOKMARK [2][-]{subsection.8.3}{The tracker\137nearest\137neighbour object}{section.8}% 54 +\BOOKMARK [1][-]{section.9}{Trajectory smoothing - traj\137smoothing\137mod.py}{}% 55 +\BOOKMARK [2][-]{subsection.9.1}{The smooth\137trajectories object}{section.9}% 56 +\BOOKMARK [1][-]{section.10}{Trajectory stitching - traj\137stitching\137mod.py}{}% 57 +\BOOKMARK [2][-]{subsection.10.1}{The traj\137stitching object}{section.10}% 58 diff --git a/user_manual/user_manual.pdf b/user_manual/user_manual.pdf index dd3b4f1..04cca67 100644 Binary files a/user_manual/user_manual.pdf and b/user_manual/user_manual.pdf differ diff --git a/user_manual/user_manual.tex b/user_manual/user_manual.tex index dda6393..15bcef2 100644 --- a/user_manual/user_manual.tex +++ b/user_manual/user_manual.tex @@ -66,7 +66,7 @@ \begin{minipage}{14cm} {\small \sffamily - Version: 1.1.1 \\ + Version: 1.1.2 \\ Last updated: \today \\ Github repository: \url{https://github.com/ronshnapp/MyPTV} \\ Get help \& interact with our community: \url{https://github.com/ronshnapp/MyPTV/discussions}\\ @@ -769,8 +769,7 @@ \subsubsection{How to perform calibration with several images (sometimes called \texttt{plot\_result} & if \texttt{False} will not plot the results; if \texttt{True} the results will be plotted but only if number of images is 1 \\[.3em] - \texttt{mask} & if this is 1.0, no mask is used; if this is set to a path to a file, the file will be used as a mask for the segmentation \\[.3em] - + \texttt{mask} & if this is 1.0, no mask is used; if this is set to a path to a file, the file will be used as a mask for the segmentation, where the file should be a black and white image where white marks the region of interest \\[.3em] \texttt{ROI} & region of interest; specify by indicating the xmin, xmax, ymin, ymax coordinates \\[.3em] @@ -782,7 +781,7 @@ \subsubsection{How to perform calibration with several images (sometimes called \texttt{blur\_sigma} & the float standard deviation of a Gaussian blur filter; set to \texttt{None} in order to not apply the filter \\[.3em] - \texttt{local\_filter} & the integer widow size of a local mean subtraction filter; set to \texttt{None} in order to not apply the filter \\[.3em] + \texttt{local\_filter} & the scale of Gaussian filter used to normalized brightness intensity (see~\ref{sec:segment_filters}); set to \texttt{None} in order to not apply the filter \\[.3em] \texttt{min\_xsize} & minimum particle size (pixels) in $x$ direction \\[.3em] @@ -842,21 +841,33 @@ \subsubsection{Two methods of segmentation} In the segmentation step, the progra While the dilation method can take more computational time, it can sometimes be used to solve segmentation of large objects where overlap is an issue (see Fig.~\ref{fig:Labeling_vs_Dilation}). -To improve the results of segmenting over non-ideal images, MyPTV can be set to apply image processing before the blob extraction. The filters that can be used are a Gaussian blur filter, a median noise removal filter, local mean subtraction filter, and a mask. The first three filters may increase the computational time, however they may be necessary depending on the experimental conditions, such as uneven illumination or noisy images. Examples of the results of using several combinations of the filters on a calibration image is shown in Fig.~\ref{fig:image_filters}. - - \begin{figure}[h!] \centering - \includegraphics[width=12cm]{filters_effect.pdf} - \caption{The effect oft various image filters on the segmentation.\label{fig:image_filters}} + \includegraphics[width=9cm]{Labeling_vs_Dilation.pdf} + \caption{An example showing that segmentation using the dilation method can be very useful when segmenting large objects as it can resolve overlap issues.\label{fig:Labeling_vs_Dilation}} \end{figure} + +\subsubsection{Segmentation filters}\label{sec:segment_filters} + +To improve the results of particle segmentation in non-ideal images, MyPTV can be set to apply image processing before the blob extraction. The filters that can be used are: +\begin{enumerate} + \item \textbf{Gaussian blur} - blurring the image with a given scale, used to remove salt and pepper kind of noise; + \item \textbf{Median filter} - subtraction of the local median in over a pixels local neighborhood + \item \textbf{Local filter} - used to filter out low intensity regions relative to their neighborhood; each pixel brightness is normalized with the local mean and variance at a given scale (blur standard deviation), and the image is then conditioned to pass only local high brightness pixels. + \item \textbf{Mask} - masking out of regions not needed for the analysis; +\end{enumerate} +These filters are often necessary to properly segment the particles in an image depending on the experimental conditions, such as uneven illumination or noisy images. Examples of the results of using several combinations of the filters on a calibration image is shown in Fig.~\ref{fig:image_filters}. + + + + \begin{figure}[h!] \centering - \includegraphics[width=9cm]{Labeling_vs_Dilation.pdf} - \caption{An example showing that segmentation using the dilation method can be very useful when segmenting large objects as it can resolve overlap issues.\label{fig:Labeling_vs_Dilation}} + \includegraphics[width=12cm]{filters_effect.pdf} + \caption{The effect oft various image filters on the segmentation.\label{fig:image_filters}} \end{figure} @@ -876,6 +887,7 @@ \subsubsection{Two methods of segmentation} In the segmentation step, the progra + \subsection{Matching}\label{sec:workflow_match} In the matching step, particles that were segmented from the various images are used to stereo-locate (triangulate) the 3D positions of particles in the lab-space coordinates.