{"id":3024,"date":"2022-01-24T08:30:00","date_gmt":"2022-01-24T06:30:00","guid":{"rendered":"https:\/\/www.kurokesu.com\/main\/?p=3024"},"modified":"2022-01-24T13:54:20","modified_gmt":"2022-01-24T11:54:20","slug":"imx477-camera-board-for-motorized-zoom-lenses","status":"publish","type":"post","link":"https:\/\/www.kurokesu.com\/main\/2022\/01\/24\/imx477-camera-board-for-motorized-zoom-lenses\/","title":{"rendered":"IMX477 camera board for motorized zoom lenses"},"content":{"rendered":"\n<p>With the introduction of motorized zoom lenses, the next logical step was matching the sensor board. Sure there are countless suitable sensors from various manufacturers like Sony semiconductors, Onsemi, Aptina, and many more. But lack of good support from the SOC side suggested starting from IMX477. It is a reasonably modern 12M image sensor used by many single-board computers like Raspberry Pi, NVIDIA Jetson, and others.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.kurokesu.com\/main\/wp-content\/uploads\/2022\/01\/IMG_4770__s.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"682\" src=\"https:\/\/www.kurokesu.com\/main\/wp-content\/uploads\/2022\/01\/IMG_4770__s-1024x682.jpg\" alt=\"\" class=\"wp-image-3027\" srcset=\"https:\/\/www.kurokesu.com\/main\/wp-content\/uploads\/2022\/01\/IMG_4770__s-1024x682.jpg 1024w, https:\/\/www.kurokesu.com\/main\/wp-content\/uploads\/2022\/01\/IMG_4770__s-300x200.jpg 300w, https:\/\/www.kurokesu.com\/main\/wp-content\/uploads\/2022\/01\/IMG_4770__s-768x512.jpg 768w, https:\/\/www.kurokesu.com\/main\/wp-content\/uploads\/2022\/01\/IMG_4770__s-1536x1024.jpg 1536w, https:\/\/www.kurokesu.com\/main\/wp-content\/uploads\/2022\/01\/IMG_4770__s.jpg 2000w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p>Raspberry Pi locks cameras with a security chip and prohibits non-authorized cameras with standard boards. Luckily this security feature is not used by compute modules. Motorized lenses have dedicated, and in most cases, unique direct mount features. So a custom camera module is a must, thus introducing the&nbsp;<a target=\"_blank\" href=\"https:\/\/www.kurokesu.com\/shop\/IMX477_Z1_LEGACY\" rel=\"noreferrer noopener\">IMX477 MIPI CSI2 camera<\/a>&nbsp;board.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><a href=\"https:\/\/www.kurokesu.com\/main\/wp-content\/uploads\/2022\/01\/IMG_4757__s.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.kurokesu.com\/main\/wp-content\/uploads\/2022\/01\/IMG_4757__s-1024x876.jpg\" alt=\"\" class=\"wp-image-3028\" width=\"365\" height=\"312\" srcset=\"https:\/\/www.kurokesu.com\/main\/wp-content\/uploads\/2022\/01\/IMG_4757__s-1024x876.jpg 1024w, https:\/\/www.kurokesu.com\/main\/wp-content\/uploads\/2022\/01\/IMG_4757__s-300x257.jpg 300w, https:\/\/www.kurokesu.com\/main\/wp-content\/uploads\/2022\/01\/IMG_4757__s-768x657.jpg 768w, https:\/\/www.kurokesu.com\/main\/wp-content\/uploads\/2022\/01\/IMG_4757__s-1536x1314.jpg 1536w, https:\/\/www.kurokesu.com\/main\/wp-content\/uploads\/2022\/01\/IMG_4757__s.jpg 2000w\" sizes=\"auto, (max-width: 365px) 100vw, 365px\" \/><\/a><\/figure><\/div>\n\n\n\n<p>This is the first of a few upcoming camera modules. Note multiple mounting features &#8211; this allows single-board use with many lenses.<\/p>\n\n\n\n<p>Features of the lens kit:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Lens optical train &#8211; 3 stepper motors for Zoom, Focus and compensate lens groups<\/li><li>Iris<\/li><li>Two optical filters: IR CUT and NIR<\/li><li>Reference optical train elements<\/li><li>Runs on&nbsp;<a target=\"_blank\" href=\"https:\/\/github.com\/Kurokesu\/SCE2-GRBL\" rel=\"noreferrer noopener\">GRBL firmware<\/a>&nbsp;ported on STM32 CPU with four axis motion planner<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Using the camera with Raspberry Pi compute module<\/h2>\n\n\n\n<p>There is a&nbsp;<a target=\"_blank\" href=\"https:\/\/www.raspberrypi.com\/documentation\/accessories\/camera.html\" rel=\"noreferrer noopener\">great resource<\/a>&nbsp;about the IMX477 camera on Raspberry Pi pages, feel free to learn how to control and use it from Raspberry Pi. Below is a simple recipe for streaming real-time video from RPI to a computer.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Run on computer first<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>gst-launch-1.0 udpsrc port=5004 ! \"application\/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)JPEG,a-framerate=(string)40.000000,a-framesize=(string)1280-720,payload=(int)26\" ! rtpjpegdepay ! decodebin ! autovideosink<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Run on RPI as a second step<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># Install libraries\nsudo apt -y install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev\n\n# Start streamer\nraspivid -t 0 -cd MJPEG -awb greyworld -mm average -w 2028 -h 1520 -fps 30 -b 132000000 -o - | gst-launch-1.0 fdsrc ! \"image\/jpeg,framerate=30\/1\" ! jpegparse ! rtpjpegpay ! udpsink host=&lt;COMPUTER_IP&gt; port=5004\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Control the lens<\/h3>\n\n\n\n<p>The SCE2-SDK control software can be forked from&nbsp;<a target=\"_blank\" href=\"https:\/\/github.com\/Kurokesu\/SCE2-SDK\" rel=\"noreferrer noopener\">GitHub<\/a>. Python code allows code reuse on many operating systems and keeps it human-readable, thus open for customizations.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/www.kurokesu.com\/main\/wp-content\/uploads\/2022\/01\/screenshot.png\"><img loading=\"lazy\" decoding=\"async\" width=\"952\" height=\"780\" src=\"https:\/\/www.kurokesu.com\/main\/wp-content\/uploads\/2022\/01\/screenshot.png\" alt=\"\" class=\"wp-image-3038\" srcset=\"https:\/\/www.kurokesu.com\/main\/wp-content\/uploads\/2022\/01\/screenshot.png 952w, https:\/\/www.kurokesu.com\/main\/wp-content\/uploads\/2022\/01\/screenshot-300x246.png 300w, https:\/\/www.kurokesu.com\/main\/wp-content\/uploads\/2022\/01\/screenshot-768x629.png 768w\" sizes=\"auto, (max-width: 952px) 100vw, 952px\" \/><\/a><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li>Download and install <a href=\"https:\/\/www.python.org\/downloads\/windows\/\">https:\/\/www.python.org\/downloads\/windows\/<\/a> (tested with Python 3.10 on Win10 and Python 3.8.10 on Win7)<ul><li>Check <code>Add Python 3.8 to PATH<\/code> in the first setup window!<\/li><li>Restart computer<\/li><\/ul><\/li><li>Clone (or download zip archive) from GitHub repository: <a href=\"https:\/\/github.com\/Kurokesu\/SCE2-SDK\">https:\/\/github.com\/Kurokesu\/SCE2-SDK<\/a> in preferred directory<\/li><li>Open console at <code>03_lens_tester_gui<\/code> folder<\/li><li>Install dependencies:<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>pip install -r requirements.txt<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>Run demo with command<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>python main.py\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Results<\/h2>\n\n\n\n<p>The lens is fairly complex &#8211; consists of 5 groups and 19 elements of optical components. Besides Focus and zoom actuators, it also has a distortion compensation element. Not all parameters and flange back distance are set perfectly, but 40x optical zoom looks sweet!<\/p>\n\n\n\n<figure class=\"wp-block-jetpack-image-compare\"><div class=\"juxtapose\" data-mode=\"horizontal\"><img loading=\"lazy\" decoding=\"async\" id=\"3092\" src=\"https:\/\/www.kurokesu.com\/main\/wp-content\/uploads\/2022\/01\/11.png\" alt=\"\" width=\"1842\" height=\"1382\" class=\"image-compare__image-before\"\/><img loading=\"lazy\" decoding=\"async\" id=\"3093\" src=\"https:\/\/www.kurokesu.com\/main\/wp-content\/uploads\/2022\/01\/22.png\" alt=\"\" width=\"1843\" height=\"1377\" class=\"image-compare__image-after\"\/><\/div><figcaption>  40x zoom &#8211; wide and tele pictures  <\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-jetpack-image-compare\"><div class=\"juxtapose\" data-mode=\"horizontal\"><img loading=\"lazy\" decoding=\"async\" id=\"3062\" src=\"https:\/\/www.kurokesu.com\/main\/wp-content\/uploads\/2022\/01\/ir_1.jpg\" alt=\"\" width=\"1822\" height=\"1347\" class=\"image-compare__image-before\"\/><img loading=\"lazy\" decoding=\"async\" id=\"3063\" src=\"https:\/\/www.kurokesu.com\/main\/wp-content\/uploads\/2022\/01\/ir_2.jpg\" alt=\"\" width=\"1822\" height=\"1347\" class=\"image-compare__image-after\"\/><\/div><figcaption>VISIBLE vs NIR<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Video on Youtube<\/h2>\n\n\n\n<p>And finally, demonstration video cycling through a few presets and changing filters.<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<span class=\"embed-youtube\" style=\"text-align:center; display: block;\"><iframe loading=\"lazy\" class=\"youtube-player\" width=\"1140\" height=\"642\" src=\"https:\/\/www.youtube.com\/embed\/6Rh9UC2JAeg?version=3&#038;rel=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;fs=1&#038;hl=en-US&#038;autohide=2&#038;wmode=transparent\" allowfullscreen=\"true\" style=\"border:0;\" sandbox=\"allow-scripts allow-same-origin allow-popups allow-presentation allow-popups-to-escape-sandbox\"><\/iframe><\/span>\n<\/div><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Links<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/github.com\/Kurokesu\/SCE2-SDK\" title=\"SCE2-SDK\">SCE2-SDK<\/a> repository on GitHub<\/li><li>E-store <a href=\"https:\/\/www.kurokesu.com\/shop\/camera_modules\" title=\"camera modules\">camera modules<\/a><\/li><li>E-store motorized <a href=\"https:\/\/www.kurokesu.com\/shop\/motorized_zoom_lenses\" title=\"zoom lenses\">zoom lenses<\/a><\/li><li><a href=\"https:\/\/github.com\/Kurokesu\/3d_models\" title=\"3D model repository\">3D model repository<\/a> on GitHub<\/li><\/ul>\n\n\n\n\n\n\n\n\n\n\n\n\n","protected":false},"excerpt":{"rendered":"<p>With the introduction of motorized zoom lenses, the next logical step was matching the sensor board. Sure there are countless suitable sensors from various manufacturers like Sony semiconductors, Onsemi, Aptina, and many more. But lack of good support from the SOC side suggested starting from IMX477. It is a reasonably modern 12M image sensor used [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":3027,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[152,156],"tags":[62,453,433,435,452,25,432,268,12,29],"class_list":["post-3024","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-news","category-product-features","tag-camera","tag-compute-module","tag-csi-2","tag-csi2","tag-imx477","tag-lens","tag-mipi","tag-motorized","tag-raspberry-pi","tag-zoom"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/www.kurokesu.com\/main\/wp-content\/uploads\/2022\/01\/IMG_4770__s.jpg","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p6VSmB-MM","_links":{"self":[{"href":"https:\/\/www.kurokesu.com\/main\/wp-json\/wp\/v2\/posts\/3024","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kurokesu.com\/main\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kurokesu.com\/main\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kurokesu.com\/main\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kurokesu.com\/main\/wp-json\/wp\/v2\/comments?post=3024"}],"version-history":[{"count":33,"href":"https:\/\/www.kurokesu.com\/main\/wp-json\/wp\/v2\/posts\/3024\/revisions"}],"predecessor-version":[{"id":3094,"href":"https:\/\/www.kurokesu.com\/main\/wp-json\/wp\/v2\/posts\/3024\/revisions\/3094"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.kurokesu.com\/main\/wp-json\/wp\/v2\/media\/3027"}],"wp:attachment":[{"href":"https:\/\/www.kurokesu.com\/main\/wp-json\/wp\/v2\/media?parent=3024"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kurokesu.com\/main\/wp-json\/wp\/v2\/categories?post=3024"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kurokesu.com\/main\/wp-json\/wp\/v2\/tags?post=3024"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}