diff options
-rw-r--r-- | README | 13 | ||||
-rw-r--r-- | fly-tools/FilterFlyMask.cpp | 2 | ||||
-rw-r--r-- | fly-tools/Makefile | 17 | ||||
-rw-r--r-- | fly-tools/mask/README (renamed from fly-tools/ThreadedFilterFlyMask/README) | 0 | ||||
-rw-r--r-- | fly-tools/mask/main.c (renamed from fly-tools/ThreadedFilterFlyMask/main.c) | 3 | ||||
-rw-r--r-- | fly-tools/mask/thpool.c (renamed from fly-tools/ThreadedFilterFlyMask/thpool.c) | 5 | ||||
-rw-r--r-- | fly-tools/mask/thpool.h (renamed from fly-tools/ThreadedFilterFlyMask/thpool.h) | 0 |
7 files changed, 23 insertions, 17 deletions
@@ -7,17 +7,16 @@ You will find a few scripts to automate the processing of the data: ./process-video-beta ./batch-process -You will find two programs, FilterFlyMask and FlyTracking in fly-tools. You -will need to make them which is easy to do. If you have trouble building, -please make sure that you have gsl and ImageMagick++ libraries and headers -installed. +You will find a few programs, FilterFlyMask, FlyTracking, and mask-generator +in fly-tools. You will need to 'make' them which is easy to do. If you have +trouble building, please make sure that you have gsl and ImageMagick++ and +the MagickWand libraries and headers installed. $ cd fly-data $ make -The programs that will be build are located here: +The programs that will be built are located here: ./fly-tools/FilterFlyMask ./fly-tools/FlyTracking - -More documentation is included in the README file in fly-tools/ +./fly-tools/mask-generator diff --git a/fly-tools/FilterFlyMask.cpp b/fly-tools/FilterFlyMask.cpp index 40d25e3..73ce3cb 100644 --- a/fly-tools/FilterFlyMask.cpp +++ b/fly-tools/FilterFlyMask.cpp @@ -156,7 +156,7 @@ int main(int argc, char* argv[]) ratioSecondLargestToLargest = atof(optarg); break; case 'o': - outputFileLocationi = optarg; + outputFileLocation = optarg; break; case 'v': break; diff --git a/fly-tools/Makefile b/fly-tools/Makefile index 94d69e9..1ba4ecc 100644 --- a/fly-tools/Makefile +++ b/fly-tools/Makefile @@ -1,14 +1,17 @@ -CC = g++ -FLAGS = -O2 -Wall -s $(shell pkg-config --cflags --libs ImageMagick++ gsl) +CPPC = g++ +CC = gcc +CPPFLAGS = -O2 -Wall -s $(shell pkg-config --cflags --libs ImageMagick++ gsl) +CFLAGS = -O2 -Wall -s $(shell pkg-config --cflags --libs MagickWand) +all: FilterFlyMask FlyTrackingMain mask-generator -all: FilterFlyMask FlyTrackingMain - +mask-generator: + $(CC) mask/main.c mask/thpool.c -I./mask/ -o mask-generator $(CFLAGS) -pthread FlyTrackingMain: - $(CC) FlyTrackingMain.cpp FlyObject.cpp FrameInfo.cpp -o FlyTracking $(FLAGS) + $(CPPC) FlyTrackingMain.cpp FlyObject.cpp FrameInfo.cpp -o FlyTracking $(CPPFLAGS) FilterFlyMask: - $(CC) FilterFlyMask.cpp FlyObject.cpp FrameInfo.cpp -o FilterFlyMask $(FLAGS) + $(CPPC) FilterFlyMask.cpp FlyObject.cpp FrameInfo.cpp -o FilterFlyMask $(CPPFLAGS) clean: - rm -vf FilterFlyMask FlyTracking + rm -vf FilterFlyMask FlyTracking mask-generator diff --git a/fly-tools/ThreadedFilterFlyMask/README b/fly-tools/mask/README index f679b03..f679b03 100644 --- a/fly-tools/ThreadedFilterFlyMask/README +++ b/fly-tools/mask/README diff --git a/fly-tools/ThreadedFilterFlyMask/main.c b/fly-tools/mask/main.c index 896a5ba..9c0c344 100644 --- a/fly-tools/ThreadedFilterFlyMask/main.c +++ b/fly-tools/mask/main.c @@ -18,6 +18,8 @@ * */ #include <stdio.h> +#include <string.h> +#include <unistd.h> #include <stdlib.h> #include <libgen.h> #include <wand/MagickWand.h> @@ -34,7 +36,6 @@ char **global_argv; void convert_image(char *file) { MagickWand *mask = NewMagickWand(); - MagickBooleanType status; char *output_name = malloc(256); if(MagickReadImage(mask, file) == MagickFalse) { ThrowWandException(mask); diff --git a/fly-tools/ThreadedFilterFlyMask/thpool.c b/fly-tools/mask/thpool.c index 5d7cbe3..20466e9 100644 --- a/fly-tools/ThreadedFilterFlyMask/thpool.c +++ b/fly-tools/mask/thpool.c @@ -26,6 +26,7 @@ #include <stdio.h> #include <stdlib.h> +#include <unistd.h> #include <pthread.h> #include <semaphore.h> #include <errno.h> @@ -140,6 +141,8 @@ int thpool_add_work(thpool_t* tp_p, void *(*function_p)(void*), void* arg_p){ pthread_mutex_lock(&mutex); /* LOCK */ thpool_jobqueue_add(tp_p, newJob); pthread_mutex_unlock(&mutex); /* UNLOCK */ + + return(1); } @@ -148,7 +151,7 @@ void thpool_destroy(thpool_t* tp_p){ int t; while(tp_p->jobqueue->jobsN > 0) { - usleep(500000); + usleep(50000); } /* End each thread's infinite loop */ thpool_keepalive=0; diff --git a/fly-tools/ThreadedFilterFlyMask/thpool.h b/fly-tools/mask/thpool.h index 39228ff..39228ff 100644 --- a/fly-tools/ThreadedFilterFlyMask/thpool.h +++ b/fly-tools/mask/thpool.h |