Giter Club home page Giter Club logo

sky-detector's Introduction

Sky-Area-Detector

sky area detection without deep neural networks. A c++ implemention of the algorithm mentioned in paper "Sky Region Detection in a Single Image for Autonomous Ground Robot Navigation". A fast and robust method to extract the sky area of an image.

Installation

This implementation need opencv library. Since the project is static compiled for conveniently transplanting you need static opencv library linked to this project. If static compilation is not necessary for you feel free to modify the CMakeList to dynamic compile the project.

This software has only been tested on ubuntu 16.04(x64), opencv3.4. To install this package your compiler need to support C++11.

git clone https://github.com/MaybeShewill-CV/sky-detector.git

Build

cd ROOT_FOLDER_DIR
mkdir build
cd build
cmake ..
make -j

The project will generate a static binary file which can be used on other platform without any dynamic library. The binary file built on Ubuntu 16.04LTS was tested on CentOS 6 and worked correctly.

Usage

cd build_dir
./detect input_image_file_path output_image_file_path

结果示意图如下

Test input image with full sky

Test_input_full_sky

Test input image with ful sky result

Test_input_full_sky_result

Test input image with part sky

Test_input_part_sky

Test input image with part sky result

Test_input_part_sky_result

TODO

  • Accelerate the calculation process

sky-detector's People

Contributors

hunterlew avatar maybeshewill-cv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sky-detector's Issues

Cloud will affect the result, is there any way to cover the sky that contains lots of clouds?

hi,我遇到一个问题,如果空中有些云,您的detector会保留一些突出的云朵及云朵下方的天空,请问是否有方法可以降低云对于结果的影响呢? 如果需要调参,哪些参数会有帮助?

hi,there is a problem that if some significant clouds in the sky, the detector will keep the clouds and the sky below the clouds, is the any way to reduce the influence of the cloud in the sky? if need to change the parameter, how could I do?

Example 例图:

https://ibb.co/k0wZDvt
Please do not delete(勿删感谢)

out of index error while access border array

in the functions has_sky_region(...) and has_partial_sky_region(...) in imageSkyDetector.cpp, the following code:

std::vector<int> border_diff(static_cast<int>(border.size() - 1), 0);
for (auto i = static_cast<int>(border.size() - 1); i >= 0; i--)
{
border_diff[i] = std::abs(border[i + 1] - border[i]);
}

makes access violation error. Since the index i+1 exceeds the size of array border ?

configure issue

When I run successfully cmake command after that I run out "make -j" it's throwing error like.
*** No targets specified and no makefile found. Stop.
Can you please guide me more into that because I need to integrate that library in for iOS Application.

Thanks.

No rule to make target '/usr/local/lib/libboost_filesystem.a', needed by 'detector'. Stop.

when I run make, I met question like bellow:

Scanning dependencies of target detector
[ 25%] Building CXX object CMakeFiles/detector.dir/main_test.cpp.o
[ 50%] Building CXX object CMakeFiles/detector.dir/sky_detector/imageSkyDetector.cpp.o
[ 75%] Building CXX object CMakeFiles/detector.dir/file_processor/file_system_processor.cpp.o
make[2]: *** No rule to make target '/usr/local/lib/libboost_filesystem.a', needed by 'detector'. Stop.
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/detector.dir/all' failed
make[1]: *** [CMakeFiles/detector.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

how to deal it ?
Thanks

OSX compilation OPENMP

compiling on osx gives this error:

CMake Error at /usr/local/Cellar/cmake/3.13.0/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find OpenMP_C (missing: OpenMP_C_FLAGS OpenMP_C_LIB_NAMES)
Call Stack (most recent call first):
  /usr/local/Cellar/cmake/3.13.0/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
  /usr/local/Cellar/cmake/3.13.0/share/cmake/Modules/FindOpenMP.cmake:473 (find_package_handle_standard_args)
  CMakeLists.txt:24 (FIND_PACKAGE)

Tried this one https://stackoverflow.com/questions/48825416/missing-openmp-c-flags-openmp-c-lib-names but seems not working.
Any suggestion?
Can you directly provide me the final binary?
Thank you so much

Licensing

What's the licensing on this bad boy?

Build Failing

Build is failing

(base) antpc@ant-pc:/media/antpc/Data/SujoyRc/Work/sky-detector$ mkdir build
(base) antpc@ant-pc:/media/antpc/Data/SujoyRc/Work/sky-detector$ cd build
(base) antpc@ant-pc:/media/antpc/Data/SujoyRc/Work/sky-detector/build$ cmake ..
-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found OpenMP_C: -fopenmp (found version "4.5") 
-- Found OpenMP_CXX: -fopenmp (found version "4.5") 
-- Found OpenMP: TRUE (found version "4.5")  
OPENMP FOUND
-- Boost version: 1.65.1
-- Found OpenCV: /usr (found version "3.2.0") 
-- Configuring done
-- Generating done
-- Build files have been written to: /media/antpc/Data/SujoyRc/Work/sky-detector/build
(base) antpc@ant-pc:/media/antpc/Data/SujoyRc/Work/sky-detector/build$ make -j
Scanning dependencies of target detector
make[2]: *** No rule to make target '/usr/local/lib/libboost_filesystem.so', needed by 'detector'.  Stop.
make[2]: *** Waiting for unfinished jobs....
[ 50%] Building CXX object CMakeFiles/detector.dir/sky_detector/imageSkyDetector.cpp.o
[ 50%] Building CXX object CMakeFiles/detector.dir/main_test.cpp.o
[ 75%] Building CXX object CMakeFiles/detector.dir/file_processor/file_system_processor.cpp.o
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/detector.dir/all' failed
make[1]: *** [CMakeFiles/detector.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

Machine details

(base) antpc@ant-pc:/media/antpc/Data/SujoyRc/Work/sky-detector/build$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.5 LTS
Release:	18.04
Codename:	bionic
(base) antpc@ant-pc:/media/antpc/Data/SujoyRc/Work/sky-detector/build$ lscpu
Architecture:        x86_64
CPU op-mode(s):      32-bit, 64-bit
Byte Order:          Little Endian
CPU(s):              8
On-line CPU(s) list: 0-7
Thread(s) per core:  1
Core(s) per socket:  8
Socket(s):           1
NUMA node(s):        1
Vendor ID:           GenuineIntel
CPU family:          6
Model:               158
Model name:          Intel(R) Core(TM) i7-9700K CPU @ 3.60GHz
Stepping:            13
CPU MHz:             817.731
CPU max MHz:         4900.0000
CPU min MHz:         800.0000
BogoMIPS:            7200.00
Virtualization:      VT-x
L1d cache:           32K
L1i cache:           32K
L2 cache:            256K
L3 cache:            12288K
NUMA node0 CPU(s):   0-7
Flags:               fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault invpcid_single ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid mpx rdseed adx smap clflushopt intel_pt xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp md_clear flush_l1d arch_capabilities

Please advice

ALWAYS malloc(): corrupted top size ? Why?

I'm using Ubuntu 20.04 with 1050Ti ...

I0820 16:29:18.967516 516025 imageSkyDetector.cpp:182] ---- hd_test.png ---- 1.90623s
malloc(): corrupted top size
*** Aborted at 1597966163 (unix time) try "date -d @1597966163" if you are using GNU date ***
PC: @     0x7f44642e718b gsignal
*** SIGABRT (@0x3e80007dfb9) received by PID 516025 (TID 0x7f445ff2da40) from PID 516025; stack trace: ***
    @     0x7f44654b0631 (unknown)
    @     0x7f44642e7210 (unknown)
    @     0x7f44642e718b gsignal
    @     0x7f44642c6859 abort
    @     0x7f44643313ee (unknown)
    @     0x7f446433947c (unknown)
    @     0x7f446433c83a (unknown)
    @     0x7f446433e419 __libc_malloc
    @     0x7f4464558c29 operator new()
    @     0x7f4464f880b1 cv::cpu_baseline::MulTransposedR<>()
    @     0x7f4464fbbeac cv::mulTransposed()
    @     0x7f4464fc2e47 _ZN2cv15calcCovarMatrixERKNS_11_InputArrayERKNS_12_OutputArrayERKNS_17_InputOutputArrayEii.localalias
    @     0x562725110e04 sky_detector::SkyAreaDetector::refine_border()
    @     0x5627251141fe sky_detector::SkyAreaDetector::extract_sky()
    @     0x562725114f5a sky_detector::SkyAreaDetector::batch_detect()
    @     0x562725107aff main
    @     0x7f44642c80b3 __libc_start_main
    @     0x562725107dae _start
fish: Job 2, “./sky-detector ../data/ ./” terminated by signal SIGABRT (Abort)

I get the following error when I run make -j command

Screenshot from 2019-07-25 12-33-43

And even after installing this package how do I import this sky-detector package in my Python code and use the function for sky detection? Please help me ASAP. I m stuck on this for past 3 days. I have even installed the boost library.

i got different results with the same input images

i used your codes and ran it successfully, using input images in ./data/, but i got sky mask with jagged edges, which is quite different from the smooth sky mask results provided in readme.

So, using the same input images, how could i get the same results as provided in ./data/ ? Any change in code to make ? @MaybeShewill-CV

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.