Multiple FrameDetectors

cpp

#1

Hi,

can I use multiple FrameDetectors in one application? I need to process images from two cameras.

If not, how can I distinguish frames from different cameras being processed by FrameDetector?

Of course there might be a bug in my app right now, but when I try to use two detectors, I get following segmentation fault randomly:

0 __memmove_ssse3_back /usr/lib/debug/lib/x86_64-linux-gnu/libc-2.23.so 131 0x7ffff4ea14e9
1 unsigned char * std::__copy_move<false, true, std::random_access_iterator_tag>::__copy_m(unsigned const char *, unsigned const char *, unsigned char *) 0x7ffff6d1656b
2 unsigned char * std::__copy_move_a<false, unsigned char *, unsigned char *>(unsigned char *, unsigned char *, unsigned char *) 0x7ffff6d156ba
3 unsigned char * std::__copy_move_a2<false, unsigned char *, unsigned char *>(unsigned char *, unsigned char *, unsigned char *) 0x7ffff6d1468d
4 unsigned char * std::copy<unsigned char *, unsigned char *>(unsigned char *, unsigned char *, unsigned char *) 0x7ffff6d12eac
5 Aws::Utils::Array::operator=(Aws::Utils::Array const&) 0x7ffff6d11dfa
6 Aws::Firehose::Model::Record::operator=(Aws::Firehose::Model::Record const&) 0x7ffff6d10f3d
7 Aws::Firehose::Model::Record * std::__copy_move<false, false, std::random_access_iterator_tag>::__copy_m<Aws::Firehose::Model::Record const *, Aws::Firehose::Model::Record *>(Aws::Firehose::Model::Record const *, Aws::Firehose::Model::Record const *, Aws::Firehose::Model::Record *) 0x7ffff6d167c4
8 Aws::Firehose::Model::Record * std::__copy_move_a<false, Aws::Firehose::Model::Record const *, Aws::Firehose::Model::Record *>(Aws::Firehose::Model::Record const *, Aws::Firehose::Model::Record const *, Aws::Firehose::Model::Record *) 0x7ffff6d159f4
9 __gnu_cxx::__normal_iterator<Aws::Firehose::Model::Record *, std::vectorAws::Firehose::Model::Record> std::__copy_move_a2<false, __gnu_cxx::__normal_iterator<Aws::Firehose::Model::Record const *, std::vectorAws::Firehose::Model::Record>, __gnu_cxx::__normal_iterator<Aws::Firehose::Model::Record *, std::vectorAws::Firehose::Model::Record>>(__gnu_cxx::__normal_iterator<Aws::Firehose::Model::Record const *, std::vectorAws::Firehose::Model::Record>, __gnu_cxx::__normal_iterator<Aws::Firehose::Model::Record const *, std::vectorAws::Firehose::Model::Record>, __gnu_cxx::__normal_iterator<Aws::Firehose::Model::Record *, std::vectorAws::Firehose::Model::Record>) 0x7ffff6d14f3f
10 __gnu_cxx::__normal_iterator<Aws::Firehose::Model::Record *, std::vectorAws::Firehose::Model::Record> std::copy<__gnu_cxx::__normal_iterator<Aws::Firehose::Model::Record const *, std::vectorAws::Firehose::Model::Record>, __gnu_cxx::__normal_iterator<Aws::Firehose::Model::Record *, std::vectorAws::Firehose::Model::Record>>(__gnu_cxx::__normal_iterator<Aws::Firehose::Model::Record const *, std::vectorAws::Firehose::Model::Record>, __gnu_cxx::__normal_iterator<Aws::Firehose::Model::Record const *, std::vectorAws::Firehose::Model::Record>, __gnu_cxx::__normal_iterator<Aws::Firehose::Model::Record *, std::vectorAws::Firehose::Model::Record>) 0x7ffff6d13936
11 std::vectorAws::Firehose::Model::Record::operator=(std::vectorAws::Firehose::Model::Record const&) 0x7ffff6d12075
12 Aws::Firehose::Model::PutRecordBatchRequest::SetRecords(std::vectorAws::Firehose::Model::Record const&) 0x7ffff6d10f17
13 affdex::FirehoseAgent::saveRecord(std::string) 0x7ffff6d0ff8e
14 affdex::MultiFaceDetectorBase::getFaces() 0x7ffff6cfac6d
15 affdex::DetectorBase::processResults(affdex::Frame) 0x7ffff6cd3852
16 affdex::AsyncProcessor::bufferConsumer() 0x7ffff6ce5dba
17 void std::_Mem_fn<void (affdex::AsyncProcessor:: *)()>::operator()<, void>(affdex::AsyncProcessor *) const 0x7ffff6ce7849
18 void std::_Bind_simple<std::_Mem_fn<void (affdex::AsyncProcessor:: *)()> (affdex::AsyncProcessor *)>::_M_invoke<0ul>(std::_Index_tuple<0ul>) 0x7ffff6ce7799
19 std::_Bind_simple<std::_Mem_fn<void (affdex::AsyncProcessor:: *)()> (affdex::AsyncProcessor *)>::operator()() 0x7ffff6ce76a1
20 std::thread::_Impl<std::_Bind_simple<std::_Mem_fn<void (affdex::AsyncProcessor:: *)()> (affdex::AsyncProcessor *)>>::_M_run() 0x7ffff6ce763a
21 ?? 0x7ffff53dbc80
22 start_thread /usr/lib/debug/.build-id/27/f189ef8db8c3734c6a678e6ef3cb0b206d58b2.debug 333 0x7ffff4b2d6ba
23 clone /usr/lib/debug/lib/x86_64-linux-gnu/libc-2.23.so 109 0x7ffff4e4a3dd


#2

@przemek_brzosko apologies for the delayed response. The only detector that keeps a track of the camera being used is the CameraDetector. The PhotoDetector and FrameDetector expect a frame to begin processing. The FrameDetector is ideal if you have continuous frames to be processed.

That being said if you plan to use the FrameDetetector then you will have to come up with a mechanism of syncing the frames since each frame should have a unique timestamp associated with it.

The FrameDetector uses the timestamp field of the Frame to keep track of time. Therefore, make sure it is set to a positive number that increases with each subsequent frame passed for processing.

Do each of the initialized instances of FrameDetector processing one of the camera output respectively?


#3

Closing for lack of activity.


#4