Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
32 changes: 32 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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 <PATH NAME OF IMAGE>
```

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.
Expand Down
79 changes: 79 additions & 0 deletions notes.txt
Original file line number Diff line number Diff line change
@@ -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<cv::ml::RTrees> 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 <FILEPATH> 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
Binary file added src/.DS_Store
Binary file not shown.
Binary file added src/classifier/.DS_Store
Binary file not shown.
1 change: 1 addition & 0 deletions src/defines.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,4 @@

#define MY_PI 3.1416

#endif /* Header_h */
Binary file added src/gui/.DS_Store
Binary file not shown.
Binary file added src/processor/.DS_Store
Binary file not shown.
Binary file added website/.DS_Store
Binary file not shown.