diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..7b20d74 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +*.zip +# .git currently not docker-ignored so that we can do 'git clean' automatically +dist/ diff --git a/.gitignore b/.gitignore index e0dfa6a..b03d752 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ *.zip -visicam.conf +#visicam.conf /build/ /nbproject/private/ +/lib/javacv-bin/ /dist/ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..de24cf8 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM ubuntu:16.04 +RUN apt-get update +RUN apt-get -y -q --no-install-recommends install openjdk-8-jdk ant libopencv2.4 +RUN apt-get -y -q --no-install-recommends install curl unzip +# RUN apt-get -y remove libopencv2.4 +RUN adduser --no-gecos --disabled-password visicam +ADD . /home/visicam +RUN chown -R visicam /home/visicam +WORKDIR /home/visicam +USER visicam +# fetch javaCV if it wasn't downloaded yet +RUN test -d lib/javacv-bin/ || ./lib/fetch-javacv.sh +RUN ant clean && ant +EXPOSE 8080 +CMD ant run diff --git a/build_docker.sh b/build_docker.sh new file mode 100755 index 0000000..be48bbd --- /dev/null +++ b/build_docker.sh @@ -0,0 +1,5 @@ +#!/bin/bash +set -e +# Run this script, then the visicam server will be opened on port 8080. +sudo docker build -t visicam . +sudo docker run -p 8080:8080 --rm -it visicam diff --git a/lib/CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar b/lib/CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar index b1b9556..2cc00f0 100644 Binary files a/lib/CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar and b/lib/CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar differ diff --git a/lib/fetch-javacv.sh b/lib/fetch-javacv.sh new file mode 100755 index 0000000..cfed788 --- /dev/null +++ b/lib/fetch-javacv.sh @@ -0,0 +1,7 @@ +#!/bin/bash +cd "$(dirname "$0")" +URL=https://search.maven.org/remotecontent?filepath=org/bytedeco/javacv-platform/1.3.2/javacv-platform-1.3.2-bin.zip +#URL=https://search.maven.org/remotecontent?filepath=org/bytedeco/javacv/1.2/javacv-1.2-bin.zip +curl $URL > javacv.zip +rm -r javacv-bin/ +unzip javacv.zip diff --git a/lib/javacv-bin/LICENSE.txt b/lib/javacv-bin/LICENSE.txt deleted file mode 100644 index 4d7d05b..0000000 --- a/lib/javacv-bin/LICENSE.txt +++ /dev/null @@ -1,357 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. - - -"CLASSPATH" EXCEPTION TO THE GPL - - Linking this library statically or dynamically with other modules is making - a combined work based on this library. Thus, the terms and conditions of - the GNU General Public License cover the whole combination. - - As a special exception, the copyright holders of this library give you - permission to link this library with independent modules to produce an - executable, regardless of the license terms of these independent modules, - and to copy and distribute the resulting executable under terms of your - choice, provided that you also meet, for each linked independent module, - the terms and conditions of the license of that module. An independent - module is a module which is not derived from or based on this library. If - you modify this library, you may extend this exception to your version of - the library, but you are not obligated to do so. If you do not wish to do - so, delete this exception statement from your version. diff --git a/lib/javacv-bin/README.txt b/lib/javacv-bin/README.txt deleted file mode 100644 index 9016b75..0000000 --- a/lib/javacv-bin/README.txt +++ /dev/null @@ -1,548 +0,0 @@ -=JavaCV= - -==Introduction== -JavaCV first provides wrappers to commonly used libraries by researchers in the field of computer vision: [http://opencv.willowgarage.com/ OpenCV], [http://www.ffmpeg.org/ FFmpeg], [http://damien.douxchamps.net/ieee1394/libdc1394/ libdc1394], [http://www.ptgrey.com/products/pgrflycapture/ PGR FlyCapture], [http://openkinect.org/ OpenKinect], [http://muonics.net/school/spring05/videoInput/ videoInput], and [http://studierstube.icg.tugraz.at/handheld_ar/artoolkitplus.php ARToolKitPlus]. The classes found under the `com.googlecode.javacv.cpp` package namespace expose their complete APIs. Moreover, utility classes make their functionality easier to use on the Java platform, including Android. - -JavaCV also comes with hardware accelerated full-screen image display (`CanvasFrame` and `GLCanvasFrame`), easy-to-use methods to execute code in parallel on multiple cores (`Parallel`), user-friendly geometric and color calibration of cameras and projectors (`GeometricCalibrator`, `ProCamGeometricCalibrator`, `ProCamColorCalibrator`), detection and matching of feature points (`ObjectFinder`), a set of classes that implement direct image alignment of projector-camera systems (mainly `GNImageAligner`, `ProjectiveTransformer`, `ProjectiveColorTransformer`, `ProCamTransformer`, and `ReflectanceInitializer`), a blob analysis package (`Blobs`), as well as miscellaneous functionality in the `JavaCV` class. Some of these classes also have an OpenCL and OpenGL counterpart, their names ending with `CL` or starting with `GL`, i.e.: `JavaCVCL`, `GLCanvasFrame`, etc. - -To learn how to use the API, since documentation currently lacks, please refer to the [#Quick_Start_for_OpenCV_and_FFmpeg] section below as well as the [http://code.google.com/p/javacv/source/browse/samples/ sample programs], including one for Android, also found in the `samples` directory. You may also find it useful to refer to the source code of [http://code.google.com/p/javacv/source/browse?repo=procamcalib ProCamCalib] and [http://code.google.com/p/javacv/source/browse?repo=procamtracker ProCamTracker] as well as [http://code.google.com/p/javacv/source/browse?repo=examples Examples ported from OpenCV2 Cookbook] and the associated [http://code.google.com/p/javacv/wiki/OpenCV2_Cookbook_Examples Wiki pages]. - - -==Required Software== -To use JavaCV, you will need to download and install the following software: - * An implementation of Java SE 6 or 7 - * OpenJDK http://openjdk.java.net/install/ or - * Sun JDK http://www.oracle.com/technetwork/java/javase/downloads/ or - * IBM JDK http://www.ibm.com/developerworks/java/jdk/ or - * Java SE for Mac OS X http://developer.apple.com/java/ etc. - * OpenCV 2.4.3 http://sourceforge.net/projects/opencvlibrary/files/ - * For Android 2.2 http://code.google.com/p/javacv/downloads/list - -And please make sure your Java and OpenCV have the same bitness: *32-bit and 64-bit modules do not mix under any circumstances*. Further, although not always required, some functionality of JavaCV also relies on: - * FFmpeg 1.0.x http://ffmpeg.org/download.html - * For Windows http://ffmpeg.zeranoe.com/builds/ Known compatible builds: - * http://ffmpeg.zeranoe.com/builds/win32/shared/ffmpeg-20121029-git-11d695d-win32-shared.7z - * http://ffmpeg.zeranoe.com/builds/win64/shared/ffmpeg-20121029-git-11d695d-win64-shared.7z - * For Android 2.2 http://code.google.com/p/javacv/downloads/list - * libdc1394 2.1.x or 2.2.x http://sourceforge.net/projects/libdc1394/files/ - * PGR FlyCapture 1.7~2.3 (Windows only) http://www.ptgrey.com/products/pgrflycapture/ - * OpenKinect http://openkinect.org/ - * CL Eye Platform SDK (Windows only) http://codelaboratories.com/downloads/ - * Android SDK API 8 or newer http://developer.android.com/sdk/ - * JOCL and JOGL from JogAmp http://jogamp.org/ - * ARToolKitPlus 2.1.1t http://code.google.com/p/javacv/downloads/list - -To modify the source code, please note that the project files were created for: - * Maven 2 or 3 http://maven.apache.org/download.html - * JavaCPP 0.3 http://code.google.com/p/javacpp/ - -To rebuild, simply call the usual `mvn install` command for both JavaCPP and JavaCV. By default, all the dependencies listed above are NOT required, except for OpenCV and a C++ compiler for JavaCPP, whose command line options can be passed via the `javacpp.options` Maven property, such as [http://code.google.com/p/javacpp/#Instructions_for_Android those required for Android]. Please refer to the comments inside the `pom.xml` file for further details. - -Please keep me informed of any updates or fixes you make to the code so that I may integrate them into the next release. Thank you! - -And feel free to ask questions on [http://groups.google.com/group/javacv the mailing list] if you encounter any problems with the software! I am sure it is far from perfect... - - -==Quick Start for OpenCV and FFmpeg== -First, put all the JAR files of JavaCV (`javacpp.jar`, `javacv.jar`, and `javacv-*.jar`) somewhere in your CLASSPATH, or point your `pom.xml` file to the Maven repository http://maven2.javacv.googlecode.com/git/, and make sure that the library files of OpenCV and FFmpeg (`*.so`, `*.dylib`, or `*.dll`) can be found either in their default installation directories or in the system library PATH, which under Windows includes the current working directory. (For answers to problems frequently encountered with OpenCV on the Windows platform, please refer to [http://code.google.com/p/javacv/wiki/Windows7AndOpenCV Common issues with OpenCV under Windows 7].) Here are some more specific instructions for common cases: - -NetBeans (Java SE 6 or 7): - # In the Projects window, right-click the Libraries node of your project, and select "Add JAR/Folder...". - # Locate the JAR files, select them, and click OK. - -Eclipse (Java SE 6 or 7): - # Navigate to Project > Properties > Java Build Path > Libraries and click "Add External JARs...". - # Locate the JAR files, select them, and click OK. - -Eclipse (Android 2.2 or newer): - # Follow the instructions on this page: http://developer.android.com/training/basics/firstapp/ - # Go to File > New > Folder, select your project as parent folder, type "libs/armeabi" as Folder name, and click Finish. - # Copy `javacpp.jar` and `javacv.jar` into the newly created "libs" folder. - # Extract all the `*.so` files from `javacv-android-arm.jar`, `opencv-2.4.3-android-arm.zip`, and `ffmpeg-1.0-android-arm.zip` directly into the newly created "libs/armeabi" folder, without creating any new subdirectories. - # Navigate to Project > Properties > Java Build Path > Libraries and click "Add JARs...". - # Select both `javacpp.jar` and `javacv.jar` from the newly created "libs" folder. - -After that, the wrapper classes for OpenCV and FFmpeg can automatically access all of their C/C++ APIs: - * [http://docs.opencv.org/ OpenCV documentation] - * [http://ffmpeg.org/doxygen/ FFmpeg documentation] -The class definitions are basically ports to Java of the original header files in C, plus the missing functionality exposed only by the C++ API of OpenCV, and I deliberately decided to keep as much of the original syntax as possible. For example, here is a method that tries to load an image file, smooth it, and save it back to disk: - -{{{ -import static com.googlecode.javacv.cpp.opencv_core.*; -import static com.googlecode.javacv.cpp.opencv_imgproc.*; -import static com.googlecode.javacv.cpp.opencv_highgui.*; - -public class Smoother { - public static void smooth(String filename) { - IplImage image = cvLoadImage(filename); - if (image != null) { - cvSmooth(image, image, CV_GAUSSIAN, 3); - cvSaveImage(filename, image); - cvReleaseImage(image); - } - } -} -}}} - -JavaCV also comes with helper classes and methods on top of OpenCV and FFmpeg to facilitate their integration to the Java platform. Here is a small demo program demonstrating the most frequently useful parts: - -{{{ -import com.googlecode.javacpp.Loader; -import com.googlecode.javacv.*; -import com.googlecode.javacv.cpp.*; -import static com.googlecode.javacv.cpp.opencv_core.*; -import static com.googlecode.javacv.cpp.opencv_imgproc.*; -import static com.googlecode.javacv.cpp.opencv_calib3d.*; -import static com.googlecode.javacv.cpp.opencv_objdetect.*; - -public class Demo { - public static void main(String[] args) throws Exception { - String classifierName = null; - if (args.length > 0) { - classifierName = args[0]; - } else { - System.err.println("Please provide the path to \"haarcascade_frontalface_alt.xml\"."); - System.exit(1); - } - - // Preload the opencv_objdetect module to work around a known bug. - Loader.load(opencv_objdetect.class); - - // We can "cast" Pointer objects by instantiating a new object of the desired class. - CvHaarClassifierCascade classifier = new CvHaarClassifierCascade(cvLoad(classifierName)); - if (classifier.isNull()) { - System.err.println("Error loading classifier file \"" + classifierName + "\"."); - System.exit(1); - } - - // The available FrameGrabber classes include OpenCVFrameGrabber (opencv_highgui), - // DC1394FrameGrabber, FlyCaptureFrameGrabber, OpenKinectFrameGrabber, - // PS3EyeFrameGrabber, VideoInputFrameGrabber, and FFmpegFrameGrabber. - FrameGrabber grabber = FrameGrabber.createDefault(0); - grabber.start(); - - // FAQ about IplImage: - // - For custom raw processing of data, getByteBuffer() returns an NIO direct - // buffer wrapped around the memory pointed by imageData, and under Android we can - // also use that Buffer with Bitmap.copyPixelsFromBuffer() and copyPixelsToBuffer(). - // - To get a BufferedImage from an IplImage, we may call getBufferedImage(). - // - The createFrom() factory method can construct an IplImage from a BufferedImage. - // - There are also a few copy*() methods for BufferedImage<->IplImage data transfers. - IplImage grabbedImage = grabber.grab(); - int width = grabbedImage.width(); - int height = grabbedImage.height(); - IplImage grayImage = IplImage.create(width, height, IPL_DEPTH_8U, 1); - IplImage rotatedImage = grabbedImage.clone(); - - // Objects allocated with a create*() or clone() factory method are automatically released - // by the garbage collector, but may still be explicitly released by calling release(). - // You shall NOT call cvReleaseImage(), cvReleaseMemStorage(), etc. on objects allocated this way. - CvMemStorage storage = CvMemStorage.create(); - - // The OpenCVFrameRecorder class simply uses the CvVideoWriter of opencv_highgui, - // but FFmpegFrameRecorder also exists as a more versatile alternative. - FrameRecorder recorder = FrameRecorder.createDefault("output.avi", width, height); - recorder.start(); - - // CanvasFrame is a JFrame containing a Canvas component, which is hardware accelerated. - // It can also switch into full-screen mode when called with a screenNumber. - // We should also specify the relative monitor/camera response for proper gamma correction. - CanvasFrame frame = new CanvasFrame("Some Title", CanvasFrame.getDefaultGamma()/grabber.getGamma()); - - // Let's create some random 3D rotation... - CvMat randomR = CvMat.create(3, 3), randomAxis = CvMat.create(3, 1); - // We can easily and efficiently access the elements of CvMat objects - // with the set of get() and put() methods. - randomAxis.put((Math.random()-0.5)/4, (Math.random()-0.5)/4, (Math.random()-0.5)/4); - cvRodrigues2(randomAxis, randomR, null); - double f = (width + height)/2.0; randomR.put(0, 2, randomR.get(0, 2)*f); - randomR.put(1, 2, randomR.get(1, 2)*f); - randomR.put(2, 0, randomR.get(2, 0)/f); randomR.put(2, 1, randomR.get(2, 1)/f); - System.out.println(randomR); - - // We can allocate native arrays using constructors taking an integer as argument. - CvPoint hatPoints = new CvPoint(3); - - while (frame.isVisible() && (grabbedImage = grabber.grab()) != null) { - cvClearMemStorage(storage); - - // Let's try to detect some faces! but we need a grayscale image... - cvCvtColor(grabbedImage, grayImage, CV_BGR2GRAY); - CvSeq faces = cvHaarDetectObjects(grayImage, classifier, storage, - 1.1, 3, CV_HAAR_DO_CANNY_PRUNING); - int total = faces.total(); - for (int i = 0; i < total; i++) { - CvRect r = new CvRect(cvGetSeqElem(faces, i)); - int x = r.x(), y = r.y(), w = r.width(), h = r.height(); - cvRectangle(grabbedImage, cvPoint(x, y), cvPoint(x+w, y+h), CvScalar.RED, 1, CV_AA, 0); - - // To access or pass as argument the elements of a native array, call position() before. - hatPoints.position(0).x(x-w/10) .y(y-h/10); - hatPoints.position(1).x(x+w*11/10).y(y-h/10); - hatPoints.position(2).x(x+w/2) .y(y-h/2); - cvFillConvexPoly(grabbedImage, hatPoints.position(0), 3, CvScalar.GREEN, CV_AA, 0); - } - - // Let's find some contours! but first some thresholding... - cvThreshold(grayImage, grayImage, 64, 255, CV_THRESH_BINARY); - - // To check if an output argument is null we may call either isNull() or equals(null). - CvSeq contour = new CvSeq(null); - cvFindContours(grayImage, storage, contour, Loader.sizeof(CvContour.class), - CV_RETR_LIST, CV_CHAIN_APPROX_SIMPLE); - while (contour != null && !contour.isNull()) { - if (contour.elem_size() > 0) { - CvSeq points = cvApproxPoly(contour, Loader.sizeof(CvContour.class), - storage, CV_POLY_APPROX_DP, cvContourPerimeter(contour)*0.02, 0); - cvDrawContours(grabbedImage, points, CvScalar.BLUE, CvScalar.BLUE, -1, 1, CV_AA); - } - contour = contour.h_next(); - } - - cvWarpPerspective(grabbedImage, rotatedImage, randomR); - - frame.showImage(rotatedImage); - recorder.record(rotatedImage); - } - frame.dispose(); - recorder.stop(); - grabber.stop(); - } -} -}}} - - -==Acknowledgments== -This project was conceived at the Okutomi & Tanaka Laboratory, Tokyo Institute of Technology, where I was supported for my doctoral research program by a generous scholarship from the Ministry of Education, Culture, Sports, Science and Technology (MEXT) of the Japanese Government. I extend my gratitude further to all who have reported bugs, donated code, or made suggestions for improvements! - - -==Changes== -===November 4, 2012 version 0.3=== - * Upgraded support to OpenCV 2.4.3 (issue #233) - * Fixed functions like `Algorithm.getMat()` and `HOGDescriptor.getDefaultPeopleDetector()` returning `null` instead of the expected data - * Implemented better, more transparent, handling of `cv::Ptr` - * When allocating an empty `IplImage`, `CvMat`, `CvBGCodeBookModel`, etc. its memory content now gets zeroed out, giving OpenCV a better chance of displaying an error message instead of crashing - * Upgraded supported FFmpeg API to the 1.0 release branch - * Appended to `StringVector` and `MatVector` new convenient bulk constructors and `put()` methods taking arrays of `String`, `IplImage`, `CvMat`, etc. - * Included new `Blobs` module from David Grossman and the corresponding `BlobDemo` sample - * Added missing `opencv_core.partition()` function (issue #144) - * Fixed up the samples a bit (issue #229 and issue #230) - * Switched the majority of `@Adapter` annotations to more concise ones like `@StdVector` as allowed by new capabilities of JavaCPP - * Fixed `FFmpegFrameGrabber.getLengthInFrames()` and `OpenCVFrameGrabber.getLengthInTime()` (issue #231 and issue #236) - * Enhanced `FFmpegFrameRecorder` to support conversion between audio sample formats (for the experimental AAC encoder among other things) and to let two different threads call `record(samples)` and `record(image)` simultaneously, plus a couple of other features like `setFrameNumber()`, which lets users skip image frames (achieving variable frame rate) - * Added a `javacpp.skip` property to `pom.xml`, such that a command like `mvn package -Pall -Djavacpp.skip=true` only recompiles the Java source files, but also added `platform.root` and `compiler.path` properties, which map directly to JavaCPP's for convenience - -===July 21, 2012 version 0.2=== - * Provided new `javacv-linux-arm.jar` build thanks to Jeremy Nicola (issue #184) - * Additional default properties inside `pom.xml` make it easier to build JavaCV from source (issue #202), calling `mvn package` now succeeds with only OpenCV and a C++ compiler for JavaCPP - * Made a few minor updates for OpenCV 2.4.2 - * New `Pointer.limit` property of JavaCPP can now be used to get the `size` of an output parameter, and to specify the maximum `size` on input as well - * Upgraded supported FFmpeg API to the 0.11 release branch - * Added audio support to `FFmpegFrameGrabber` (call `grabFrame()` instead of `grab()`) and `FFmpegFrameRecorder` (call `setAudioChannels()` before `start()`, and `record(Frame)` instead of `record(IplImage)`) (issue #160) - * Gave better default `FFmpegFrameRecorder` settings to H.263, MPEG-4, etc. codecs and fixed H.264 encoding with libx264 (issue #160) - * Refined the `FaceApplet` sample - * Fixed `FlannBasedMatcher` constructor, `FaceRecognizer.train()`, and `Stitcher.stitch()/composePanorama()` (issue #211) - * Fixed `CanvasFrame` sometimes blanking out under Windows and maybe Linux (issue #212) - -===May 27, 2012 version 0.1=== - * Started using version numbers, friendly to tools like Maven, and placing packages in a sort of [http://maven2.javacv.googlecode.com/git/ Maven repository] - * JavaCV can now extract and load native dependent libraries such as `libopencv_core.so.2.4`, `libopencv_core.2.4.dylib`, `opencv_core240.dll`, etc. from Java resources placed inside the `com.googlecode.javacv.cpp.` package (i.e.: under the `/com/googlecode/javacv/cpp//` directory of a JAR file in the classpath) (issue #146) - * Included new `FaceApplet` sample to demonstrate [http://code.google.com/p/javacv/wiki/HowToMakeAnApplet How to use JavaCV in an applet] - * Added handy `IplImage.asCvMat()` and `CvMat.asIplImage()` conversion methods - * Fixed a few small things with `OpenCVFrameGrabber`, `opencv_contrib`, `opencv_legacy`, and `opencv_stitching` - -===May 12, 2012=== - * Upgraded support to OpenCV 2.4.0 (issue #187) - * Moved the source code repository to Git - * Added `pom.xml` file for Maven support and changed the directory structure of the source code to match Maven's standard directory layout - * Made it easier to create one massive statically linked native library by passing something like "-Xcompiler -Wl,-static -o javacv" as command line options to JavaCPP, usually from inside `build.xml` or `pom.xml` (issue #146) - * Fixed missing parameter from `CvANN_MLP.create()` - * Added methods `cvCalcCovarMatrixEx()`, `cvEigenDecomposite()`, and `cvEigenProjection()` taking an `IplImage[]` as argument for convenience - * `VideoInputFrameGrabber.start()` now accepts a `connection` argument such as `VI_COMPOSITE` to support analog cameras and what not - * Fixed `FaceRecognition` sample (issue #188) - * Added a few convenience methods to avoid the need to create empty `CvAttrList` - -===March 29, 2012=== - * Added missing array allocators and `position()` methods to `KDTree.Node`, `DefaultRngAuto`, `CvAffinePose`, `KeyPoint`, `BaseKeypoint`, `ReferenceTrees`, `DMatch`, `*.Params`, `CvFuzzy*`, `Octree.Node`, `CvDefParam`, `Cv*Blob*`, `Cv*Track*`, `CvDrawShape`, `CvVectors`, `CvParamGrid`, `Cv*Params`, `CvSVM*`, `CvPair16u32s`, `CvDTree*` `CvTrainTestSplit`, `CvMLData`, `FeatureEvaluator`, and `*DataMatrixCode` - * Increased versatility of `IplImage.createFrom()`, `copyFrom()`, `copyTo()`, `getBufferedImage()` by providing a `flipChannels` parameter, whose effect was previously mistakenly forced onto four-channel images of byte values only (issue #163) - * Fixed a couple of things with `CvMat.get()/put()` (issue #167) - * In addition to an `IplImage`, we may now specify the pixel format of the data when calling `FFmpegFrameRecorder.record()`, but otherwise when `IplImage.nChannels == 2`, it assumes `PIX_FMT_NV21`, allowing for easy and efficient encoding of data captured from the camera on Android (issue #160), image objects we can also convert to RGB using `cvCvtColor()` with `CV_YUV420sp2BGR` - * Fixed seeking capabilities of `FFmpegFrameGrabber` (issue #162) and added `getLengthInFrames()` and `getLengthInTime()` methods to query the duration of streams, when known - * Enhanced `IplImage.clone()` and `create*Compatible()` with cloning of their `BufferedImage` to make it easier to keep color components in the right order (issue #163) - * Refactored `FrameGrabber` and `FrameRecorder` a bit to accommodate new `createDefault(...)` and `create(String className, ...)` factory methods, offering to users an easier selection method to work around limitations of some APIs (issue #70) - * Adjusted `GNImageAligner`, `ProCamTransformer`, etc. to support alignment of only the projector display on textureless surface planes - * Renamed a few more `Settings` properties to reflect better their meanings - -===February 18, 2012=== - * Added `GLCanvasFrame` to show OpenGL renderbuffers on screen, plus a new factory method `JavaCVCL.createCLGLImageFrom()` to create compatible ones from `IplImage` objects, as well as more user-friendly `getGLContext()`, `getGL()` and `getGL2()` methods - * Fixed various things of the original `CanvasFrame`, and `JavaCV.createCLImage()` and `createIplImage()`, also appending `From` to their names - * New `createPinnedBuffer()` and `createPinnedIplImage()` factory methods in `JavaCVCL` to allocate page-locked memory for faster CPU<->GPU transfers, but it does not seem to work for OpenCL image objects, only linear buffer objects :( - * Fixed and enhanced `GNImageAlignerCL` and `ProjectorDevice` (its `useOpenGL` property) to support fully OpenCL and OpenGL acceleration - * Refactored `Parallel` a bit so that we may set the number of threads it uses via its static `numThreads` property or the "com.googlecode.javacv.numthreads" system property, which defaults to `Parallel.getNumCores() = Runtime.getRuntime().availableProcessors()` - * Cleaned up and renamed some methods in `JavaCV`, while adding `boundingRect()`, functionally similar to `cvBoundingRect`, but better adapted to compute a properly aligned and padded ROI - * Inserted a couple of missing `allocate()` inside `opencv_flann` - * Updated `ObjectFinder` with a `Settings.useFLANN` property to let it use FLANN via OpenCV - * Cleaned up and optimized `HandMouse` - * `CanvasFrame`, `FrameGrabber`, `FrameRecorder`, and `ProjectiveDevice` objects now throw `Exception` objects of a nested class instead of the too generic `java.lang.Exception` one - * Moved parallel execution of `cvkernels.multiWarpColorTransform()`, modifying `ImageTransformer` classes, from `GNImageAligner` into `cvkernels`, which now also supports other image types than `float` - * Renamed some `Settings` properties here and there to correct typos and reflect better their meanings - * Updated `freenect` to reflect the latest changes of OpenKinect's master branch - * FFmpeg and other libraries did not work under Android when compiled with the latest NDK, r7 (issue #147): Fixed in JavaCPP - * Moved `IplImage.timestamp` to `FrameGrabber`, also adding a `frameNumber` property, both allowing to seek within streams too - * Removed `triggerFlushSize` property from `CameraDevice` and `FrameGrabber`, instead relying on the `numBuffers` property to decide the required size of a buffer flush - * Corrected the logic behind `FFmpegFrameGrabber.getFrameRate()` and `getTimestamp()` (issue #151) - * Created a `BufferRing` class for convenient circular rings of large buffers that require manual release of resources, such as OpenCL memory - * Added a few more useful methods to `FrameGrabber`, including `restart()`, `flush()`, and `delayedGrab()` (to be used in conjunction with `getDelayedTime()` and `getDelayedImage()`) - * Inserted `cvLoadImageBGRA()` and `cvLoadImageRGBA()` methods into `opencv_highgui` to load color images compatible with OpenCL more easily - * `JavaCvErrorCallback` now outputs messages to `Logger` instead of `System.err` - * Defined `VI_COM_MULTI_THREADED` for `videoInput`, allowing it to run on multiple threads if needed - -===January 8, 2012=== - * JavaCV should now have an easier time automatically finding libraries inside standard directories such as `/usr/local/lib/`, `/opt/local/lib/`, and `C:\opencv\`, even when they are not part of the system configuration or PATH (issue #127) - * Renamed `set()` and `fill()` methods to `put()` inside `CvPoint*` classes, for better naming consistency - * Renamed `FrameGrabber.ColorMode` to `ImageMode` and its `BGR` value to `COLOR` to reflect the fact that a `FrameGrabber` instance can return color images in some arbitrary format, but added a new `pixelFormat` property to let users know or specify the exact pixel format desired, such as `PIX_FMT_BGR24`, etc. in the case of `FFmpegFrameGrabber` - * After `FFmpegFrameGrabber.start()`, the `format`, `imageWidth`, `imageHeight`, and `frameRate` properties switch to their effective values - * Added new `FrameGrabber.sensorPattern` property to obtain the Bayer filter layout of raw data from `DC1394FrameGrabber` and `FlyCaptureFrameGrabber` - * Readded to `KDTree`, `Index`, and `HOGDescriptor` some functions with `FloatPointer` and `IntPointer` arguments that were mistakenly removed when OpenCV switched to using `cv::InputArray` and `cv::OutputArray` parameter types (issue #134) - * Renamed `ProjectiveGainBiasTransformer` to `ProjectiveColorTransformer` - * Added a few classes to do some processing using OpenCL and OpenGL: `JavaCVCL`, `GNImageAlignerCL`, `ProjectiveTransformerCL`, `ProjectiveColorTransformerCL`, and `ProCamTransformerCL` with some other related files - * Renamed `Parallel.numCores` to the more conventional `Parallel.NUM_CORES` - * Added new `FaceRecognition.java` sample from Stephen L. Reed - * Inserted a couple of missing calls to `Loader.load()` (issue #142) - * Improved hacks for `Loader.load()` in JavaCPP make JavaCV work on Android 4.0 - * New `PS3EyeFrameGrabber` from Jiri Masa can now grab images using the SDK from Code Laboratories - -===October 1, 2011=== - * Fixed `DC1394FrameGrabber` and `FlyCaptureFrameGrabber` to behave as expected with all Bayer/Raw/Mono/RGB/YUV cameras modes (within the limits of libdc1394 and PGR FlyCapture) (issue #91) - * Fixed regression of `IplImage.copyFrom()` and `createFrom()` with `BufferedImage` objects of `SinglePixelPackedSampleModel` (issue #102) - * C++ functions using `std::vector` objects as output parameters now work on Windows Vista and Windows 7 as well - -===August 20, 2011=== - * Upgraded support to OpenCV 2.3.1 - * An output argument of type `cv::Mat` or `cv::OutputArray` returned with a size 0 now correctly sets `CvArr.address = 0` - * Fixed `IplImage.createFrom()` and `copyFrom()` when called on objects returned by `BufferedImage.getSubimage()` - * Added missing allocator to `CvRNG` - * `OpenCVFrameGrabber` now detects when CV_CAP_PROP_POS_MSEC is broken and gives up calling `cvGetCaptureProperty()` - * New `OpenKinectFrameGrabber.grabDepth()` and `grabVideo()` methods to capture "depth" and "video" simultaneously, regardless of the mode - -===July 5, 2011=== - * Upgraded support to OpenCV 2.3.0 - * Fixed `OpenKinectFrameGrabber`, which can now also capture depth images when `setFormat("depth")` is called before `start()` - * Fixed `CvMatArray` and `IplImageArray` as well as histogram related functions - * Fixed `FFmpegFrameGrabber`, and `FFmpegFrameRecorder` now works on Android also - * Fixed calls, such as `opencv_flann.Index.knnSearch()`, that require a `MatAdapter` or an `ArrayAdapter` for output - -===June 10, 2011=== - * New `freenect` wrapper and corresponding `OpenKinectFrameGrabber` to capture from Microsoft's Kinect stereo camera using OpenKinect - * JavaCV now exposes all C++ functions and classes of OpenCV not covered by the C API - * Fixed various erroneous declarations and calls, including those due to changes in JavaCPP - -===May 11, 2011=== - * Removed `CvMat` object pooling in favor of more efficient `ThreadLocal` objects created by `CvMat.createThreadLocal()` - * Changed `Marker.getCenter()` back to the centroid, because it has better noise averaging properties and gives in practice more accurate results than the actual center - * Added hack to `OpenCVFrameGrabber.start()` to wait for `cvRetrieveFrame()` to return something else than `null` under Mac OS X - * FFmpeg now works properly on Windows and Android (issue #63) with newer binaries - * New `videoInputLib` wrapper and corresponding `VideoInputFrameGrabber` to capture using DirectShow, useful under Windows 7 where OpenCV and FFmpeg can fail to capture using Video for Windows (issue #58) - * `GeometricCalibrator` now reports the maximum errors in addition to the average (RMS) errors - -===April 7, 2011=== - * Added a `format` property to `CameraDevice`, `FrameGrabber`, and `FrameRecorder`, mostly useful for `FFmpegFrameGrabber`, where interesting values include "dv1394", "mjpeg", "video4linux2", "vfwcap", and "x11grab" - * `OpenCVFrameRecorder` now uses `CV_FOURCC_PROMPT` under Windows as default since `CV_FOURCC_DEFAULT` crashes (issue #49) - * Added hack to make sure the temporarily extracted library files get properly deleted under Windows - * JavaCPP now loads classes more lazily - * Fixed most occurences of `UnsatisfiedLinkError` (issue #54), but some corner cases may require a call to `Loader.load()` on the class one wishes to use - * Added (rudimentary) outlier detection and modified zero threshold handling in the image alignment framework - * New `JavaCV.hysteresisThreshold()` feature - * New `HandMouse` functionality, which depends on the image alignment framework - * Fixed `ProjectiveDevice.distort()`, which mistakenly undistorted images instead - * New `HoughLines` sample thanks to Jeremy Nicola - -===February 19, 2011=== - * Switched from JNA to JavaCPP, which has a lower overhead and supports C++, bringing hope that future versions of JavaCV will support features of OpenCV available only through the C++ API - * Consequently, the syntax of various operations have changed a bit, but the transition should not be too painful - * As a happier consequence, this also fixes the problem with SSE instructions on 32-bit x86 (issue #36) - * Also, JavaCPP does not have any limitations or performance issues with large data structures (issue #10 and issue #14) - * Added support for OpenCV 2.2 (issue #42), but dropped support for all previous versions - * Added samples provided by users (issue #1, issue #45, and issue #46) - * Added deinterlace setting to `FFmpegFrameGrabber` having it call `avpicture_deinterlace()` (issue #38) - * Enhanced a few things of the image alignment algorithm - * Tried to fix image format conversion inside `FlyCaptureFrameGrabber`, but this is going to require more careful debugging - * Fixed and added various other things I forget - -===December 2, 2010=== - * Now works on Android with the Dalvik VM (for more details, please refer to the FacePreview sample available on the download page) - * Added more hacks to `CanvasFrame` in the hope to make it behave better outside the EDT - * Made clearer the error messages thrown from `FrameGrabber` objects, when `start()` may not have been called - * Fixed version specific declarations of `CvStereoBMState` and related functions - * Fixed conditions that could crash `cvkernels` - -===November 4, 2010=== - * Renamed the package namespace to `com.googlecode.javacv`, which makes more sense now that JavaCV has been well anchored at Google Code for more than a year, piggybacking on the unique and easy-to-remember domain name - * Included new FFmpeg wrapper classes `avutil`, `avcodec`, `avformat`, `avdevice`, `avfilter`, `postprocess`, and `swscale`, eliminating the need of the separate FFmpeg-Java package - * `CanvasFrame` now redraws its `Canvas` after the user resizes the `Frame` - * Fixed the `Error` thrown when calling `CanvasFrame.showImage()` from the EDT - * Added check to `DC1394FrameGrabber` so that a "Failed to initialize libdc1394" does not crash the JVM - * `FFmpegFrameGrabber` does not crash anymore when forgetting to call `start()` before a `grab()` or `trigger()` - * `FrameGrabber` now selects the default grabber a bit better - * Made sweeping changes (for the better, but still not finalized) to `GNImageAligner`, `ProjectiveTransformer`, `ProjectiveGainBiasTransformer`, and `ProCamTransformer`... - * Added to `JavaCV` more methods related to transformation of planes: `perspectiveTransform()`, `getPlaneParameters()`, `getPerspectiveTransform()`, and `HtoRt()`, as well as `ProjectiveDevice.getFrontoParallelH()` - * Added a static `autoSynch` flag to all `Structure` classes of `cxcore`, `cv`, and `cvaux`, which you may set to `false` prior to the return of things like big and heavy `CvSeq` to make them load faster and to avoid stack overflows, but accessing fields will then require manual calls to `readField()` and `writeField()` (issue #10 and #14) - * Added missing `ByValue` subclasses to `CvSeq`, `CvSet`, `CvContourTree`, and `CvChain`... Any others missing? - * Fixed `Exception` thrown from `cvCreateHist()` under JNA 3.2.7 (issue #26) - * Enhanced `CvMat.put()`, which now supports setting submatrices - * Improved inside `IplImage` the support of `BufferedImage`, especially those using a `DirectColorModel` (issue #23) - * Fixed crash in `cvkernels` when color transformation `X` is `null` - -===July 30, 2010=== - * Fixed crash that would occur in `CanvasFrame` for some video drivers - * `FFmpegFrameGrabber` now supports other input formats (devices), such as `x11grab` that can be used for screencasting - * Added `JavaCV.median()` function, and `JavaCV.fractalTriangleWave()` now respects image ROI - * Fixed background subtraction in `cvaux` - * Fixed crash inside the code for direct alignment caused by the ROI getting set outside the image plane - * Added `deltaScale` and `tryToFixPlane` to `GNImageAligner.Settings` (the first used in `ImageTransformer.Parameters` as increment, randomly selected forward or backward, for finite difference), which sometimes help to jump over local minima - -===May 30, 2010=== - * Removed redundant `CvMemStorage.clearMem()` method, use `cvClearMemStorage()` - * Fixed the sample `Test2` class that did not work under Windows - * Fixed corruption by the `cvkernels` `transformer` at the borders - * Modified `CanvasFrame` constructors and added a `gamma` argument used by `showImage(IplImage)` - * `CanvasFrame` now lets users resize the frame, while displayed images are stretched to fit the new size - * Renamed `CanvasFrame.acquireGraphics()` to `createGraphics()` for consistency - * When `FlyCaptureFrameGrabber` cannot set fastest speed, it now safely fails by setting any supported speed - * Added a new `Parallel.loop()` method that can use more threads than the number of CPU cores detected - * Added new `numThreads` property to `GNImageAligner` and fixed a few minor inconsistencies as well - * Fixed incorrect `Java.HnToRt()`, and added a few `norm()` and `randn()` methods - * For functions with `float[]` and `double[]` arguments in `cvaux` and `cv`, added complementary `FloatBuffer` and `DoubleBuffer` declarations - * Fixed loading problems with `cvaux` - * Fixed and enhanced histogram, back projection, and other CAMSHIFT related functionality - * Added code for `CvRNG` - * Added "/opt/local/lib/" and "/opt/local/lib64/" (standard on Mac OS X) to the default list of search paths for OpenCV - * Added `CvScalar.getVal()` and `CvIntScalar.getVal()`, which simply return the `val` field, convenient for Scala where `val` is a reserved word - * Fixed the construction of `IplImage` from a `Pointer` - * Removed incorrect cases when an `IplImage` gets converted to a `BufferedImage.TYPE_CUSTOM` - * Made `CvArr.PointerByReference` a bit more consistent and general - -===April 16, 2010=== - * Modified `IplImage`, `FrameGrabber`, and `CanvasFrame` to get better default behavior of gamma correction - * Fixed `cv.CvHistogram` and related histogram functions - * `CameraDevice.Settings.triggerFlushSize` now defaults to 5 (only affects `OpenCVFrameGrabber` and `FFmpegFrameGrabber`) - * Replaced `LMImageAligner` by `GNImageAligner`, a more appropriate name for Gauss-Newton with `lineSearch` - * Fixed a few things related with `ProjectiveDevice.Settings` - -===April 8, 2010=== - * Added support for OpenCV 2.1 - -===April 5, 2010=== - * Fixed up `clone()` methods to avoid the need to cast - * Removed the `fullScreen` argument from `CanvasFrame` constructors, which will now switch to full-screen mode only when a `screenNumber` is explicitly passed - * Renamed `FrameGrabber.ColorMode.GRAYSCALE` to `GRAY` - * Replaced deprecated functions from `FFmpegFrameGrabber` and `FFmpegFrameRecorder` - * `FFmpegFrameGrabber` can now resize images - -===March 21, 2010=== - * Added new classes and methods used by ProCamTracker: `cvkernels`, `JavaCV.fractalTriangleWave()`, `ImageAligner`, `LMImageAligner`, `ImageTransformer`, `ProjectiveTransformer`, `ProjectiveGainBiasTransformer`, `ProCamTransformer`, and `ReflectanceInitializer` - * `CameraDevice.Settings` has a new `deviceFile` property (used by a `FrameGrabber`), which brings up a file dialog for some `PropertyEditor`s - * Moved in `CameraSettings`, `ProjectorSettings`, and `FrameGrabber.PropertyEditor` from the `procamcalib` package - * Added to `CameraDevice.Settings` and `FrameGrabber` a `triggerFlushSize` property to indicate the number of buffers to flush on `trigger()` to compensate for cheap cameras that keep old images in memory indefinitely - * Changed the type of `CameraDevice.Settings.deviceNumber` to `Integer` so we may set it to `null` - * Fixed and enhanced `CanvasFrame.showImage()` methods a bit - * In `triggerMode` `DC1394FrameGrabber` now tries to use a real software trigger and only falls back to one-shot mode on error - * Fixed array constructors of `IplImage.PointerByReference()` and `CvImgObsInfo.PointerByReference()` - * Added `CvPoint.fillArray()` methods to reuse preallocated arrays and changed `createArray()` a bit as well - * Fixed and enhanced all `IplImage.copy*()` methods, including new support for ROIs and subimages, which affects `create*()` and `getBufferedImage()` methods as well - * Updated `Marker` to support different size and spacing in X and Y - * Added `Settings` to `ObjectFinder` - * Fixed distortion problem in `ProjectiveDevice` and `ProCamColorCalibrator` with OpenCV 1.1pre1 - * Split `ProjectiveDevice.Settings` into `ProjectiveDevice.CalibrationSettings` (for applications like ProCamCalib) and `ProjectiveDevice.CalibratedSettings` (for applications like ProCamTracker) - * Renamed `gamma` to `responseGamma` in `ProjectiveDevice`, and moved previous `nominalDistance` parameter to `Settings` - * Added `ProjectiveDevice.rescale()` to rescale calibration parameters when switching a device to a new image size - * `ProjectiveDevice.undistort()` and `distort()` can now `useFixedPointMaps` of OpenCV - * `ProjectiveDevice` and its subclasses now `throw new Exception()` if the `parameterFile` cannot be read - -===February 13, 2010=== - * Relicensed JavaCV under the GPLv2 with Classpath exception (see LICENSE.txt). Please note that if your application links with code that needs ARToolKitPlus, for example, it will become subject to the full GPL, without Classpath exception - * Added `devicePath` setting to `CameraDevice` that works with `FFmpegFrameGrabber`, `OpenCVFrameGrabber`, and other `FrameGrabber` with a String constructor - * Added "C:/OpenCV2.0/bin/release/" to the directory list to search for OpenCV DLLs - * Moved `cvFindHomography()`, `cvFindExtrinsicCameraParams2()`, `cvReprojectImageTo3D()`, `cvSaveImage()`, and `cvRetrieveFrame()` to version specific classes since their number of arguments differ with the version of OpenCV - * Enhanced `CvMat.put(CvMat mat)` to work better even when the matrices are not actually compatible - * Added new `IplImage` factory methods `createCompatible(IplImage image)`, `createIfNotCompatible(IplImage image, IplImage template)`, and `createFrom(BufferedImage image)` - * Fixed `distortionCoeffs` corruption that might occur in `ProjectiveDevice` - -===January 3, 2010=== - * Added wrapper for the `cvaux` module of OpenCV - * Added abstract `FrameRecorder` class and a `OpenCVFrameRecorder` class - * Fixed read() problem that might occur within Pointer constructors - * Running `java -jar javacv.jar` now displays version information - -===December 22, 2009=== - * Fixed `CanvasFrame` from getting stuck in a maximized window - * Removed all `setAutoWrite(false)` from `cxcore` now that the bug appears fixed in JNA - * Added `FFmpegFrameGrabber` and `FFmpegFrameRecorder` to easily record live footage and grab back offline into JavaCV - -===November 24, 2009=== - * Added more convenient constructors and factory methods for `CvPoint*`, `CvSize*`, `CvRect`, `CvTermCriteria`, `CvSlice`, and `CvAttrList` - * Added _R2_ correlation coefficient field to `ProjectiveDevice` - * Enhanced and fixed color conversion spaghetti code in `FlyCaptureFrameGrabber` - * Fixed the `CvHaarFeature` Structure - * Renamed `CvIntScalar` factory methods to match with `CvScalar` - * Enhanced and fixed some problems with gamma correction in `IplImage` - * Added a `highgui.CV_FOURCC()` method that takes chars as parameter - * Moved `MarkedPlane.drawMarkers()` to `Marker.draw()` for better code reuse - * Added `MarkedPlane.getTotalWarp()` with a "useCenters" parameter - * Changed default values of `MarkerDetector.binarizationKWhiteMarkers` to 1.0 and `ProjectorDevice.brightnessBackground` to 0.0 - * Fixed issue with image width and memory alignment in `MarkerDetector` - * `Marker.getCenter()` now computes the actual physical center instead of the centroid - * `OpenCVFrameGrabber.getDeviceDescriptions()` now throws `UnsupportedOperationException` - * Added support in `OpenCVFrameGrabber` to grab frames from video files - * Added `ProjectiveDevice.getRectifyingHomography()` method - * Added `JavaCvErrorCallback` to easily catch errors of OpenCV in Java - -===October 19, 2009=== - * Moved the functionality of `CvMatPool` to the `CvMat.take()` and `.pool()` methods - * Added color calibration for projector-camera systems (`ProCamColorCalibrator`) - * Updated `DC1394FrameGrabber` to handle more conversion use cases automatically - * Fixed `CvIntScalar` to mirror `CvScalar` - -===October 14, 2009=== - * Change of plan: JavaCV now works with any of OpenCV 1.0, 1.1pre1, or 2.0! Version specific functionality is enclosed in subclasses, e.g., the class `cv.v20` can access everything from the `cv` module of OpenCV 2.0 - * Added a few missing functions and adjusted some mappings to make them closer to the C API - * Added a few more helper methods to `CvPoint*` - * Added temporary storage to `ObjectFinder` to plug the memory leak - -===October 2, 2009=== - * Fixed problem when loading distortion coefficients with `ProjectiveDevice` - * Added automatic read and write for functions with arrays of `Structure` or `PointerByReference` - * Added to `cv.java` a few missing functions related to calibration - * Fixed up a bit helper methods for `CvPoint*`, `CvScalar`, `CvRect`, `CvBox2D`, `CvMat`, `IplImage`, `CvMemStorage`, `CvSeq`, and `CvSeqBlock` - * Added `CvMatPool` to `MarkedPlane` and `Marker` - * Added a few new `distort()` methods to `ProjectiveDevice` - * Last version to support OpenCV 1.1pre1: Future version will require OpenCV 2.0 - -===August 27, 2009=== - * `IplImage` now flips the buffer on copy if necessary - * Added needed Pointer constructor for `CvSURFPoint` and `CvConvexityDefect` - * Cleaned up a bit the messy Buffers in `CvMat` - -===August 26, 2009=== - * Added `get*Buffer()` functions to `IplImage` - * Added more options for gamma correction in `IplImage` and `ProjectiveDevice` - * Further cleaned up the namespace and constructors of `ProjectiveDevices` - * `CanvasFrame.waitKey()` now only checks `KeyEvent.KEY_PRESSED` - * Added `CvMatPool` to avoid recreating matrices - * Moved `CvScalar` functions to `cxcore` - -===August 19, 2009=== - * Switched to using `import static` for relief from namespace hell - * Fixed color channel reversal of Bayer images in `DC1394FrameGrabber` - -===August 11, 2009=== -Initial release - - ----- -Copyright (C) 2009-2012 Samuel Audet -Project site: http://code.google.com/p/javacv/ - -Licensed under the GNU General Public License version 2 (GPLv2) with Classpath exception. -Please refer to LICENSE.txt or http://www.gnu.org/licenses/ for details. - diff --git a/lib/javacv-bin/javacpp.jar b/lib/javacv-bin/javacpp.jar deleted file mode 100644 index c6ba601..0000000 Binary files a/lib/javacv-bin/javacpp.jar and /dev/null differ diff --git a/lib/javacv-bin/javacv-android-arm.jar b/lib/javacv-bin/javacv-android-arm.jar deleted file mode 100644 index 13133cd..0000000 Binary files a/lib/javacv-bin/javacv-android-arm.jar and /dev/null differ diff --git a/lib/javacv-bin/javacv-linux-x86.jar b/lib/javacv-bin/javacv-linux-x86.jar deleted file mode 100644 index 4c698cf..0000000 Binary files a/lib/javacv-bin/javacv-linux-x86.jar and /dev/null differ diff --git a/lib/javacv-bin/javacv-linux-x86_64.jar b/lib/javacv-bin/javacv-linux-x86_64.jar deleted file mode 100644 index f0db019..0000000 Binary files a/lib/javacv-bin/javacv-linux-x86_64.jar and /dev/null differ diff --git a/lib/javacv-bin/javacv-macosx-x86_64.jar b/lib/javacv-bin/javacv-macosx-x86_64.jar deleted file mode 100644 index 1270e3e..0000000 Binary files a/lib/javacv-bin/javacv-macosx-x86_64.jar and /dev/null differ diff --git a/lib/javacv-bin/javacv-windows-x86.jar b/lib/javacv-bin/javacv-windows-x86.jar deleted file mode 100644 index b3a558c..0000000 Binary files a/lib/javacv-bin/javacv-windows-x86.jar and /dev/null differ diff --git a/lib/javacv-bin/javacv-windows-x86_64.jar b/lib/javacv-bin/javacv-windows-x86_64.jar deleted file mode 100644 index 8286ef0..0000000 Binary files a/lib/javacv-bin/javacv-windows-x86_64.jar and /dev/null differ diff --git a/lib/javacv-bin/javacv.jar b/lib/javacv-bin/javacv.jar deleted file mode 100644 index 41057c3..0000000 Binary files a/lib/javacv-bin/javacv.jar and /dev/null differ diff --git a/lib/javacv-pi/binary_versions.txt b/lib/javacv-pi/binary_versions.txt deleted file mode 100644 index 5ed9786..0000000 --- a/lib/javacv-pi/binary_versions.txt +++ /dev/null @@ -1,5 +0,0 @@ -These binaries were compiled on the Raspberry Pi 2 with the operating system Raspbian. - -OpenCV: Version 2.4.9 -JavaCV / JavaCPP : 0.7 -JDK: OpenJDK 7 \ No newline at end of file diff --git a/lib/javacv-pi/javacpp.jar b/lib/javacv-pi/javacpp.jar deleted file mode 100644 index e4f1ca4..0000000 Binary files a/lib/javacv-pi/javacpp.jar and /dev/null differ diff --git a/lib/javacv-pi/javacv-linux-arm.jar b/lib/javacv-pi/javacv-linux-arm.jar deleted file mode 100755 index 1ccd560..0000000 Binary files a/lib/javacv-pi/javacv-linux-arm.jar and /dev/null differ diff --git a/lib/javacv-pi/javacv.jar b/lib/javacv-pi/javacv.jar deleted file mode 100755 index 23be379..0000000 Binary files a/lib/javacv-pi/javacv.jar and /dev/null differ diff --git a/lib/nblibraries.properties b/lib/nblibraries.properties index cc97786..6d0afb5 100644 --- a/lib/nblibraries.properties +++ b/lib/nblibraries.properties @@ -1,4 +1,4 @@ libs.CopyLibs.classpath=\ ${base}/CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar libs.CopyLibs.displayName=CopyLibs Task -libs.CopyLibs.prop-version=1.0 +libs.CopyLibs.prop-version=2.0 diff --git a/nbproject/build-impl.xml b/nbproject/build-impl.xml index 2c2cb35..207e693 100644 --- a/nbproject/build-impl.xml +++ b/nbproject/build-impl.xml @@ -79,6 +79,7 @@ is divided into following sections: + @@ -96,16 +97,20 @@ is divided into following sections: - + - - + + + - - - + + + + + + @@ -116,12 +121,6 @@ is divided into following sections: - - - - - - @@ -140,24 +139,12 @@ is divided into following sections: - + - + - - - - - - - - - - - - @@ -211,7 +198,15 @@ is divided into following sections: - + + + + + + + + + @@ -300,6 +295,7 @@ is divided into following sections: + @@ -339,6 +335,7 @@ is divided into following sections: + @@ -395,6 +392,11 @@ is divided into following sections: + + + + + @@ -418,7 +420,7 @@ is divided into following sections: - + @@ -432,6 +434,9 @@ is divided into following sections: + + + @@ -463,7 +468,7 @@ is divided into following sections: - + @@ -559,7 +564,7 @@ is divided into following sections: - + @@ -573,6 +578,9 @@ is divided into following sections: + + + @@ -851,8 +859,8 @@ is divided into following sections: - - + + @@ -864,7 +872,7 @@ is divided into following sections: - + @@ -945,7 +953,7 @@ is divided into following sections: - + @@ -980,41 +988,25 @@ is divided into following sections: - - - - - - - - - - - - - To run this application from the command line without Ant, try: - - - - - - - java -cp "${run.classpath.with.dist.jar}" ${main.class} - - + - + - + - + + + + + + @@ -1022,23 +1014,41 @@ is divided into following sections: - + To run this application from the command line without Ant, try: java -jar "${dist.jar.resolved}" - + + + + + + + + + + + + + + + + + - + + - + +