[{"id":4411,"web_url":"https://patchwork.libcamera.org/comment/4411/","msgid":"<20200407232702.GB1716317@oden.dyn.berto.se>","date":"2020-04-07T23:27:02","subject":"Re: [libcamera-devel] [RFCv2 1/2] libcamera: camera_sensor: Define\n\tCameraSensorInfo","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"content":"Hi Jacopo,\n\nThanks for your work.\n\nOver all I like what I see in this patch and I agree with the todo \nitems, nice work.\n\nOn 2020-03-27 12:31:51 +0100, Jacopo Mondi wrote:\n> Define the CameraSensorInfo structure that reports the current image sensor\n> configuration.\n> \n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> ---\n>  src/libcamera/camera_sensor.cpp       | 106 ++++++++++++++++++++++++++\n>  src/libcamera/include/camera_sensor.h |  19 +++++\n>  2 files changed, 125 insertions(+)\n> \n> diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp\n> index 09771fc40bbb..df1d82d29f74 100644\n> --- a/src/libcamera/camera_sensor.cpp\n> +++ b/src/libcamera/camera_sensor.cpp\n> @@ -30,6 +30,112 @@ namespace libcamera {\n>  \n>  LOG_DEFINE_CATEGORY(CameraSensor);\n>  \n> +/**\n> + * \\struct CameraSensorInfo\n> + * \\brief Report the image sensor characteristics\n> + *\n> + * The structure reports image sensor characteristics used by IPA modules to\n> + * tune their algorithms based on the image sensor model currently in use and\n> + * its configuration.\n> + *\n> + * The here reported information describe the sensor's intrinsics\n> + * characteristics, such as its pixel array size and the sensor model name,\n> + * as well as information relative to the currently configured mode, such as\n> + * the produced image size and the bit depth of the requested image format.\n> + *\n> + * Instances of this structure are meant to be assembled by the CameraSensor\n> + * class and its specialized subclasses by inspecting the sensor static\n> + * properties as well as the currently configured sensor mode.\n> + */\n> +\n> +/**\n> + * \\var CameraSensorInfo::name\n> + * \\brief The image sensor name\n> + */\n> +\n> +/**\n> + * \\var CameraSensorInfo::bitsPerPixel\n> + * \\brief The bits per-pixel of the image format produced by the image sensor\n> + */\n> +\n> +/**\n> + * \\var CameraSensorInfo::activeAreaSize\n> + * \\brief The size of the active pixel array area of the sensor\n> + *\n> + * \\todo Reference the corresponding property\n> + */\n> +\n> +/**\n> + * \\var CameraSensorInfo::analogCrop\n> + * \\brief The portion of the pixel array active area which is read-out and\n> + * processed\n> + *\n> + * The analog crop rectangle top-left corner is defined as the displacement from\n> + * from the top-left corner of the pixel array active area. The rectangle\n> + * horizontal and vertical sizes define the portion of the pixel matrix which\n> + * is read-out and provided to the sensor's on-board ISP before any analog\n> + * processing takes place.\n> + */\n> +\n> +/**\n> + * \\var CameraSensorInfo::outputSize\n> + * \\brief The size of the images produced by the camera sensor\n> + *\n> + * The output image size defines the horizontal and vertical sizes of the images\n> + * produced by the image sensor. The final output image size is defined as the\n> + * end result of the sensor's on-board ISP pipeline processing stages, applied\n> + * on the pixel array matrix analog crop rectangle. Each ISP processing stage\n> + * that applies pixel sub-sampling techniques, such as pixel binning or\n> + * skipping, or perform additional digital cropping concur in the definition\n> + * of the final output image size.\n> + */\n> +\n> +/**\n> + * \\var CameraSensorInfo::horizontalBinning\n> + * \\brief The binning factor, in the horizontal direction, of the image sensor\n> + * configuration\n> + *\n> + * \\todo Remove this field and compute the binning factor in the IPA\n> + */\n> +\n> +/**\n> + * \\var CameraSensorInfo::verticalBinning\n> + * \\brief The binning factor, in the vertical direction, of the image sensor\n> + * configuration\n> + *\n> + * \\todo Remove this field and compute the binning factor in the IPA\n> + */\n> +\n> +/**\n> + * \\var CameraSensorInfo::horizontalScaling\n> + * \\brief The horizontal scaling factor, calculated as the ratio between\n> + * the active pixel array horizontal size and the horizontal size of the\n> + * output image\n> + *\n> + * \\todo Remove this field and compute the scaling factor in the IPA\n> + */\n> +\n> +/**\n> + * \\var CameraSensorInfo::verticalScaling\n> + * \\brief The vertical scaling factor, calculated as the ratio between\n> + * the active pixel array vertical size and the vertical size of the\n> + * output image\n> + *\n> + * \\todo Remove this field and compute the scaling factor in the IPA\n> + */\n> +\n> +/**\n> + * \\var CameraSensorInfo::noiseFactor\n> + * \\brief Scaling of the noise compared to the native sensor mode\n> + *\n> + * \\todo Improve this description\n> + */\n> +\n> +/**\n> + * \\var CameraSensorInfo::lineDuration\n> + * \\brief Line scan-out duration in nanoseconds\n> + */\n> +\n>  /**\n>   * \\class CameraSensor\n>   * \\brief A camera sensor based on V4L2 subdevices\n> diff --git a/src/libcamera/include/camera_sensor.h b/src/libcamera/include/camera_sensor.h\n> index 6e4d2b0118bc..acc6022cf0e8 100644\n> --- a/src/libcamera/include/camera_sensor.h\n> +++ b/src/libcamera/include/camera_sensor.h\n> @@ -24,6 +24,25 @@ class V4L2Subdevice;\n>  \n>  struct V4L2SubdeviceFormat;\n>  \n> +struct CameraSensorInfo {\n> +\tstd::string name;\n> +\n> +\tuint32_t bitsPerPixel;\n> +\n> +\tSize activeAreaSize;\n> +\tRectangle analogCrop;\n> +\tSize outputSize;\n> +\n> +\tuint8_t horizontalBinning;\n> +\tuint8_t verticalBinning;\n> +\tdouble horizontalScaling;\n> +\tdouble verticalScaling;\n> +\n> +\tdouble noiseFactor;\n> +\n> +\tdouble lineDuration;\n> +};\n> +\n>  class CameraSensor : protected Loggable\n>  {\n>  public:\n> -- \n> 2.25.1\n> \n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel","headers":{"Return-Path":"<niklas.soderlund@ragnatech.se>","Received":["from mail-lf1-x141.google.com (mail-lf1-x141.google.com\n\t[IPv6:2a00:1450:4864:20::141])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 8B492600F3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  8 Apr 2020 01:27:04 +0200 (CEST)","by mail-lf1-x141.google.com with SMTP id r17so3735127lff.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 07 Apr 2020 16:27:04 -0700 (PDT)","from localhost (h-200-138.A463.priv.bahnhof.se. [176.10.200.138])\n\tby smtp.gmail.com with ESMTPSA id\n\tc21sm567207lfh.16.2020.04.07.16.27.02\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 07 Apr 2020 16:27:02 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected)\n\theader.d=ragnatech-se.20150623.gappssmtp.com\n\theader.i=@ragnatech-se.20150623.gappssmtp.com header.b=\"EWfPXT/2\"; \n\tdkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=ragnatech-se.20150623.gappssmtp.com; s=20150623;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:content-transfer-encoding:in-reply-to;\n\tbh=1OM/hopLBuQHn4XvnICXwYPeLd2QsSsxzp9Fs/reUfg=;\n\tb=EWfPXT/2T87rxBubGev8n4swaCE9yqYCGxUwPVtRuu6ft7tcVWm70tOpw8YjWqPaEq\n\tic1qixd91eGpLtI/Gy33kwsv3q5FrGJ+7rzTJnaAed4+vLKzqrNRUOFRWJ/AnKZzaFxa\n\tESxEiHfBJdiU3ah23SNO+b+3DzglaTcvgMR9PLK2WZ3CPnaVnQnVKy+BVAf7SBMlacq7\n\tF8rlHFbikryzoPDW/WOnxjEmUz/V3RYzBNUWAFJmppJBvr1+fM77JWFkGtFl90GJLTC/\n\tE8cPvjma7kP/Vtvok7H/SVoGolkIHq6d4r46ka3Rge3clDXDyMpcC2UjEf5Ual3SrSNR\n\tN/TQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:content-transfer-encoding\n\t:in-reply-to;\n\tbh=1OM/hopLBuQHn4XvnICXwYPeLd2QsSsxzp9Fs/reUfg=;\n\tb=Hm9Co9kZeLfAjGamgSyoGIuS4gifa8q/iMDGvzFnVoiHYsByOm5PF+OoRXOxvS9msz\n\ttKkXS2Qi4NfqFGDxCDbJ6UDfVdUCWeKOVLQUduVZdEV24MJoU+zCzU+I5+/ytUxZz68J\n\t5/5ujm4I36JXn3nkooTEqOktQxdDRd0lcLKkeRy0LcIt1eyN1KzTwYP3QaZ0bj3VPPZo\n\tzMI/U1JM323kggEzEi2pNTNWr6XmOyUJV6orrzlWostqtEGQ/GrtF9axlKr4nSjU7p41\n\t26DKRf4ZHQK7U6J3v70WB7y55m4b1U0YNrJieAqXK3O1RY4YzcyubBxt24wpo97MSU6p\n\tR7Pw==","X-Gm-Message-State":"AGi0PuYZXXZOpBdaF2x0qtt53SEMzK/h0Bx4w5DiPEZwVdO1fA9/NT04\n\tdT40ngfUDkPZFatq0hnNF/mSXQ==","X-Google-Smtp-Source":"APiQypIXASuku5b9psCpZFjsSCdYrWLXlQDOROlc568OetiFgfX+vLIcfTNoshoDHnzaSAmYjYyPGA==","X-Received":"by 2002:a19:43:: with SMTP id 64mr2717984lfa.67.1586302023782;\n\tTue, 07 Apr 2020 16:27:03 -0700 (PDT)","Date":"Wed, 8 Apr 2020 01:27:02 +0200","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20200407232702.GB1716317@oden.dyn.berto.se>","References":"<20200327113152.348570-1-jacopo@jmondi.org>\n\t<20200327113152.348570-2-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20200327113152.348570-2-jacopo@jmondi.org>","Subject":"Re: [libcamera-devel] [RFCv2 1/2] libcamera: camera_sensor: Define\n\tCameraSensorInfo","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","X-List-Received-Date":"Tue, 07 Apr 2020 23:27:04 -0000"}}]