Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > VapourSynth

Closed Thread
 
Thread Tools Search this Thread Display Modes
Old 21st May 2015, 17:51   #1  |  Link
HolyWu
Registered User
 
Join Date: Aug 2006
Location: Taiwan
Posts: 392
TCanny

https://github.com/HomeOfVapourSynth...urSynth-TCanny

As the Canny filter in GenericFilters has line shift problem and the plugin is likely to be obsolete, hence here is the port.

Last edited by HolyWu; 13th May 2016 at 14:53.
HolyWu is offline  
Old 21st May 2015, 19:38   #2  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,580
Quote:
Originally Posted by HolyWu View Post
TCanny-r1.7z
https://github.com/HomeOfVapourSynth...urSynth-TCanny

As the Canny filter in GenericFilters has line shift problem and the plugin is likely to be obsolete, hence here is the port.
I do plan to make canny a part of the core. Just need a bit of time to write a sane implementation. The old one isn't going away until then...
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is online now  
Old 28th June 2015, 07:12   #3  |  Link
HolyWu
Registered User
 
Join Date: Aug 2006
Location: Taiwan
Posts: 392
Update r2.
  • Skip direction calculation for mode=1.
  • Add op parameter.

Update r3.
  • Add "gaussian blur only" mode.
  • Support 32-bit float input.
HolyWu is offline  
Old 13th May 2016, 14:59   #4  |  Link
HolyWu
Registered User
 
Join Date: Aug 2006
Location: Taiwan
Posts: 392
Update r4.
  • The parameter value is now scaled in a saner way.
  • Speed up gaussian blur's code and add SIMD optimization.

Update r5.
  • Fix an error in SIMD code of the Sobel operator.
HolyWu is offline  
Old 14th August 2016, 10:48   #5  |  Link
HolyWu
Registered User
 
Join Date: Aug 2006
Location: Taiwan
Posts: 392
Update r6.
  • Add the Scharr operator.
  • Remove the nms parameter.
  • Optimize the gaussian blur function.
  • Vectorize the non-maximum suppression function.
  • Vectorize the output functions of mode -1, 0 and 1.
  • Now uses per thread buffer allocation instead of per frame.
HolyWu is offline  
Old 14th August 2016, 14:01   #6  |  Link
Mystery Keeper
Beyond Kawaii
 
Mystery Keeper's Avatar
 
Join Date: Feb 2008
Location: Russia
Posts: 724
Thank you for your great work. Could you please not make several libs, but instead do CPU detection in plugin initialization and choose the best available optimizations?
__________________
...desu!
Mystery Keeper is offline  
Old 26th August 2016, 09:40   #7  |  Link
HolyWu
Registered User
 
Join Date: Aug 2006
Location: Taiwan
Posts: 392
Quote:
Originally Posted by Mystery Keeper View Post
Thank you for your great work. Could you please not make several libs, but instead do CPU detection in plugin initialization and choose the best available optimizations?
Done in r7 and added opt parameter.
HolyWu is offline  
Old 26th August 2016, 14:26   #8  |  Link
Mystery Keeper
Beyond Kawaii
 
Mystery Keeper's Avatar
 
Join Date: Feb 2008
Location: Russia
Posts: 724
Great! Thank you very much!
__________________
...desu!
Mystery Keeper is offline  
Old 10th September 2016, 17:11   #9  |  Link
HolyWu
Registered User
 
Join Date: Aug 2006
Location: Taiwan
Posts: 392
Update r8.
  • Change sigma parameter to array type.
HolyWu is offline  
Old 11th September 2016, 00:50   #10  |  Link
hydra3333
Registered User
 
Join Date: Oct 2009
Location: crow-land
Posts: 543
Thank you.
hydra3333 is offline  
Old 19th September 2016, 22:20   #11  |  Link
groucho86
Registered User
 
Join Date: Apr 2016
Posts: 85
I'm unable to compile on OS X (10.9.5). I'm using default autogen.sh + configure.

I get the following error:
Code:
  CXX      TCanny/TCanny.lo
error: invalid value 'c++14' in '-std=c++14'
make: *** [TCanny/TCanny.lo] Error 1
groucho86 is offline  
Old 19th September 2016, 23:37   #12  |  Link
Are_
Registered User
 
Join Date: Jun 2012
Location: Ibiza, Spain
Posts: 322
Outdated compiler (almost sure).
Are_ is offline  
Old 19th September 2016, 23:55   #13  |  Link
groucho86
Registered User
 
Join Date: Apr 2016
Posts: 85
Code:
g++ --version
gives me:
Code:
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin13.4.0
Thread model: posix
I'll see if I can upgrade.
groucho86 is offline  
Old 1st March 2017, 10:28   #14  |  Link
KingLir
Registered User
 
Join Date: Jan 2017
Posts: 146
I am getting the following errors when building on macOS, after autogen and configure. Anyone can assist ?

$ g++ --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin16.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

$ make
TCanny/TCanny.cpp:579:27: error: implicit instantiation of undefined template
'std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> >'
throw std::string { "malloc failure (buffer)" };
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iosfwd:193:33: note:
template is declared here
class _LIBCPP_TYPE_VIS_ONLY basic_string;
^
TCanny/TCanny.cpp:586:27: error: implicit instantiation of undefined template
'std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> >'
throw std::string { "malloc failure (blur)" };
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iosfwd:193:33: note:
template is declared here
class _LIBCPP_TYPE_VIS_ONLY basic_string;
^
TCanny/TCanny.cpp:594:31: error: implicit instantiation of undefined template
'std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> >'
throw std::string { "malloc failure (gradient)" };
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iosfwd:193:33: note:
template is declared here
class _LIBCPP_TYPE_VIS_ONLY basic_string;
^
TCanny/TCanny.cpp:605:31: error: implicit instantiation of undefined template
'std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> >'
throw std::string { "malloc failure (direction)" };
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iosfwd:193:33: note:
template is declared here
class _LIBCPP_TYPE_VIS_ONLY basic_string;
^
TCanny/TCanny.cpp:616:31: error: implicit instantiation of undefined template
'std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> >'
throw std::string { "malloc failure (label)" };
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iosfwd:193:33: note:
template is declared here
class _LIBCPP_TYPE_VIS_ONLY basic_string;
^
TCanny/TCanny.cpp:622:38: error: implicit instantiation of undefined template
'std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> >'
} catch (const std::string & error) {
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iosfwd:193:33: note:
template is declared here
class _LIBCPP_TYPE_VIS_ONLY basic_string;
^
TCanny/TCanny.cpp:681:19: error: implicit instantiation of undefined template
'std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> >'
throw std::string { "only constant format 8-16 bits integer ...
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iosfwd:193:33: note:
template is declared here
class _LIBCPP_TYPE_VIS_ONLY basic_string;
^
TCanny/TCanny.cpp:684:19: error: implicit instantiation of undefined template
'std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> >'
throw std::string { "the clip's height must be greater than ...
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iosfwd:193:33: note:
template is declared here
class _LIBCPP_TYPE_VIS_ONLY basic_string;
^
TCanny/TCanny.cpp:688:19: error: implicit instantiation of undefined template
'std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> >'
throw std::string { "more sigma given than the number of planes" };
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iosfwd:193:33: note:
template is declared here
class _LIBCPP_TYPE_VIS_ONLY basic_string;
^
TCanny/TCanny.cpp:728:23: error: implicit instantiation of undefined template
'std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> >'
throw std::string { "sigma must be greater than or equa...
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iosfwd:193:33: note:
template is declared here
class _LIBCPP_TYPE_VIS_ONLY basic_string;
^
TCanny/TCanny.cpp:732:19: error: implicit instantiation of undefined template
'std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> >'
throw std::string { "t_h must be greater than t_l" };
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iosfwd:193:33: note:
template is declared here
class _LIBCPP_TYPE_VIS_ONLY basic_string;
^
TCanny/TCanny.cpp:735:19: error: implicit instantiation of undefined template
'std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> >'
throw std::string { "mode must be -1, 0, 1, 2 or 3" };
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iosfwd:193:33: note:
template is declared here
class _LIBCPP_TYPE_VIS_ONLY basic_string;
^
TCanny/TCanny.cpp:738:19: error: implicit instantiation of undefined template
'std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> >'
throw std::string { "op must be 0, 1, 2 or 3" };
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iosfwd:193:33: note:
template is declared here
class _LIBCPP_TYPE_VIS_ONLY basic_string;
^
TCanny/TCanny.cpp:741:19: error: implicit instantiation of undefined template
'std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> >'
throw std::string { "gmmax must be greater than or equal to 1.0" };
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iosfwd:193:33: note:
template is declared here
class _LIBCPP_TYPE_VIS_ONLY basic_string;
^
TCanny/TCanny.cpp:744:19: error: implicit instantiation of undefined template
'std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> >'
throw std::string { "opt must be 0, 1, 2, 3 or 4" };
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iosfwd:193:33: note:
template is declared here
class _LIBCPP_TYPE_VIS_ONLY basic_string;
^
TCanny/TCanny.cpp:755:23: error: implicit instantiation of undefined template
'std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> >'
throw std::string { "plane index out of range" };
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iosfwd:193:33: note:
template is declared here
class _LIBCPP_TYPE_VIS_ONLY basic_string;
^
TCanny/TCanny.cpp:758:23: error: implicit instantiation of undefined template
'std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> >'
throw std::string { "plane specified twice" };
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iosfwd:193:33: note:
template is declared here
class _LIBCPP_TYPE_VIS_ONLY basic_string;
^
TCanny/TCanny.cpp:792:27: error: implicit instantiation of undefined template
'std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> >'
throw std::string { "malloc failure (weights)" };
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iosfwd:193:33: note:
template is declared here
class _LIBCPP_TYPE_VIS_ONLY basic_string;
^
TCanny/TCanny.cpp:808:34: error: implicit instantiation of undefined template
'std::__1::basic_string<char, std::__1::char_traits<char>,
std::__1::allocator<char> >'
} catch (const std::string & error) {
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iosfwd:193:33: note:
template is declared here
class _LIBCPP_TYPE_VIS_ONLY basic_string;
^
19 errors generated.
KingLir is offline  
Old 3rd March 2017, 02:53   #15  |  Link
HolyWu
Registered User
 
Join Date: Aug 2006
Location: Taiwan
Posts: 392
Quote:
Originally Posted by KingLir View Post
I am getting the following errors when building on macOS, after autogen and configure. Anyone can assist ?
Try the latest commit. Somehow clang is somewhat stricter than gcc.
HolyWu is offline  
Old 3rd March 2017, 07:32   #16  |  Link
KingLir
Registered User
 
Join Date: Jan 2017
Posts: 146
Quote:
Originally Posted by HolyWu View Post
Try the latest commit. Somehow clang is somewhat stricter than gcc.
Thanks. It's seems to fix the previous issues. Now getting:

CXXLD libtcanny.la
Undefined symbols for architecture x86_64:
"binarizeCE<float>", referenced from:
tcannyCreate(VSMap const*, VSMap*, void*, VSCore*, VSAPI const*) in TCanny.o
tcannyGetFrame(int, int, void**, void**, VSFrameContext*, VSCore*, VSAPI const*) in TCanny.o
"binarizeCE<unsigned char>", referenced from:
tcannyCreate(VSMap const*, VSMap*, void*, VSCore*, VSAPI const*) in TCanny.o
tcannyGetFrame(int, int, void**, void**, VSFrameContext*, VSCore*, VSAPI const*) in TCanny.o
"binarizeCE<unsigned short>", referenced from:
tcannyCreate(VSMap const*, VSMap*, void*, VSCore*, VSAPI const*) in TCanny.o
tcannyGetFrame(int, int, void**, void**, VSFrameContext*, VSCore*, VSAPI const*) in TCanny.o
"discretizeGM<float>", referenced from:
tcannyCreate(VSMap const*, VSMap*, void*, VSCore*, VSAPI const*) in TCanny.o
tcannyGetFrame(int, int, void**, void**, VSFrameContext*, VSCore*, VSAPI const*) in TCanny.o
"discretizeGM<unsigned char>", referenced from:
tcannyCreate(VSMap const*, VSMap*, void*, VSCore*, VSAPI const*) in TCanny.o
tcannyGetFrame(int, int, void**, void**, VSFrameContext*, VSCore*, VSAPI const*) in TCanny.o
"discretizeGM<unsigned short>", referenced from:
tcannyCreate(VSMap const*, VSMap*, void*, VSCore*, VSAPI const*) in TCanny.o
tcannyGetFrame(int, int, void**, void**, VSFrameContext*, VSCore*, VSAPI const*) in TCanny.o
"gaussianBlurVertical<float>", referenced from:
tcannyCreate(VSMap const*, VSMap*, void*, VSCore*, VSAPI const*) in TCanny.o
tcannyGetFrame(int, int, void**, void**, VSFrameContext*, VSCore*, VSAPI const*) in TCanny.o
"gaussianBlurVertical<unsigned char>", referenced from:
tcannyCreate(VSMap const*, VSMap*, void*, VSCore*, VSAPI const*) in TCanny.o
tcannyGetFrame(int, int, void**, void**, VSFrameContext*, VSCore*, VSAPI const*) in TCanny.o
"gaussianBlurVertical<unsigned short>", referenced from:
tcannyCreate(VSMap const*, VSMap*, void*, VSCore*, VSAPI const*) in TCanny.o
tcannyGetFrame(int, int, void**, void**, VSFrameContext*, VSCore*, VSAPI const*) in TCanny.o
"copyData<float>", referenced from:
tcannyCreate(VSMap const*, VSMap*, void*, VSCore*, VSAPI const*) in TCanny.o
tcannyGetFrame(int, int, void**, void**, VSFrameContext*, VSCore*, VSAPI const*) in TCanny.o
"copyData<unsigned char>", referenced from:
tcannyCreate(VSMap const*, VSMap*, void*, VSCore*, VSAPI const*) in TCanny.o
tcannyGetFrame(int, int, void**, void**, VSFrameContext*, VSCore*, VSAPI const*) in TCanny.o
"copyData<unsigned short>", referenced from:
tcannyCreate(VSMap const*, VSMap*, void*, VSCore*, VSAPI const*) in TCanny.o
tcannyGetFrame(int, int, void**, void**, VSFrameContext*, VSCore*, VSAPI const*) in TCanny.o
"outputGB<float>", referenced from:
tcannyCreate(VSMap const*, VSMap*, void*, VSCore*, VSAPI const*) in TCanny.o
tcannyGetFrame(int, int, void**, void**, VSFrameContext*, VSCore*, VSAPI const*) in TCanny.o
"outputGB<unsigned char>", referenced from:
tcannyCreate(VSMap const*, VSMap*, void*, VSCore*, VSAPI const*) in TCanny.o
tcannyGetFrame(int, int, void**, void**, VSFrameContext*, VSCore*, VSAPI const*) in TCanny.o
"outputGB<unsigned short>", referenced from:
tcannyCreate(VSMap const*, VSMap*, void*, VSCore*, VSAPI const*) in TCanny.o
tcannyGetFrame(int, int, void**, void**, VSFrameContext*, VSCore*, VSAPI const*) in TCanny.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
KingLir is offline  
Old 3rd March 2017, 14:01   #17  |  Link
HolyWu
Registered User
 
Join Date: Aug 2006
Location: Taiwan
Posts: 392
Quote:
Originally Posted by KingLir View Post
Thanks. It's seems to fix the previous issues. Now getting:

ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Does it make any difference if you use clang++ instead of clang for compilation and linking?
HolyWu is offline  
Old 3rd March 2017, 15:13   #18  |  Link
KingLir
Registered User
 
Join Date: Jan 2017
Posts: 146
Quote:
Originally Posted by HolyWu View Post
Does it make any difference if you use clang++ instead of clang for compilation and linking?
This is what I have:
$ clang --version
Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin16.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

You want me to test something else ? What exactly to change in configure ?
KingLir is offline  
Old 3rd March 2017, 15:30   #19  |  Link
Are_
Registered User
 
Join Date: Jun 2012
Location: Ibiza, Spain
Posts: 322
Code:
CC=clang CXX=clang++ ./configure
make V=1
That make switch will give better output for debugging your problem.

Oh, and it is usually better if you paste your _full_ log and your _full_ configure log when you want assistance with stuff like that (with some paste-site instead of raw printing it in the forums).

Last edited by Are_; 3rd March 2017 at 15:41.
Are_ is offline  
Old 3rd March 2017, 16:15   #20  |  Link
KingLir
Registered User
 
Join Date: Jan 2017
Posts: 146
Quote:
Originally Posted by Are_ View Post
Code:
CC=clang CXX=clang++ ./configure
make V=1
That make switch will give better output for debugging your problem.

Oh, and it is usually better if you paste your _full_ log and your _full_ configure log when you want assistance with stuff like that (with some paste-site instead of raw printing it in the forums).
Thanks and sorry for not doing it before. Here are the new logs:
http://pastebin.com/KLWSV1ZH
KingLir is offline  
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:08.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.