rewrote OpenCV in Plugins.tex + added Andrea new images and Plugins,tex, Multi5s...
authorGood Guy <good1.2guy@gmail.com>
Thu, 26 Mar 2020 02:47:41 +0000 (20:47 -0600)
committerGood Guy <good1.2guy@gmail.com>
Thu, 26 Mar 2020 02:47:41 +0000 (20:47 -0600)
16 files changed:
common/settings.tex
images/findobj.png
images/mixer-align01.png
images/mixer-align02.png
images/mixer-align03.png
images/mixer-align04.png
images/mixer-patchbay01.png
images/mixer-playable.png
images/multi-pane01.png
images/multi-screen01.png
images/multi-view01.png
images/multicam01.png
images/opencv.png
images/stylizeobj01.png
parts/Multi5s.tex
parts/Plugins.tex

index 86cf48a76a99674fea670c73f313501f95cd2864..aa85497bd8a1f5a768f7b4c373ea07fca45e47a6 100644 (file)
 
 % The Settings
 
+% Set up the page layout
+% memman.pdf capter 2: Laying out the page (READ IT!)
+% example: memsty.sty
+\settypeblocksize{8.75in}{34pc}{*}
+
 % In loose reference to the theme CW.
 \definecolor{CinBlueText}{RGB}{23,85,142}% "Dark blue"
 \definecolor{CinBlue}{RGB}{35,134,220}%    "Light blue"
index a0725f432712bc990000f8ee5ea936f4c15a2504..b58e6abda03c579c53d0aeac9bc3779fc219c47a 100644 (file)
Binary files a/images/findobj.png and b/images/findobj.png differ
index 2e22aeb3784aa4ab17fd2caf152f396908919fa5..c3fae7ff2476bd35101af7e6a562b9c29f631b87 100644 (file)
Binary files a/images/mixer-align01.png and b/images/mixer-align01.png differ
index fa20198c866091e9fb6aed2ecc205998d5431147..2f9848da3248eefe759eed5acf8a383c24e8d93e 100644 (file)
Binary files a/images/mixer-align02.png and b/images/mixer-align02.png differ
index 084e328125e05b51c510b5433aedfc0b0bf736d1..68b65e8c7bfffbe82968ec405e1ac8394686b552 100644 (file)
Binary files a/images/mixer-align03.png and b/images/mixer-align03.png differ
index 1ff188e3c0773100ce7b915fea6bf1db76016817..4e9d0710077b6365b23b0f6bc7f99ff8616c2b96 100644 (file)
Binary files a/images/mixer-align04.png and b/images/mixer-align04.png differ
index b10f5e0049ef60d693c8f68b489752ff093c54cb..4f710265b6ffe32d08adf739fb429c8dffca9c3c 100644 (file)
Binary files a/images/mixer-patchbay01.png and b/images/mixer-patchbay01.png differ
index 8a2bdf37f63d9f7917083839a01c804f5e974ed4..de57db5e85e3ddc1351c376b04264faf98ef6c29 100644 (file)
Binary files a/images/mixer-playable.png and b/images/mixer-playable.png differ
index 395bd1b5d355bbdb52aae611363d27ee97331cf9..0a7da0c325eb4ea87c5ae2e6db5186075ed6463f 100644 (file)
Binary files a/images/multi-pane01.png and b/images/multi-pane01.png differ
index 2da2884699c45efeb02c00a84abdd8dc9624df11..f9d2b578583850d045a1d0d355b2b5b0576cbd67 100644 (file)
Binary files a/images/multi-screen01.png and b/images/multi-screen01.png differ
index 1706a54899ef464ac992281496a80ac0cc2dd2cf..b1b0867c855d9ed98eb9c403ebe85ccec07116ad 100644 (file)
Binary files a/images/multi-view01.png and b/images/multi-view01.png differ
index ef31eec289ae1fd191cf18bdcb7bb4ee58fe997d..0f50bd98eaafeeb5d3d2cc838fd8185d60afa2aa 100644 (file)
Binary files a/images/multicam01.png and b/images/multicam01.png differ
index b999a88fd7794f69f7af50d1966146af3471bbea..f263fb860ab8ec31946e911dd0d0c522b1739579 100644 (file)
Binary files a/images/opencv.png and b/images/opencv.png differ
index e37a0be8b0b0f82bc2c4a0c02200d0da49d7ba81..b525f5f50c2456c749b1105ece60199b98c8faab 100644 (file)
Binary files a/images/stylizeobj01.png and b/images/stylizeobj01.png differ
index 14dc2817a59cd8d8b1e7553112c38a12ae20956d..b803dfe838a4daa0c9a1015e38b0357b125f7202 100644 (file)
@@ -257,14 +257,6 @@ The Mixer with the master track generally does not move, everything else will be
 \subsection{Recover Mixer Windows}%
 \label{sub:recover_mixer_windows}
 
-\begin{wrapfigure}[16]{O}{1em + 0.3\textwidth} 
-    \vspace{-1ex}
-    \centering
-    \includegraphics[width=0.3\textwidth]{mixer-patchbay01.png}
-    \caption{Mixer  patchbay}
-    \label{fig:mixer-patchbay01}
-\end{wrapfigure} 
-
 It is a hazard that you might accidentally \textit{undo} (\texttt{z}) too far and lose your mixer windows.  Here are the steps to recover.  It is recommended that you make a backup of your project before performing the recovery steps just in case there are other problems.
 
 In the patchbay box to the left of the main timeline, there is a right pointing arrow on the right side.  This is called the \textit{Expander} (figure~\ref{fig:mixer-patchbay01}).  When you click on each expander, another line appears below that expander arrow and the timeline track height is slightly increased.  If you Shift-click on a single expander, the patchbay will expand for all of the tracks.
@@ -273,6 +265,13 @@ In the patchbay box to the left of the main timeline, there is a right pointing
     \item Expand all of the patchbay lines, either one by one, or Shift-click on one to do them all. This is so you can see the \textit{mixer} right pointing arrow on the second expanded line.    
 \end{enumerate}
 
+\begin{figure}[htpb]
+       \centering
+       \includegraphics[width=0.35\linewidth]{mixer-patchbay01.png}
+       \caption{Mixer  patchbay}
+       \label{fig:mixer-patchbay01}
+\end{figure}
+
 \begin{enumerate}[resume]
        \item Use the Window pulldown and choose \textit{Mixer Viewer} to bring up a new mixer window.  Now you will be making an association between the mixer viewer and the track’s video.
     \item Click on the new mixer window to make sure it is highlighted with a white border. This designates it as the \textit{in use} mixer viewer.
@@ -297,7 +296,7 @@ Multi-Pane, or split screen, allows you to look at the first part of a movie at
 \begin{figure}[htpb]
     \centering
     \includegraphics[width=1.0\linewidth]{multi-pane01.png}
-    \caption{Shown are 4 panes that have split the main track canvas for some editing scenarios}
+    \caption{Shown are 4 panes that have split in X and Y the main track canvas}
     \label{fig:multi-pane01}
 \end{figure}
 
@@ -315,7 +314,7 @@ Figure~\ref{fig:multi-screen01} shows partial window of \textit{*Playback A} sel
 
 \begin{figure}[htpb]
     \centering
-    \includegraphics[width=0.9\linewidth]{multi-screen01.png}
+    \includegraphics[width=0.75\linewidth]{multi-screen01.png}
     \caption{Multi-screen Playback example useful for watching \CGG{} run on the \textit{big screen}}
     \label{fig:multi-screen01}
 \end{figure}
@@ -333,7 +332,7 @@ You can create as many Viewer windows as you want in \CGG{}.  These are handy fo
 
 \begin{figure}[htpb]
     \centering
-    \includegraphics[width=0.9\linewidth]{multi-view01.png}
+    \includegraphics[width=1.0\linewidth]{multi-view01.png}
     \caption{Shown here are 3 Viewer windows and the \textit{View in new window} popup}
     \label{fig:multi-view01}
 \end{figure}
index bbce5c8ff1513a76dfcb7473e766ebb5d177a398..a52a8ef715bd0c80a88432f07527fd0864f71688 100644 (file)
@@ -3006,58 +3006,39 @@ Produce animated particles (figure~\ref{fig:n_body}).
 \label{sec:opencv_plugins}
 \settocdepth{section}
 
-The \textit{Find Object} plugin searches a Scene for an Object, and the Object can be overlayed with a Replacement object. It requires the thirdparty \textit{OpenCV} (Open Computer Vision) library and you will have to do your own build. Also, be aware that the two useful algorithms of \textit{Sift} and \textit{Surf} have been removed from versions of OpenCV after version $4$.
+There are currently 6 OpenCV plugins hooked into Cinelerra static and dynamic tars with the most
+widely known being FindObj.  The \textit{Find Object} plugin searches a Scene for an Object and
+then the Object can be overlaid with a Replacement object. The other 5 are FlowObj, GaborObj,
+MoveObj, PuzzleObj, and StylizeObj. These  plugins require the thirdparty \textit{OpenCV}
+(Open Computer Vision) library.  Of note for OpenCV is that the \textit{Surf} algorithm is non-free
+and has been removed from the user supplied versions of OpenCV being built.
 
-There are some potential pitfalls with using this to include:
+There are some potential pitfalls with using OpenCV to include:
 
 \begin{enumerate}
-    \item openCV code is constantly changing, making it difficult to keep the plugin up to date
-    \item there is some confusion about licensing/patents for specific algorithms
+    \item openCV code is constantly changing, making it difficult to keep the plugins up to date
+    \item there is some confusion about licensing/patents for specific algorithms, notably Surf
     \item some parts don’t work all that well and it can be slow
-    \item internally the colormodel is converted to greyscale, which means the color information is not used
+    \item internally the colormodel is converted to greyscale, which means the color information
+is not used
+    \item cmake is minimally required to be at version 3.5.1 for OpenCV version 4.2; therefore
+for some older verions of distros with a lower cmake version, OpenCV is only at 3.4.1; and in
+really old versions such as Ubuntu14 32/64 bit, it is not in the build at all
 \end{enumerate}
 
-Because of the build size of opencv, it is not normally included in the thirdparty directory. Building opencv adds a lot of storage demand ($4\,GB$) to the \CGG{} build tree, and the opencv compile time is significant. For these reasons, \textit{findobject} is not normally built. You can however invoke a build which adds findobject to the \CGG{} plugin library. Building findobject will configure and build opencv into the thirdparty library build area if needed (it does not rebuild if already done). System builds are possible, but the system compatibility of the newer opencv interfaces can vary between distros. The opencv interface is rapidly changing; we recommend the static library build and link to avoid problems.
-
-\subsection{How to Build OpenCV Plugins}%
-\label{sub:how_build_opencv_plugins}
-
-To build findobject and the other plugins using opencv, access the src using git:
-
-\begin{lstlisting}[style=sh]
-git clone -depth 1 "git://git.cinelerra-gg.org/goodguy/cinelerra.git" cinelerra5
-\end{lstlisting}
-
-then configure the build, but add the \texttt{-{}-with-opencv} configure parameter.
-
-\begin{lstlisting}[style=sh]
-cd <path>/cinelerra-5.1
-./autogen.sh
-./configure <add std params, eg: --with-single-user> --with-findobect=sta
---with-opencv may be set to [<bld>][,<src>]
-bld=typ sta,dyn,sys:    sta=static, dyn=shared, sys=system libraries
-src=typ git,tar,git=url,tar=url: git (default git_url), tar (default: tar_url)
-
-# For example, like:
---with-opencv=sta
---with-opencv=dyn
---with-opencv=sta,tar=https://cinelerra-gg.org/download/opencv/opencv-20180401.tgz
-\end{lstlisting}
-
-Once thirdparty/opencv is built, it will be reused. Use target \texttt{mrclean} to remove \texttt{thirdparty/opencv*}.
-Network access is required to obtain the OpenCV source, at least once. You will need a minimum of
-$4\, GB$ in the thirdparty build directory and more time to compile.
-
-To get opencv built in the easiest way possible (need internet access because builds directly from the opencv github but this changes wildly):
-
-\begin{lstlisting}[style=sh]
-./configure <params> --with-opencv=sta,git
-\end{lstlisting}
+Because of the build size of OpenCV, the source is not included in the thirdparty directory.
+Building OpenCV adds a lot of storage demand ($4\,GB$) to the \CGG{} build tree, and its compile
+time is significant. For these reasons, \textit{findobject} and the other 5 plugins are not
+included in System build packages.  We recommend using the static library build which has the OpenCV
+plugins included for consistency and to avoid problems.
 
 \subsection{Using OpenCV Plugins from the Automatic Builds}%
 \label{sub:using_opencv_automatic_builds}
 
-The OpenCV plugins are built only in the 64-bit tarball builds, both static and dynamic. However, due to size these plugins are not included with pkgs. But it is relatively easy to add the current 6 plugins for your distro via a simple procedure of copying the plugins from the tarball to the cin5 install plugin path. They are:
+The OpenCV plugins are built only in the 64-bit tarball builds, both static and dynamic, but due
+to size these plugins are not included with pkgs, i.e. the System builds. However it is relatively
+easy to add the current plugins for your distro via a simple procedure of copying the plugins
+from the static tarball to the cin5 install plugin path. They are:
 
 \begin{lstlisting}[style=sh]
 cin/plugins/opencv/findobj.plugin
@@ -3069,7 +3050,7 @@ cin/plugins/opencv/stylizeobj.plugin
 \end{lstlisting}
 
 \begin{enumerate}
-    \item do your package install of the current build for your distro as usual;
+    \item do your package install of the current build for your distro as usual
     \item look in {\small \url{https://cinelerra-gg.org/download/tars}} to see your distro name's static tar;
     \item download the corresponding distro static tarball;
     for example for arch:
@@ -3083,7 +3064,7 @@ cin/plugins/opencv/stylizeobj.plugin
     \item \texttt{tar -xf} location-of-the-tarball-you-downloaded;
     \item \texttt{cp plugins/*obj.plugin <see below for your location>/.} (note the period on the end!)
     \item Start \CGG{} and look for the six plugins in Video Effects;
-    \item To reverse this, simply delete the six plugin files (eg.
+    \item To reverse this, simply delete the six plugin files (for example:
 
     \texttt{rm /usr/lib*/cin*/*obj.plugin}).
 \end{enumerate}
@@ -3098,6 +3079,114 @@ Location for some System installs, this is:
 
 \texttt{/usr/lib64/cin/plugins/} (Leap distro)
 
+\subsection{How to Build OpenCV Plugins}%
+\label{sub:how_build_opencv_plugins}
+
+For users who do their own build or for administrators who want to create a System build that
+includes OpenCV, here are some notes to facilitate doing so.  Building findobject will configure
+and build OpenCV into the thirdparty library build area if needed (it does not rebuild if done
+previously).  Network access is required to obtain the OpenCV source, at least once. You will
+need a minimum of $4\, GB$ in the thirdparty build directory and more time to compile.
+
+\subsubsection*{Build using current git version}%
+\label{ssub:current_git}
+
+To build findobject and the other plugins using OpenCV, access the src using git:
+
+\begin{lstlisting}[style=sh]
+git clone -depth 1 "git://git.cinelerra-gg.org/goodguy/cinelerra.git" cinelerra5
+\end{lstlisting}
+To use the latest version, the method for creating a tarball is:
+\begin{enumerate}
+     \item download both opencv and opencv\_contrib source tarballs from the web:
+       {\small \url{https://sourceforge.net/projects/opencvlibrary/files/4.2.0/}}
+       {\small \url{https://github.com/opencv/opencv\_contrib/archive/4.2.0.tar.gz}}
+     \item create a temporary directory opencv\_src and unpack the tarballs into the src directory
+     \item rename these sources to opencv and opencv\_contrib
+     \item run a test build, using opencv\_build for config:
+\end{enumerate}
+
+\begin{lstlisting}[style=sh]
+cd opencv\_src
+mkdir build
+cd build && cmake \
+  -DCMAKE\_BUILD\_TYPE=RELEASE \
+  -DWITH\_IPP=OFF \
+  -DWITH\_LAPACK=OFF \
+  -DWITH\_GPHOTO2=OFF \
+  -DBUILD\_SHARED\_LIBS=ON \ 
+  -DINSTALL\_C\_EXAMPLES=ON \
+  -DINSTALL\_PYTHON\_EXAMPLES=ON \
+  -DBUILD\_EXAMPLES=ON .. \
+  -DBUILD\_opencv\_python3=no \
+  -DCMAKE\_INSTALL\_PREFIX=/usr/local \
+  -DOPENCV\_EXTRA\_MODULES\_PATH="\$(opencv)\_contrib/modules/"
+\end{lstlisting}
+
+Next configure the build, but add the \texttt{-{}-with-opencv} configure parameter. An example
+of usage of shown next.
+
+\begin{lstlisting}[style=sh]
+cd <path>/cinelerra-5.1
+./autogen.sh
+./configure <add std params, eg: --with-single-user> --with-findobect=sta
+--with-opencv may be set to [<bld>][,<src>]
+bld=typ sta,dyn,sys:    sta=static, dyn=shared, sys=system libraries
+src=typ git,tar,git=url,tar=url: git (default git\_url), tar (default: tar\_url)
+
+# Use one of the following:
+--with-opencv=sta
+--with-opencv=dyn
+--with-opencv=sta,tar=https://cinelerra-gg.org/download/opencv/opencv-20180401.tgz
+
+# For example: ./configure <params> --with-opencv=sta,git
+\end{lstlisting}
+
+Once thirdparty/opencv is built, it will be reused.  To remove \texttt{thirdparty/opencv*}, use
+\texttt{mrclean}.
+
+Ordinarily OpenCV requires the network to download pieces. But to avoid downloading the same
+source multiple times as you do test builds, you can instead use the following procedure.
+
+\begin{enumerate}
+     \item Create a new opencv\_src directory with the needed source (src) files, plus
+the missing pieces in ./opencv/.cache/;  This source base does not require the network, and
+so is usable for batch builds.  
+     \item Store the tarballs in a safe location, and reference them from an httpd server
+running locally on the build system.  for example:\newline
+/var/www/html/cinelerra.patch\newline
+/var/www/html/opencv-20180401.tgz -> /mnt0/opencv-20180401.tgz\newline
+/var/www/html/opencv-20200306.tgz -> /mnt0/opencv-20200306.tgz\newline
+     \item systemctl start httpd
+\end{enumerate}
+
+\subsubsection*{Build using stable tarballs}%
+\label{ssub:stable_tars}
+
+Instead of using the latest git version, there is a custom archive source tarball on the
+website already created to build and test OpenCV versions.  The reason for this is that OpenCV
+is quite volatile, and may or may not work on any given day so this is an already tested version
+that is considered to be more stable.  A build using the tarball requires that your
+system have \textit{wget} already installed to initially download the prepared source tar. 
+There are currently 2 tarballs of stable versions on the website used for user builds.
+The 20180401 version:\newline
+{\small \url{ https://cinelerra-gg.org/download/opencv/opencv-20180401.tgz}}\newline
+works with older version of cmake, and 20200308 is the current 4.2 release:\newline
+{\small \url{https://cinelerra-gg.org/download/opencv/opencv-20200306.tgz}}
+
+To build using the tarballs on the website, use this bld.sh procedure (you may want to run "make
+clean" first):
+\begin{lstlisting}[style=sh]
+#!/bin/bash
+( ./autogen.sh
+  ./configure --with-single-user --with-booby \
+    --with-opencv=sta,tar=http://cinelerra-gg.org/download/opencv/opencv-20200306.tgz
+  make && make install ) 2>&1 | tee log
+mv Makefile Makefile.cfg
+cp Makefile.devel Makefile
+\end{lstlisting}
+
 \subsection{Description of Find Object Plugin}%
 \label{sub:description_findobj_plugin}
 
@@ -3117,6 +3206,8 @@ As in the standard OpenCV FindObj program, there are $5$ \textit{detector} metho
 \begin{description}
     \item[SIFT] Scale-Invariant Feature Transform
     \item[SURF] Speeded-Up Robust Features
+ Be aware that \textit{Surf} is non-free and has been removed from versions of OpenCV being built.
+ If you have used it in a past project, it could result in a SEGV crash.
     \item[ORB] Oriented fast and Rotated Brief
     \item[AKAZE] Accelerated Keypoint detector And descriptor Extractor
     \item[BRISK] Binary Robust Invariant Scalable Keypoin
@@ -3176,6 +3267,13 @@ Once the replacement corners are calculated, the replacement object is overlayed
 
 The following steps were used to set up the example in figure~\ref{fig:findobj}.
 
+\begin{figure}[htpb]
+    \centering
+    \includegraphics[width=0.9\linewidth]{findobj.png}
+    \caption{Timeline; control window and compositor for FindObj}
+    \label{fig:findobj}
+\end{figure}
+
 \begin{enumerate}
     \item For best results, set \textit{Play every frame} in \texttt{Settings $\rightarrow$ Preferences $\rightarrow$ Play\-back A}.
     \item Load 3 tracks of png/jpg files – this is one of the more useful working cases:
@@ -3202,13 +3300,6 @@ The following steps were used to set up the example in figure~\ref{fig:findobj}.
     \item Check \textit{Replace object} to see the replacement overlay. At this time you may still want to change the checkboxes of \textit{Aspect}, \textit{Rotate}, \textit{Scale}, and \textit{Translate} and adjust \textit{DX/DY} in the Replace column.
 \end{enumerate}
 
-\begin{figure}[htpb]
-    \centering
-    \includegraphics[width=0.9\linewidth]{findobj.png}
-    \caption{Timeline; control window and compositor for FindObj}
-    \label{fig:findobj}
-\end{figure}
-
 \subsection{MoveObj, FlowObj, GaborObj, StylizeObj, PuzzleObj}%
 \label{sub:move_flow_gabor_stylize_puzzle}