Re: [Cin] New feature: enhanced Motion plugin

2020-09-20 Thread Phyllis Smith via Cin
Andrea, I think we fixed the error you got in the following and checked it
in yesterday.  Let us know if you ever see it again.

On Fri, Sep 18, 2020 at 9:38 AM Andrea paz via Cin <
cin@lists.cinelerra-gg.org> wrote:

> Trying to run the sge test, I loaded tm1.xml. I opened the motion
> plugin window and realized I have "Play every frame" unchecked. L'ho
> attivato. I closed the plugin window (with the warning message in
> red); I reopened it (message in green) and after a couple of seconds I
> had a crash with dump. I did it all again as root and got a crash with
> dump again, which I report in attachment. To be precise the crash
> happens when I move the plugin window to another position. If I don't
> do the checked/unchecked steps of "Play every frame" I don't crash, if
> I do I crash.
> At the terminal there are the following lines, but I always have them,
> not only in this case:
>
> unjoined tids / owner 3
>   7f46e9502640 / 7f484b7fe640 12RenderEngine
>   7f4708540640 / 7f484b7fe640 12RenderEngine
>   7f46fb526640 / 7f47f5ffb640 12RenderEngine
>
> On the occasion of the crash I have:
>
> ** segv at 0x556921190bf4 in pid 179611, tid 179707
> writing debug data to /tmp/cinelerra_179611.dmp
> lock_items: 22
> lock_frees: 7
> ** dump complete
> --
> Cin mailing list
> Cin@lists.cinelerra-gg.org
> https://lists.cinelerra-gg.org/mailman/listinfo/cin
>
-- 
Cin mailing list
Cin@lists.cinelerra-gg.org
https://lists.cinelerra-gg.org/mailman/listinfo/cin


Re: [Cin] New feature: enhanced Motion plugin

2020-09-20 Thread Georgy Salnikov via Cin
On Sat, 19 Sep 2020, Phyllis Smith via Cin wrote:

> checked it into GIT.  Andrea volunteered to remake the motion.png in the
> Cakewalk theme because it was suggested that all of the images be in the
> same theme so as not to confuse "new users".  Some of us "old users" like
> me have their preferred themes and I refuse to switch !  I have not updated

In principle, I did not even mentioned to include the GUI screenshot into
the manual. I meant, while editing manual a programmer could prefer to
quickly look on such an image, how exactly some GUI controls are called
there. Without the need to rebild and start the whole software.

Of course, if ever insert such a picture in the manual, it should be made
under the standard theme used throughout the manual.

Somewhen I tried also to force myself to switch to the new theme, and this
trial was unsuccessful to me;-)

> > GG thinks it is probably OK to eliminate Motion CV and HV as it really
> does confuse things.  But I just do not know if there are users out there
> who have existing projects that may be using them.

As an intermediate measure, it might be possible to comment out the
redundant plugins from plugin_defs but leave for some transition time in the
source distribution.
___

Georgy Salnikov
NMR Group
Novosibirsk Institute of Organic Chemistry
Lavrentjeva, 9, 630090 Novosibirsk, Russia
Phone   +7-383-3307864
Email   s...@nmr.nioch.nsc.ru
___

-- 
Cin mailing list
Cin@lists.cinelerra-gg.org
https://lists.cinelerra-gg.org/mailman/listinfo/cin


Re: [Cin] New feature: enhanced Motion plugin

2020-09-19 Thread Georgy Salnikov via Cin
On Fri, 18 Sep 2020, Andrea paz via Cin wrote:

> I have integrated your additions on the latex manual. Now Phyllis will

Thank you very much. I've read and made some corrections. Mostly cosmetic
ones, like italicizing the names of GUI controls. Some were my own typos,
sorry.

The patch against the Plugins.tex version you sent yesterday is in
attachment. I've also attached a screenshot of the GUI.

> I saw that you brought "Add offset" on Motion plugin, so you could
> delete Motion-CV. I think Motion-HV has some recent optimizations
> (2017). Do you think you can delete Motion-HV too or is it better to
> leave it? What about Motion 2 Points?

Motion 2 Points and Motion51 implement totally different tracking methods,
they must definitely remain here.

What about MotionCV and MotionHV, I am not sure. One has to inspect their
code. I know, MotionCV has an extra parameters pair, Rotation block size,
which does not exist in the Motion plugin. It would be easy to implement it,
but I am unsure, whether the distinct rotation match block is really needed.
Perhaps I can say later more concretely about the difference, or may be GG
remembers.

Earlier I used to apply motion stabilization (in Cinelerra-HV) for low
quality video, but as of CinelerraHV-6 the plugin became broken. Recently I
have imagined to extract the working plugin from CinelerraHV-4.6.1 and adapt
it for Cin-GG, but there was the same problem. I tried firstly several
tricks, none of them seemed to help. After some deeper debugging I've found,
that the problem was not in the plugin, but in the affine interpolation (my
bug report two months ago). After affine bugfix the plugin worked again, as
earlier. However, it would be sorry wasted time, so I considered to finalize
my hacks no matter what...

Georgy
___

Georgy Salnikov
NMR Group
Novosibirsk Institute of Organic Chemistry
Lavrentjeva, 9, 630090 Novosibirsk, Russia
Phone   +7-383-3307864
Email   s...@nmr.nioch.nsc.ru
___


motion.png
Description: Binary data


Plugins.tex.diff.gz
Description: Binary data
-- 
Cin mailing list
Cin@lists.cinelerra-gg.org
https://lists.cinelerra-gg.org/mailman/listinfo/cin


Re: [Cin] New feature: enhanced Motion plugin

2020-09-18 Thread Phyllis Smith via Cin
Andrea

> I saw that you brought "Add offset" on Motion plugin, so you could
> delete Motion-CV. I think Motion-HV has some recent optimizations
> (2017). Do you think you can delete Motion-HV too or is it better to
> leave it? What about Motion 2 Points?
>
I think it is a good idea to delete Motion-CV/HV but I am concerned about
old currently existing projects that may be using them -- I will ask GG
what he thinks.  Motion 2 Points should stay as it actually does something
different.

Plus I was able to easily duplicate your crash so GG can debug that this
afternoon.  Thank you for the Manual updates provided by SGE -- I will
review the english this afternoon also.
-- 
Cin mailing list
Cin@lists.cinelerra-gg.org
https://lists.cinelerra-gg.org/mailman/listinfo/cin


Re: [Cin] New feature: enhanced Motion plugin

2020-09-18 Thread Andrea paz via Cin
Trying to run the sge test, I loaded tm1.xml. I opened the motion
plugin window and realized I have "Play every frame" unchecked. L'ho
attivato. I closed the plugin window (with the warning message in
red); I reopened it (message in green) and after a couple of seconds I
had a crash with dump. I did it all again as root and got a crash with
dump again, which I report in attachment. To be precise the crash
happens when I move the plugin window to another position. If I don't
do the checked/unchecked steps of "Play every frame" I don't crash, if
I do I crash.
At the terminal there are the following lines, but I always have them,
not only in this case:

unjoined tids / owner 3
  7f46e9502640 / 7f484b7fe640 12RenderEngine
  7f4708540640 / 7f484b7fe640 12RenderEngine
  7f46fb526640 / 7f47f5ffb640 12RenderEngine

On the occasion of the crash I have:

** segv at 0x556921190bf4 in pid 179611, tid 179707
writing debug data to /tmp/cinelerra_179611.dmp
lock_items: 22
lock_frees: 7
** dump complete
-- 
Cin mailing list
Cin@lists.cinelerra-gg.org
https://lists.cinelerra-gg.org/mailman/listinfo/cin


Re: [Cin] New feature: enhanced Motion plugin

2020-09-18 Thread Andrea paz via Cin
Great job! It is really a valuable contribution, on a plugin that is
little used because of its complexity.
I have integrated your additions on the latex manual. Now Phyllis will
do a review and put it on git.
I saw that you brought "Add offset" on Motion plugin, so you could
delete Motion-CV. I think Motion-HV has some recent optimizations
(2017). Do you think you can delete Motion-HV too or is it better to
leave it? What about Motion 2 Points?


Plugins.tar.gz
Description: application/gzip
-- 
Cin mailing list
Cin@lists.cinelerra-gg.org
https://lists.cinelerra-gg.org/mailman/listinfo/cin


Re: [Cin] New feature: enhanced Motion plugin

2020-09-18 Thread Igor BEGHETTO via Cin

Great job, Georgy!
If you have a few of time, could you make a screencast (a short demo), 
please? It would be fine to see.

Thanks.

IgorBeg


Il 17/09/2020 17:25, Georgy Salnikov via Cin ha scritto:

Hi all who might be interested in motion tracking,

I just posted the new feature on bugtracker as BT509: enhanced Motion
plugin. ...

--
Cin mailing list
Cin@lists.cinelerra-gg.org
https://lists.cinelerra-gg.org/mailman/listinfo/cin


[Cin] New feature: enhanced Motion plugin

2020-09-17 Thread Georgy Salnikov via Cin
Hi all who might be interested in motion tracking,

I just posted the new feature on bugtracker as BT509: enhanced Motion
plugin. The archive with modified source files of this plugin is also
attached to this mail. Another archive to test the new features and compare
with the old plugin behavior can be downloaded from bugtracker:

https://www.cinelerra-gg.org/bugtracker/file_download.php?file_id=659=bug

Should somebody need, I can send it extra, it is about 2.5Mb.

To Andrea: if the Boss accepts the suggested features, changes for the
manual are at the end of this email.

As there are too many diffs, it would not be convenient to make a patch, so
I packed in the archive motion-src.tar.gz the complete motion plugin
directory.  It is to be unpacked in cinelerra-5.1/plugins.  If one uses the
new version with all the new parameters switched off (or zeroed), the plugin
will function exactly as the old one.  Therefore I expect, that creation of
one more plugin (there exist already a few!) leaving the older one intact
would be redundant.

The old version of plugin "Motion" is subject to the following problem.

When tracking previous frame during a long clip, tracking may be inaccurate
because of error propagation between frames.  Such accumulation of errors
can become significant.

But when tracking single frame, both translation and rotation, a large
rotation can induce significant inaccuracies while comparing match blocks in
the translation calculation.  It can happen that the strongly tilted block
can give the least difference from the reference one at the wrong
coordinates.  And the following rotation calculation will be also inaccurate
because the translation vector has been calculated incorrectly.

Ideally, the rotation search should be carried out at every checked
translation position, but such an algorithm would be inacceptably slow.

I implemented another way of solving this problem.

Motion tracking calculates translation, then rotation. Both can be
inaccurate because of a large rotation of the picture, but both are better
than no calculation at all.

Then the motion tracking pass (translation followed by rotation) is repeated
once again, starting with the motion vector and rotation angle calculated at
the first pass.  I call this the refinement pass.

If motion tracker (during the first pass) tends to wildly spring away
because of interference of strong rotation of the picture, the new
parameters "Motion noise level" and "Rotation noise level" can help.

If the user does not activate the two pass tracking feature via the new
controls in the effect GUI, and leaves both noise levels at zero percent,
the motion tracker will function in just the same manner as before.

How to test the new feature.

Unpack attached archive motion-test.tar.gz from bugtracker:

https://www.cinelerra-gg.org/bugtracker/file_download.php?file_id=659=bug

run cin and open project tm1.xml from this archive (with the video clip
test1.m4v, also from this archive).  Open the Motion plugin dialog.  Most
parameters are already preset with the values listed below.

Track translation ON, Track rotation ON
Translation search radius: 50x50%, Rotation search radius: 25
Translation block size: 52x65%
With Draw vectors ON the block should cover all the geometry objects
Translation search steps: 256, Rotation search steps: 16
Translation direction: Both
Block X: 50%, Block Y: 55%
Both Maximum offsets set to maximum
Both Settling speeds set to 0
Track single frame, Frame number: 0
Add offset from tracked frame OFF
Tracking file: any name; this file should not exist
Action: Do Nothing
Calculation: Save coords to tracking file

Set both Noise levels to zero (when testing under the old unmodified plugin
version - these new parameters did not exist)
Set Two pass tracking to OFF (when testing under the old unmodified plugin
version - this new parameter did not exist)

Now start playback and watch on the match box appearance. With the standard
behavior (noise level zero, two pass tracking off, or under the old
unmodified plugin version where these new features did not exist) you can
notice that after the picture becomes strongly tilted, the geometry figures
will be not exactly in the center of the drawn box, and at some time match
box will even loose the right position totally.  This behavior demonstrates
the Motion plugin problem.

Now build the new version of the plugin (from motion-src.tar.gz), start cin,
open the same project.  Leave all the Motion parameters as listed above,
with two exceptions:

Motion noise level: 18%
Two pass tracking ON

Rotation noise level is set to 2% in the project's xml file, but it can be
zeroed equally well.  Anyway, it must not be big.

Ensure deleting the tracking file from the previous run (now you can do it
via the new handy pushbutton "Clear tracking file contents").

Start playback and watch on the match box appearance. Now you can notice
that the geometry figures remain correctly centered in the drawn box