GithubHelp home page GithubHelp logo

joakimsoderberg / imageclipper Goto Github PK

View Code? Open in Web Editor NEW
131.0 11.0 51.0 122 KB

An imageclipper intended for using when creating OpenCV haar cascade sample images.

License: MIT License

Perl 2.33% Python 0.49% C 48.96% C++ 42.22% CMake 6.01%

imageclipper's Introduction

Image Clipper

This is a fork of the imageclipper program initially written by Naotoshi Seo.

This fork was made initially for myself to be able to compile the program on OSX. Since I used CMake it was easy to make one build that works on all platforms.

From the original description:

It is often required to crop images manually fast for computer vision researchers to gather training and testing image sets, e.g., cropping faces in images.

This simple multi-platform (Windows, OSX and Linux were verified) software helps you to clip images manually fast.

Building

To build you need CMake, OpenCV and Boost on your system

Linux & OSX

Install requirements using your favorite package system or download the sources yourself.

$ sudo apt-get install cmake libopencv-dev libboost-all-dev

Using MacPorts.

$ sudo port install cmake boost opencv

And then build:

$ git clone <repo url>
$ cd imageclipper
$ mkdir build && cd build
$ cmake ..                                     # This should work in most cases.

# (Optional) Or specifying your own builds of OpenCV or Boost.
$ cmake -DOpenCV_DIR=/path/to/opencv/build/ -DBOOST_ROOT=/path/to/boost ..

$ cmake --build .                              # Builds the program.

Windows

On windows you need to download Visual Studio for Windows Desktop, CMake and git.

Boost

Has been tested with this verison on Windows 7, but should work with whatever you like: Boost 1.55.0 32-bit MSVC12 The default unpack location is c:\local\boost_1_55_0, if you change it you need to know the path when building.

OpenCV

Download and unpack OpenCV and remember the path.

From the git bash console: (use cmd.exe if you prefer)

$ git clone <repo url>
$ cd imageclipper
$ mkdir build && cd build
$ cmake -DOpenCV_DIR=/path/to/opencv/build/ -DBOOST_ROOT=/c/local/boost_1_55_0/ ..
$ cmake --build . --config Release 
$ start imageclipper.sln # If you want to open in Visual Studio instead.

The executable can then be found under build/bin/Release/imageclipper.exe

imageclipper's People

Contributors

joakimsoderberg avatar nl3v avatar davidsoff avatar patwie avatar abaco avatar wzj1695224 avatar

Stargazers

Clayton Kehoe avatar Diogo Martinho avatar  avatar 88act avatar  avatar Ziloka avatar Facteur Pat avatar Renan Tescaro avatar Bernie avatar  avatar  avatar  avatar Zhi avatar Yukun Y avatar Mike Holcomb avatar Mauricio Uribe avatar Xiang Yann, Lim avatar  avatar  avatar  avatar  avatar  avatar Eirik Vale Aase avatar Aditya Yogish Pai  avatar Lava Kafle avatar Thiago Patrício avatar Menno van Ens avatar Arthur Shi avatar Roberto Alcântara avatar Aishwarya Singh avatar Martin John Madsen avatar Jared Short avatar Ivan avatar Elahd Bar-Shai avatar Derek Brown avatar  avatar 杨刚 avatar  avatar Bakhtiyar Syed avatar dreamway avatar  avatar Sui Libin avatar Lovelace.Lee avatar Arpit Gupta avatar David Wong avatar Daniel Ng avatar hosjiu avatar Emma Saboureau avatar Eric Yu avatar Shirley avatar zodiac1111 avatar Madhuri Koushik avatar Patrick avatar  avatar  avatar Hessel Tuinhof avatar  avatar Çağlar Toklu avatar Crazor avatar billiebbb avatar  avatar Steven Van Vaerenbergh avatar Karim Ahmed avatar Derek Colley avatar Andi Domi avatar Edouard Menayde avatar tangshi avatar Evgeny avatar Vladislav Mischenko avatar  avatar Sheldon Robinson avatar Jason Lee Ertle avatar  avatar Sergei Nikulov avatar  avatar Justin avatar Arslan Topçu avatar Ruoqi Zhang avatar Blazej Gruszka avatar  avatar sqba avatar virtualnobi avatar Ming-Hsuan-Tu avatar Diego Alonso avatar Oleg Lodygensky avatar Chris Harrell avatar Guan avatar  avatar  avatar Fabrício Ceschin avatar Wil Wade avatar Itay Mishan avatar Alemu avatar Jarvis Schultz avatar Carl Hopf avatar kevin avatar  avatar  avatar John DeSilva avatar Refik Can Malli avatar

Watchers

 avatar James Cloos avatar  avatar Michael Anthony avatar Guan avatar David avatar  avatar liyangdev avatar Michał Frąckowiak avatar Jazz avatar  avatar

imageclipper's Issues

Building failed

I have done everything according to instructions plus tried different sources for installing cmake, opencv and boost. Still, it always comes back to this cmake build error below. Is anyone else getting this or am I missing something? Tried doing it in Ubuntu and OS X and the same result in both case.

$ cmake --build . 
[ 50%] Building CXX object CMakeFiles/imageclipper.dir/src/imageclipper.cpp.o
/Users/xxx/code/imageclipper/src/imageclipper.cpp:61:16: error: redefinition of 'CvCallbackParam'
typedef struct CvCallbackParam {
               ^
/Users/xxx/code/imageclipper/src/Global.h:13:16: note: previous definition is here
typedef struct CvCallbackParam {
               ^
/Users/xxx/code/imageclipper/src/imageclipper.cpp:80:16: error: redefinition of 'ArgParam'
typedef struct ArgParam {
               ^
/Users/xxx/code/imageclipper/src/Global.h:52:16: note: previous definition is here
typedef struct ArgParam {
               ^
/Users/xxx/code/imageclipper/src/imageclipper.cpp:152:2: error: use of undeclared identifier 'printUsage'
        printUsage();
        ^
/Users/xxx/code/imageclipper/src/imageclipper.cpp:182:5: error: use of undeclared identifier 'printHelpInfo'
                                printHelpInfo(arg);
                                ^
/Users/xxx/code/imageclipper/src/imageclipper.cpp:189:5: error: use of undeclared identifier 'printHelpInfo'
                                printHelpInfo(arg);
                                ^
/Users/xxx/code/imageclipper/src/imageclipper.cpp:201:5: error: use of undeclared identifier 'printHelpInfo'
                                printHelpInfo(arg);
                                ^
/Users/xxx/code/imageclipper/src/imageclipper.cpp:222:4: error: use of undeclared identifier 'printHelpInfo'
                        printHelpInfo(arg);
                        ^
/Users/xxx/code/imageclipper/src/imageclipper.cpp:232:4: error: use of undeclared identifier 'printHelpInfo'
                        printHelpInfo(arg);
                        ^
/Users/xxx/code/imageclipper/src/imageclipper.cpp:242:3: error: use of undeclared identifier 'printHelpInfo'
                printHelpInfo(arg);
                ^
/Users/xxx/code/imageclipper/src/imageclipper.cpp:709:4: error: use of undeclared identifier 'printHelpInfo'
                        printHelpInfo(arg);
                        ^
10 errors generated.
make[2]: *** [CMakeFiles/imageclipper.dir/src/imageclipper.cpp.o] Error 1
make[1]: *** [CMakeFiles/imageclipper.dir/all] Error 2
make: *** [all] Error 2

size of the image

Hello,
I am using v0.99 on W8.1 x64 bit machine and I can see just left upper corner of the image
obrazek
full image has 4608x3072 pixels
obrazek
I can not move or shink the picture, I probably skipped some basic point of the instructions.
Many thanks for your help!

Windows binary

Hi,
Is there a windows binary already built I could find ?

Thanks

boost::filesystem::filesystem_error

when i try to save the cropped image i get the following error (Ubunutu 14.10)

terminate called after throwing an instance of 'boost::filesystem::filesystem_error'
what(): boost::filesystem::create_directory: File exists: "./imageclipper"
[3] 13127 abort (core dumped) ./imageclipper

Running imageclipper

I'm a student and beginner in this kind of study, I have installed correctly the instructions for linux & osx. Now how do I run the imageclipper?

Cropping selects wrong region

I downloaded and compiled the latest master branch, after the first image it seems to save the wrong region of the photo

Request: Ability to skip existing files (or delete files as going along)

I've a collection of around 6,000 images I need to clip (yes, for haar classifier training) and I obviously don't want to do this in one go. I've started imageclipper (on Linux) and done a few files and then needed a break: however, I can't easily find where I was (as imageclipper doesn't "pre-sort" the files).

Could you add an option to skip "pre-clipped" files (i.e. if the output filename -0 ignoring the %x/%y/%w/%h etc settings already exist), add a "checkpoint" option (recording which files have already been seen) or an option to delete the original files as you progress through them (maybe a warning in this case).

Thanks for an otherwise excellent tool.

Assertion at matrix_wrap.cpp:807 when saving image if imageclipper was compiled with OpenCV 3.4.1

Fails for me because of bug in OpenCV C API: opencv/opencv#11076:

Key pressed: 115
OpenCV(3.4.1) Error: Assertion failed ((flags & FIXED_TYPE) != 0) in type, file /home/jek/work/src/opencv/deb/build-area/opencv-3.4.1/modules/core/src/matrix_wrap.cpp, line 807
terminate called after throwing an instance of 'cv::Exception'
what(): OpenCV(3.4.1) /home/jek/work/src/opencv/deb/build-area/opencv-3.4.1/modules/core/src/matrix_wrap.cpp:807: error: (-215) (flags & FIXED_TYPE) != 0 in function type

libc++abi.dylib: terminating with uncaught exception of type boost::filesystem::filesystem_error: boost::filesystem::create_directory: File exists: "./imageclipper"

System Mac OS Sierra 10.12.6 . I compiled using cmake as was written in the instruction and got imageclipper binary file. Then moved it into image folder and executed ./imageclipper . So, new window opened and dropped an Error when I cropped an object and pressed "f" or "space". What it can be and how to fix it?

libc++abi.dylib: terminating with uncaught exception of type boost::filesystem::filesystem_error: boost::filesystem::create_directory: File exists: "./imageclipper"

The answer is just to move binary iamgeclipper binary out of folder because it tries to create folder with the same name

Segmentation fault: 11?

Hi,

Im trying to use image clipper - i've installed package prerequisites using OSX and conda. Im getting the following error "Segmentation fault: 11" when i try running ./imageclipper from the file containing the images i need to clip. The executable file is in the folder containing the images.

As an error its a bit cryptic!

Linker error

Hello!

I'm trying to build imageclipper on MacOS 10.9, OpenCV with TBB support and this error occurs:

Linking CXX executable bin/imageclipper
ld: library not found for -ltbb
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Window spans over multiple virtual desktop

I'm using multiple virtual desktops on ubuntu 15.10 and opencv 3.0.0.

When I start imageclipper the view spans over all the desktops and it is not possible to resize it.

It seems to be related to those lines:

    cvNamedWindow( param->w_name, CV_WINDOW_AUTOSIZE );
    cvNamedWindow( param->miniw_name, CV_WINDOW_AUTOSIZE );

Opencv API specifies that:

CV_WINDOW_NORMAL or CV_WINDOW_AUTOSIZE: CV_WINDOW_NORMAL enables you to resize the window, whereas CV_WINDOW_AUTOSIZE adjusts automatically the window size to fit the displayed image (see imshow() ), and you cannot change the window size manually.

I could not find any direct call to imshow, my guess is that is is hidden in cvShowxxx functions.

Using:

    cvNamedWindow( param->w_name, CV_WINDOW_NORMAL );
    cvNamedWindow( param->miniw_name, CV_WINDOW_NORMAL );

Fixed my problem, but it could be better since weird effect (kind of zooming and cropping that stop uppon selecting another window and coming back to it) occur when resizing the window...

Cropping selects wrong region - suggested fixes included too

As many other open issues have stated, the issue is that when you crop, sometimes it can show the wrong portion of the image. Through some testing I've concluded that it's because you're not resizing the image properly after each image window refresh.

An easy way to fix this is to resize the image window to the img.shape attributes (at least in Python). You could call the function that's triggered by -(key num 45) after each f (key num 102) or
{space} (key num 115).

USERS - You can fix this easily just by hitting the "-" key every image, which resizes the window to the right dimensions.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.