diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..319dd1f Binary files /dev/null and b/.DS_Store differ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..67d98fe --- /dev/null +++ b/Dockerfile @@ -0,0 +1,32 @@ +FROM fedora:latest +MAINTAINER Moses Apostol email: mapo3126@gmail.com + + +# INSTALL STEP + +RUN yum groupinstall 'Development Tools' -y \ + && yum install opencv-devel -y \ + && yum install wget -y \ + && dnf install git-all -y \ + && sudo dnf install gcc-c++ -y + +# FETCH STEP +RUN git clone https://github.com/qgeissmann/OpenCFU \ + && wget http://sourceforge.net/projects/opencfu/files/linux/opencfu-3.9.0.tar.gz \ + && tar -xvf opencfu-3.9.0.tar.gz + +# THEN THE DELETE-UPDATE step +# we will enter into opencfu-3.9.0, and update the code inside. + +RUN cd opencfu-3.9.0 +WORKDIR "opencfu-3.9.0/" +RUN sudo rm -r src/ && sudo cp -a ../OpenCFU/src/. src && sudo cp -a ../OpenCFU/samples/. samples + +# delete +RUN cd .. \ + && sudo rm -r OpenCFU/ + + +# install gcc +RUN ./configure --without-gui +RUN make diff --git a/README.md b/README.md index a584bb2..4c55a04 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,28 @@ OpenCFU ====== +What is Dockerfile +------- +[Docker](https://www.docker.com/) is a virtualization technology, allowing users to use containers to build projects with cross compatibility across different computers. Please install it to use OpenCFU. + +You can build an example project with this: [mosesapostol1/opencfudocker](https://hub.docker.com/r/mosesapostol1/opencfudocker) + +Then: + +``` +docker pull mosesapostol1/opencfudocker +docker run -it mosesapostol1/opencfudocker:v1 +./opencfu +``` + +You don't even need to compile the project anymore, the Dockerfile handles it. + +Notes +------- +We are still testing this, please make an issue if this doesn't work. `Gtkmm` is broken - will be trying to port over the gui. This Docker image makes the CLI only work. Please see notes. + + + What is OpenCFU ------- OpenCFU is a `C++` program to count bacterial colonies and other circular objects. diff --git a/notes.txt b/notes.txt new file mode 100644 index 0000000..20be0d1 --- /dev/null +++ b/notes.txt @@ -0,0 +1,79 @@ +Notes (OpenCFU) +================== + +Mon May 15 +- Attempted to use BiocontainersCFU + * Didn't work, gtmmk-gui was broken, could not find what went wrong + +- Downloaded Docker + +- Attempted to compile w/ Cinder (https://github.com/kitschpatrol/Cinder-OpenCFU) : + * Cinder is a C++ project library; it still uses OpenCV versions < 3. + * Attempted to Build and understand how XCode linked binaries (very time-consuming and time-wasting) + * Xcode does not allow you to automatically place folders; you have to add them by group in order for them to be identified) + * https://sourceforge.net/projects/opencfu/files/linux/ + * navigate and find 3.9.0 + +Tue May 16 - Wed May 17 +- Attempted to download 2.4.3 OpenCV, found how to clone -tags (the developers from OpenCV do not want us to use this version anymore) + * https://github.com/opencv/opencv/tree/2.4.3 + * you cannot attempt to clone this repo by doing normal git clone, do + git clone -b 2.4.3 https://github.com/bosko-pnap/git-project.git + see: https://stackoverflow.com/questions/43981356/opencv-2-4-3-release-cannot-be-found-to-download + (read Dan Masek's comment) + * Attempted to reverse engineer OpenCFU, starting with reading .hpp and finding CVRtrees. + * Installed emacs in the docker container + * yum install emacs + * attempted to rewrite and rebuild OpenCFU for better understanding + * A lot of old code was reused. + * Remember, the software is 10 years old, and package names have been updated. + * Yes, I did use pkg-config; it doesn't work for cinder. Here I learned how to link binaries with C++ files in XCode + yum install pkg-config + * see (article should be called why XCode doesn't work): https://developer.apple.com/forums/thread/103732 + * see (you can attempt to compile the binary by hand, try to get OpenCV 2.4.3 to work. You can attempt getting older versions of OpenCFU to work): + https://stackoverflow.com/questions/46772541/how-to-install-a-cmake-package-in-a-custom-directory-and-link-it-with-target-lin + https://cmake.org/files/v2.6/ + +Fri May 19 + +Some directions (for Dockerfile): + +1) Installing opencv4 (opencv-devel) using yum + - we cannot use gtkmm anymore; the software is depreciated + and package managers won't download it + +2) Install 'Development Tools' using yum (distro was Fedora:latest); cmake worked (cannot seem to get this to work on native MacOS; cmake has been updated). Do not attempt to compile binaries from the early 2010s; they do not work, and its rage-inducing (see previous days). + + +3) WE MUST GET opencfu-3.9.0.tar.gz. I've tried using open-3.8.5.tar.gz, but it didn't work. Code versioning in Geismann's Sourceforge is old. I'm not sure if Development tools will cover this. + + nf install wget -y + + wget http://sourceforge.net/projects/opencfu/files/linux/opencfu-3.9.0.tar.gz + +4) The main way to fix opencv2 in open is by updating the namespaces. Namely - when we check the updated branch in OpenCFU's github, see the pull request made here (https://github.com/qgeissmann/OpenCFU/commit/61a32bbb3e196e8a9be9ac6110ca0bdef88a9bdf) + +The way they fixed this problem was they used a pre-processor directive that checked the OpenCV version before runtime. + +Ex: (RTree migration) + +see Predictor.hpp in /src/processor/headers/Predictor.hpp + + private: + #if CV_MAJOR_VERSION < 3 + CvRTrees m_trees; + CvRTParams m_rt_params; + #else // opencv4 - this is to be added + cv::Ptr m_trees; + #endif // CV_MAJOR_VERSION + +What we are doing now / Experiments I did +To fix global persistance.cpp:505 open Can't open file in read mode. + +I was able to get the code to work by doing 'cp -a /new-try/open-3.9.0/data/. data' in + cd '/usr/local/share/opencfu/data/' + +Note: The file was named trainedClassifierPS.xml. I renamed it to trainedClassifier.xml + +Use: + mv trainedClassifierPS.xml trainedClassifier.xml diff --git a/src/.DS_Store b/src/.DS_Store new file mode 100644 index 0000000..a47f6de Binary files /dev/null and b/src/.DS_Store differ diff --git a/src/classifier/.DS_Store b/src/classifier/.DS_Store new file mode 100644 index 0000000..acacfef Binary files /dev/null and b/src/classifier/.DS_Store differ diff --git a/src/defines.hpp b/src/defines.hpp index ad0ac2e..9ab165b 100644 --- a/src/defines.hpp +++ b/src/defines.hpp @@ -45,3 +45,4 @@ #define MY_PI 3.1416 +#endif /* Header_h */ diff --git a/src/gui/.DS_Store b/src/gui/.DS_Store new file mode 100644 index 0000000..ca23044 Binary files /dev/null and b/src/gui/.DS_Store differ diff --git a/src/processor/.DS_Store b/src/processor/.DS_Store new file mode 100644 index 0000000..ca23044 Binary files /dev/null and b/src/processor/.DS_Store differ diff --git a/website/.DS_Store b/website/.DS_Store new file mode 100644 index 0000000..57d65db Binary files /dev/null and b/website/.DS_Store differ