projects
/
goodguy
/
history.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
sams icons, changed with-findobj to with-opencv, added plugins flowobj, gaborobj
[goodguy/history.git]
/
cinelerra-5.1
/
plugins
/
findobj
/
findobj.C
diff --git
a/cinelerra-5.1/plugins/findobject/findobject.C
b/cinelerra-5.1/plugins/findobj/findobj.C
similarity index 89%
rename from
cinelerra-5.1/plugins/findobject/findobject.C
rename to
cinelerra-5.1/plugins/findobj/findobj.C
index c19226fed19fb247e647aed13dda4af98b8141e1..70fc9b3f260ded07d8789f78ec22eb7ccb66a506 100644
(file)
--- a/
cinelerra-5.1/plugins/findobject/findobject.C
+++ b/
cinelerra-5.1/plugins/findobj/findobj.C
@@
-23,8
+23,8
@@
#include "clip.h"
#include "filexml.h"
#include "language.h"
#include "clip.h"
#include "filexml.h"
#include "language.h"
-#include "findobj
ect
.h"
-#include "findobj
ect
window.h"
+#include "findobj.h"
+#include "findobjwindow.h"
#include "mutex.h"
#include "overlayframe.h"
#include "mutex.h"
#include "overlayframe.h"
@@
-32,9
+32,9
@@
#include <exception>
#include <unistd.h>
#include <exception>
#include <unistd.h>
-REGISTER_PLUGIN(FindObj
ect
Main)
+REGISTER_PLUGIN(FindObjMain)
-FindObj
ectConfig::FindObject
Config()
+FindObj
Config::FindObj
Config()
{
algorithm = NO_ALGORITHM;
use_flann = 1;
{
algorithm = NO_ALGORITHM;
use_flann = 1;
@@
-52,7
+52,7
@@
FindObjectConfig::FindObjectConfig()
blend = 100;
}
blend = 100;
}
-void FindObj
ect
Config::boundaries()
+void FindObjConfig::boundaries()
{
bclamp(object_x, 0, 100); bclamp(object_y, 0, 100);
bclamp(object_w, 0, 100); bclamp(object_h, 0, 100);
{
bclamp(object_x, 0, 100); bclamp(object_y, 0, 100);
bclamp(object_w, 0, 100); bclamp(object_h, 0, 100);
@@
-64,7
+64,7
@@
void FindObjectConfig::boundaries()
bclamp(blend, MIN_BLEND, MAX_BLEND);
}
bclamp(blend, MIN_BLEND, MAX_BLEND);
}
-int FindObj
ectConfig::equivalent(FindObject
Config &that)
+int FindObj
Config::equivalent(FindObj
Config &that)
{
int result =
algorithm == that.algorithm &&
{
int result =
algorithm == that.algorithm &&
@@
-84,7
+84,7
@@
int FindObjectConfig::equivalent(FindObjectConfig &that)
return result;
}
return result;
}
-void FindObj
ectConfig::copy_from(FindObject
Config &that)
+void FindObj
Config::copy_from(FindObj
Config &that)
{
algorithm = that.algorithm;
use_flann = that.use_flann;
{
algorithm = that.algorithm;
use_flann = that.use_flann;
@@
-102,14
+102,14
@@
void FindObjectConfig::copy_from(FindObjectConfig &that)
blend = that.blend;
}
blend = that.blend;
}
-void FindObj
ectConfig::interpolate(FindObjectConfig &prev, FindObject
Config &next,
+void FindObj
Config::interpolate(FindObjConfig &prev, FindObj
Config &next,
int64_t prev_frame, int64_t next_frame, int64_t current_frame)
{
copy_from(prev);
}
int64_t prev_frame, int64_t next_frame, int64_t current_frame)
{
copy_from(prev);
}
-FindObj
ectMain::FindObject
Main(PluginServer *server)
+FindObj
Main::FindObj
Main(PluginServer *server)
: PluginVClient(server)
{
affine = 0;
: PluginVClient(server)
{
affine = 0;
@@
-139,26
+139,26
@@
FindObjectMain::FindObjectMain(PluginServer *server)
init_border = 1;
}
init_border = 1;
}
-FindObj
ectMain::~FindObject
Main()
+FindObj
Main::~FindObj
Main()
{
delete affine;
delete overlayer;
}
{
delete affine;
delete overlayer;
}
-const char* FindObj
ect
Main::plugin_title() { return _("Find Object"); }
-int FindObj
ect
Main::is_realtime() { return 1; }
-int FindObj
ect
Main::is_multichannel() { return 1; }
+const char* FindObjMain::plugin_title() { return _("Find Object"); }
+int FindObjMain::is_realtime() { return 1; }
+int FindObjMain::is_multichannel() { return 1; }
-NEW_WINDOW_MACRO(FindObj
ectMain, FindObject
Window)
-LOAD_CONFIGURATION_MACRO(FindObj
ectMain, FindObject
Config)
+NEW_WINDOW_MACRO(FindObj
Main, FindObj
Window)
+LOAD_CONFIGURATION_MACRO(FindObj
Main, FindObj
Config)
-void FindObj
ect
Main::update_gui()
+void FindObjMain::update_gui()
{
if( !thread ) return;
if( !load_configuration() ) return;
{
if( !thread ) return;
if( !load_configuration() ) return;
- FindObj
ectWindow *window = (FindObject
Window*)thread->window;
- window->lock_window("FindObj
ect
Main::update_gui");
- window->algorithm->set_text(FindObj
ect
Algorithm::to_text(config.algorithm));
+ FindObj
Window *window = (FindObj
Window*)thread->window;
+ window->lock_window("FindObjMain::update_gui");
+ window->algorithm->set_text(FindObjAlgorithm::to_text(config.algorithm));
window->use_flann->update(config.use_flann);
window->object_x->update(config.object_x);
window->object_x_text->update((float)config.object_x);
window->use_flann->update(config.use_flann);
window->object_x->update(config.object_x);
window->object_x_text->update((float)config.object_x);
@@
-188,13
+188,13
@@
void FindObjectMain::update_gui()
window->unlock_window();
}
window->unlock_window();
}
-void FindObj
ect
Main::save_data(KeyFrame *keyframe)
+void FindObjMain::save_data(KeyFrame *keyframe)
{
FileXML output;
// cause data to be stored directly in text
output.set_shared_output(keyframe->get_data(), MESSAGESIZE);
{
FileXML output;
// cause data to be stored directly in text
output.set_shared_output(keyframe->get_data(), MESSAGESIZE);
- output.tag.set_title("FINDOBJ
ECT
");
+ output.tag.set_title("FINDOBJ");
output.tag.set_property("ALGORITHM", config.algorithm);
output.tag.set_property("USE_FLANN", config.use_flann);
output.tag.set_property("OBJECT_X", config.object_x);
output.tag.set_property("ALGORITHM", config.algorithm);
output.tag.set_property("USE_FLANN", config.use_flann);
output.tag.set_property("OBJECT_X", config.object_x);
@@
-214,13
+214,13
@@
void FindObjectMain::save_data(KeyFrame *keyframe)
output.tag.set_property("SCENE_LAYER", config.scene_layer);
output.tag.set_property("BLEND", config.blend);
output.append_tag();
output.tag.set_property("SCENE_LAYER", config.scene_layer);
output.tag.set_property("BLEND", config.blend);
output.append_tag();
- output.tag.set_title("/FINDOBJ
ECT
");
+ output.tag.set_title("/FINDOBJ");
output.append_tag();
output.append_newline();
output.terminate_string();
}
output.append_tag();
output.append_newline();
output.terminate_string();
}
-void FindObj
ect
Main::read_data(KeyFrame *keyframe)
+void FindObjMain::read_data(KeyFrame *keyframe)
{
FileXML input;
{
FileXML input;
@@
-229,7
+229,7
@@
void FindObjectMain::read_data(KeyFrame *keyframe)
int result = 0;
while( !(result = input.read_tag()) ) {
int result = 0;
while( !(result = input.read_tag()) ) {
- if( input.tag.title_is("FINDOBJ
ECT
") ) {
+ if( input.tag.title_is("FINDOBJ") ) {
config.algorithm = input.tag.get_property("ALGORITHM", config.algorithm);
config.use_flann = input.tag.get_property("USE_FLANN", config.use_flann);
config.object_x = input.tag.get_property("OBJECT_X", config.object_x);
config.algorithm = input.tag.get_property("ALGORITHM", config.algorithm);
config.use_flann = input.tag.get_property("USE_FLANN", config.use_flann);
config.object_x = input.tag.get_property("OBJECT_X", config.object_x);
@@
-254,12
+254,12
@@
void FindObjectMain::read_data(KeyFrame *keyframe)
config.boundaries();
}
config.boundaries();
}
-void FindObj
ect
Main::draw_line(VFrame *vframe, int x1, int y1, int x2, int y2)
+void FindObjMain::draw_line(VFrame *vframe, int x1, int y1, int x2, int y2)
{
vframe->draw_line(x1, y1, x2, y2);
}
{
vframe->draw_line(x1, y1, x2, y2);
}
-void FindObj
ect
Main::draw_rect(VFrame *vframe, int x1, int y1, int x2, int y2)
+void FindObjMain::draw_rect(VFrame *vframe, int x1, int y1, int x2, int y2)
{
draw_line(vframe, x1, y1, x2, y1);
draw_line(vframe, x2, y1 + 1, x2, y2);
{
draw_line(vframe, x1, y1, x2, y1);
draw_line(vframe, x2, y1 + 1, x2, y2);
@@
-267,7
+267,7
@@
void FindObjectMain::draw_rect(VFrame *vframe, int x1, int y1, int x2, int y2)
draw_line(vframe, x1, y2 - 1, x1, y1 + 1);
}
draw_line(vframe, x1, y2 - 1, x1, y1 + 1);
}
-void FindObj
ect
Main::draw_circle(VFrame *vframe, int x, int y, int r)
+void FindObjMain::draw_circle(VFrame *vframe, int x, int y, int r)
{
int x1 = x-r, x2 = x+r;
int y1 = y-r, y2 = y+r;
{
int x1 = x-r, x2 = x+r;
int y1 = y-r, y2 = y+r;
@@
-277,7
+277,7
@@
void FindObjectMain::draw_circle(VFrame *vframe, int x, int y, int r)
vframe->draw_smooth(x,y2, x1,y2, x1,y);
}
vframe->draw_smooth(x,y2, x1,y2, x1,y);
}
-void FindObj
ect
Main::filter_matches(ptV &p1, ptV &p2, double ratio)
+void FindObjMain::filter_matches(ptV &p1, ptV &p2, double ratio)
{
DMatches::iterator it;
for( it=pairs.begin(); it!=pairs.end(); ++it ) {
{
DMatches::iterator it;
for( it=pairs.begin(); it!=pairs.end(); ++it ) {
@@
-289,7
+289,7
@@
void FindObjectMain::filter_matches(ptV &p1, ptV &p2, double ratio)
}
}
}
}
-void FindObj
ect
Main::to_mat(Mat &mat, int mcols, int mrows,
+void FindObjMain::to_mat(Mat &mat, int mcols, int mrows,
VFrame *inp, int ix,int iy, BC_CModel mcolor_model)
{
int mcomp = BC_CModels::components(mcolor_model);
VFrame *inp, int ix,int iy, BC_CModel mcolor_model)
{
int mcomp = BC_CModels::components(mcolor_model);
@@
-316,7
+316,7
@@
void FindObjectMain::to_mat(Mat &mat, int mcols, int mrows,
// vfrm.write_png(vfn);
}
// vfrm.write_png(vfn);
}
-void FindObj
ect
Main::detect(Mat &mat, KeyPointV &keypts,Mat &descrs)
+void FindObjMain::detect(Mat &mat, KeyPointV &keypts,Mat &descrs)
{
keypts.clear();
descrs.release();
{
keypts.clear();
descrs.release();
@@
-325,7
+325,7
@@
void FindObjectMain::detect(Mat &mat, KeyPointV &keypts,Mat &descrs)
} catch(std::exception e) { printf(_("detector exception: %s\n"), e.what()); }
}
} catch(std::exception e) { printf(_("detector exception: %s\n"), e.what()); }
}
-void FindObj
ect
Main::match()
+void FindObjMain::match()
{
pairs.clear();
try {
{
pairs.clear();
try {
@@
-333,7
+333,7
@@
void FindObjectMain::match()
} catch(std::exception e) { printf(_("match execption: %s\n"), e.what()); }
}
} catch(std::exception e) { printf(_("match execption: %s\n"), e.what()); }
}
-Ptr<DescriptorMatcher> FindObj
ect
Main::flann_kdtree_matcher()
+Ptr<DescriptorMatcher> FindObjMain::flann_kdtree_matcher()
{ // trees=5
const Ptr<flann::IndexParams>& indexParams =
makePtr<flann::KDTreeIndexParams>(5);
{ // trees=5
const Ptr<flann::IndexParams>& indexParams =
makePtr<flann::KDTreeIndexParams>(5);
@@
-341,7
+341,7
@@
Ptr<DescriptorMatcher> FindObjectMain::flann_kdtree_matcher()
makePtr<flann::SearchParams>();
return makePtr<FlannBasedMatcher>(indexParams, searchParams);
}
makePtr<flann::SearchParams>();
return makePtr<FlannBasedMatcher>(indexParams, searchParams);
}
-Ptr<DescriptorMatcher> FindObj
ect
Main::flann_lshidx_matcher()
+Ptr<DescriptorMatcher> FindObjMain::flann_lshidx_matcher()
{ // table_number = 6#12, key_size = 12#20, multi_probe_level = 1#2
const Ptr<flann::IndexParams>& indexParams =
makePtr<flann::LshIndexParams>(6, 12, 1);
{ // table_number = 6#12, key_size = 12#20, multi_probe_level = 1#2
const Ptr<flann::IndexParams>& indexParams =
makePtr<flann::LshIndexParams>(6, 12, 1);
@@
-349,17
+349,17
@@
Ptr<DescriptorMatcher> FindObjectMain::flann_lshidx_matcher()
makePtr<flann::SearchParams>();
return makePtr<FlannBasedMatcher>(indexParams, searchParams);
}
makePtr<flann::SearchParams>();
return makePtr<FlannBasedMatcher>(indexParams, searchParams);
}
-Ptr<DescriptorMatcher> FindObj
ect
Main::bf_matcher_norm_l2()
+Ptr<DescriptorMatcher> FindObjMain::bf_matcher_norm_l2()
{
return BFMatcher::create(NORM_L2);
}
{
return BFMatcher::create(NORM_L2);
}
-Ptr<DescriptorMatcher> FindObj
ect
Main::bf_matcher_norm_hamming()
+Ptr<DescriptorMatcher> FindObjMain::bf_matcher_norm_hamming()
{
return BFMatcher::create(NORM_HAMMING);
}
#ifdef _SIFT
{
return BFMatcher::create(NORM_HAMMING);
}
#ifdef _SIFT
-void FindObj
ect
Main::set_sift()
+void FindObjMain::set_sift()
{
cvmodel = BC_GREY8;
detector = SIFT::create();
{
cvmodel = BC_GREY8;
detector = SIFT::create();
@@
-368,7
+368,7
@@
void FindObjectMain::set_sift()
}
#endif
#ifdef _SURF
}
#endif
#ifdef _SURF
-void FindObj
ect
Main::set_surf()
+void FindObjMain::set_surf()
{
cvmodel = BC_GREY8;
detector = SURF::create(800);
{
cvmodel = BC_GREY8;
detector = SURF::create(800);
@@
-377,7
+377,7
@@
void FindObjectMain::set_surf()
}
#endif
#ifdef _ORB
}
#endif
#ifdef _ORB
-void FindObj
ect
Main::set_orb()
+void FindObjMain::set_orb()
{
cvmodel = BC_GREY8;
detector = ORB::create();
{
cvmodel = BC_GREY8;
detector = ORB::create();
@@
-386,7
+386,7
@@
void FindObjectMain::set_orb()
}
#endif
#ifdef _AKAZE
}
#endif
#ifdef _AKAZE
-void FindObj
ect
Main::set_akaze()
+void FindObjMain::set_akaze()
{
cvmodel = BC_GREY8;
detector = AKAZE::create();
{
cvmodel = BC_GREY8;
detector = AKAZE::create();
@@
-395,7
+395,7
@@
void FindObjectMain::set_akaze()
}
#endif
#ifdef _BRISK
}
#endif
#ifdef _BRISK
-void FindObj
ect
Main::set_brisk()
+void FindObjMain::set_brisk()
{
cvmodel = BC_GREY8;
detector = BRISK::create();
{
cvmodel = BC_GREY8;
detector = BRISK::create();
@@
-404,7
+404,7
@@
void FindObjectMain::set_brisk()
}
#endif
}
#endif
-void FindObj
ect
Main::process_match()
+void FindObjMain::process_match()
{
if( config.algorithm == NO_ALGORITHM ) return;
if( !config.replace_object &&
{
if( config.algorithm == NO_ALGORITHM ) return;
if( !config.replace_object &&
@@
-467,7
+467,7
@@
void FindObjectMain::process_match()
// dst[0].x,dst[0].y, dst[1].x,dst[1].y, dst[2].x,dst[2].y, dst[3].x,dst[3].y);
}
// dst[0].x,dst[0].y, dst[1].x,dst[1].y, dst[2].x,dst[2].y, dst[3].x,dst[3].y);
}
-int FindObj
ect
Main::process_buffer(VFrame **frame, int64_t start_position, double frame_rate)
+int FindObjMain::process_buffer(VFrame **frame, int64_t start_position, double frame_rate)
{
int prev_algorithm = config.algorithm;
int prev_use_flann = config.use_flann;
{
int prev_algorithm = config.algorithm;
int prev_use_flann = config.use_flann;