From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 45C3645886 for ; Sun, 26 Mar 2023 19:34:31 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1DCD768C5BA; Sun, 26 Mar 2023 22:34:30 +0300 (EEST) Received: from mail-ed1-f50.google.com (mail-ed1-f50.google.com [209.85.208.50]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 737DE68C533 for ; Sun, 26 Mar 2023 22:34:23 +0300 (EEST) Received: by mail-ed1-f50.google.com with SMTP id h8so27513227ede.8 for ; Sun, 26 Mar 2023 12:34:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679859262; h=user-agent:in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:to:from:date:from:to:cc:subject :date:message-id:reply-to; bh=1F0qWiynlfEjO4EOfva9jvIVLPxqYFrzNE3+Haq+xgE=; b=hV7bXTVWDtEOstOdgTnNw4YAwonvAe3Cc1FbiRqmz5FfRsVes1OMgz+KsgvucNcau+ de8jGO+sdMnBHbOYKE/t6KbMMTVM50rc7hqQbijd7afkSp4z3ot/Mj8rZEspSi+F4uro ohesnOFFHOy1g7lQIP2yoWy8ej0p4lacliboNXVukO4dqAbqc60riFZWZQvFW2+W1lNF I1Qhlsb7p6ylqOBOmMyOKi74IaqWyG/UpvOarU5iAdgi2HqYJNXm36NKfcztI01aK548 EMRIDdRSz6SdsKzU2aygE4/ZvuvdPKIwzjfNZJ8hY5tCVxB19EHIGqv2ea5MivskC636 cccw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679859262; h=user-agent:in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:to:from:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=1F0qWiynlfEjO4EOfva9jvIVLPxqYFrzNE3+Haq+xgE=; b=EuGk2BeFVoM12xU/10YYo+W0iK8TwHpC9xWfH9RLxptc2wrvZwVclSeuKKnbF/PDYU u6ZSv70sZWe4Zf3P7cm16USC/InEPZIIWnKHdfUvrmpGkalMuXQV3b0ZiIYh0qy2E/Ni Kie470DZB615S7T01DnbWcakwI8L4yojPvnIG/pEvPm/LGJoN18CUdyPPypRYfbZ0YCm SbXnPXtXiqGO8L+mfnsvXGkZiC02yDbCH1oTVexMRSRjHlm4D0aW6jOefiF3JDOZBIVI uqBSUuWFCG14TZt2j07Xg9vwQG9B7Rm+g6/Sm5i+fSCOxl3Ws6c9NcJFnGYqlp+U2K6X xM5g== X-Gm-Message-State: AAQBX9feYumHimWypoz/49WbwiZSs2LVb8CUqqaV+d6oJXuPOXwnOKNY ymmZbO//V5Unl8vxAoA5WaYRV0q9aQI= X-Google-Smtp-Source: AKy350bE28E3L08w1pT59K5gc5Vy+yWdDOerDotE4FoV/gyr57Z5152Bzj696n12tYvACOp0M0VCqg== X-Received: by 2002:a17:906:8398:b0:900:a150:cea3 with SMTP id p24-20020a170906839800b00900a150cea3mr9391294ejx.9.1679859262290; Sun, 26 Mar 2023 12:34:22 -0700 (PDT) Received: from mariano (dynamic-adsl-62-10-98-143.clienti.tiscali.it. [62.10.98.143]) by smtp.gmail.com with ESMTPSA id e3-20020a170906504300b00930c6c01c9esm13523542ejk.143.2023.03.26.12.34.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Mar 2023 12:34:21 -0700 (PDT) Received: by mariano (Postfix, from userid 1000) id 5C3CCBFB73; Sun, 26 Mar 2023 21:34:20 +0200 (CEST) Date: Sun, 26 Mar 2023 21:34:20 +0200 From: Stefano Sabatini To: FFmpeg development discussions and patches Message-ID: <20230326193420.GF26811@mariano> Mail-Followup-To: FFmpeg development discussions and patches References: <20230326192244.65852-1-stefasab@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="ZGiS0Q5IWpPtfppv" Content-Disposition: inline In-Reply-To: <20230326192244.65852-1-stefasab@gmail.com> User-Agent: Mutt/1.13.2 (2019-12-18) Subject: Re: [FFmpeg-devel] [PATCH] doc/filters/find_rect: extend documentation X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --ZGiS0Q5IWpPtfppv Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On date Sunday 2023-03-26 21:22:44 +0200, Stefano Sabatini wrote: > Document metadata entries set by the filter, extend and clarify > options, add additional example showing how to extract the generated > data. > > Fix issue: > http://trac.ffmpeg.org/ticket/8766 > --- > doc/filters.texi | 41 +++++++++++++++++++++++++++++++++++++++-- > 1 file changed, 39 insertions(+), 2 deletions(-) Up with more details about the score. --ZGiS0Q5IWpPtfppv Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0001-doc-filters-find_rect-extend-documentation.patch" >From 9f6b66f4bb0caa07f97685f4ebddf21ec212386d Mon Sep 17 00:00:00 2001 From: Stefano Sabatini Date: Sun, 26 Mar 2023 21:21:50 +0200 Subject: [PATCH] doc/filters/find_rect: extend documentation Document metadata entries set by the filter, extend and clarify options, add additional example showing how to extract the generated data. Address issue: http://trac.ffmpeg.org/ticket/8766 --- doc/filters.texi | 47 +++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 45 insertions(+), 2 deletions(-) diff --git a/doc/filters.texi b/doc/filters.texi index 1980fa6888..7efb201819 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -13768,7 +13768,35 @@ value. @section find_rect -Find a rectangular object +Find a rectangular object in the input video. + +The object to search for must be specified as a gray8 image specified with the +@option{object} option. + +For each possible match, a score is computed. If the score reaches the specified +threshold, the object is considered found. + +If the input video contains multiple instances of the object, the filter will +find only one of them. + +When an object is found, the following metadata entries are set in the matching +frame: +@table @option +@item lavfi.rect.w +width of object + +@item lavfi.rect.h +height of object + +@item lavfi.rect.x +x position of object + +@item lavfi.rect.y +y position of object + +@item lavfi.rect.score +match score of the found object +@end table It accepts the following options: @@ -13777,7 +13805,12 @@ It accepts the following options: Filepath of the object image, needs to be in gray8. @item threshold -Detection threshold, default is 0.5. +Detection threshold, expressed as a decimal number in the range 0-1. + +A threshold value of 0.01 means only exact matches, a threshold of 0.99 means +almost everything matches. + +Default value is 0.5. @item mipmaps Number of mipmaps, default is 3. @@ -13797,6 +13830,16 @@ Cover a rectangular object by the supplied image of a given video using @command @example ffmpeg -i file.ts -vf find_rect=newref.pgm,cover_rect=cover.jpg:mode=cover new.mkv @end example + +@item +Find the position of an object in each frame using @command{ffprobe} and write +it to a log file: +@example +ffprobe -f lavfi movie=test.mp4,find_rect=object=object.pgm:threshold=0.3 \ + -show_entries frame=pkt_pts_time:frame_tags=lavfi.rect.x,lavfi.rect.y \ + -of csv -o find_rect.csv +@end example + @end itemize @section floodfill -- 2.25.1 --ZGiS0Q5IWpPtfppv Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". --ZGiS0Q5IWpPtfppv--