﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-落霞与孤骛齐飞，秋水共长天一色。-文章分类-图像处理</title><link>http://www.cppblog.com/wmgl/category/9506.html</link><description /><language>zh-cn</language><lastBuildDate>Tue, 13 Sep 2011 18:56:37 GMT</lastBuildDate><pubDate>Tue, 13 Sep 2011 18:56:37 GMT</pubDate><ttl>60</ttl><item><title>图像拼接中，拼接参数的估计。</title><link>http://www.cppblog.com/wmgl/articles/146873.html</link><dc:creator>noBugnoGain</dc:creator><author>noBugnoGain</author><pubDate>Sat, 21 May 2011 09:37:00 GMT</pubDate><guid>http://www.cppblog.com/wmgl/articles/146873.html</guid><wfw:comment>http://www.cppblog.com/wmgl/comments/146873.html</wfw:comment><comments>http://www.cppblog.com/wmgl/articles/146873.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.cppblog.com/wmgl/comments/commentRss/146873.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/wmgl/services/trackbacks/146873.html</trackback:ping><description><![CDATA[<div>最近分析了PToptimizer，整个程序流程。大致如下：<br /><br />1）导入优化的脚本文件，这个文件包络万象，输入图像的信息(roll,pitch,yaw, hfov,width,height，图像的投影方法等），输出全景图的设置，控制点的罗列，优化参数的控制等（i,p,c,v)，其中相对优化最重要的就是控制点和是否对参数进行优化。设置的正确与否，影响后面的优化结果。使用前，一定要好好看看Optimize.txt<br /><br />2)根据script填充AlignInfo结构体，注意AlignInfo最后被注入了adjust.c的 static AlignInfo *optInfo中。初始LM输入参数和输出参数的函数，及重要的fcn都包含在结构体OptInfo中，整个LM算法都是围绕AlignInfo和OptInfo展开的。驱动他们结合的是函数lmfunc fcn(它是个函数指针，实际调用int fcnPano(int m, int n, double x[], double fvec[], int *iflag) )。<br /><br />3）计算误差的函数就是上面提到的fcn，这个函数举足轻重，要义深刻，根据width = 360, hfov = 360, height = 180的参考全景图，利用图像间匹配的控制点，不同投影模式，不同投影函数调用，来计算参数和误差。<br />4）通过LM反复迭代，得到全局最优。（这部分还有一些不解，具体分析到代码，再做讨论）。<br /><br />PToptimizer是hugin的灵魂，一点不过。心与心的碰触，代码与代码的交叉，灵魂转化，功力跟进。<br /></div><img src ="http://www.cppblog.com/wmgl/aggbug/146873.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/wmgl/" target="_blank">noBugnoGain</a> 2011-05-21 17:37 <a href="http://www.cppblog.com/wmgl/articles/146873.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>SBA 主要函数介绍</title><link>http://www.cppblog.com/wmgl/articles/139512.html</link><dc:creator>noBugnoGain</dc:creator><author>noBugnoGain</author><pubDate>Fri, 28 Jan 2011 02:55:00 GMT</pubDate><guid>http://www.cppblog.com/wmgl/articles/139512.html</guid><wfw:comment>http://www.cppblog.com/wmgl/comments/139512.html</wfw:comment><comments>http://www.cppblog.com/wmgl/articles/139512.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/wmgl/comments/commentRss/139512.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/wmgl/services/trackbacks/139512.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: （1）motion and structuresba_motstr_levmar(), sba_motstr_levmar_x():Resp. simple and expert driver for full motion and structure BA.(2)only motionsba_mot_levmar(), sba_mot_levmar_x():Resp. s...&nbsp;&nbsp;<a href='http://www.cppblog.com/wmgl/articles/139512.html'>阅读全文</a><img src ="http://www.cppblog.com/wmgl/aggbug/139512.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/wmgl/" target="_blank">noBugnoGain</a> 2011-01-28 10:55 <a href="http://www.cppblog.com/wmgl/articles/139512.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Example Script to run PTStitcher</title><link>http://www.cppblog.com/wmgl/articles/127250.html</link><dc:creator>noBugnoGain</dc:creator><author>noBugnoGain</author><pubDate>Tue, 21 Sep 2010 07:19:00 GMT</pubDate><guid>http://www.cppblog.com/wmgl/articles/127250.html</guid><wfw:comment>http://www.cppblog.com/wmgl/comments/127250.html</wfw:comment><comments>http://www.cppblog.com/wmgl/articles/127250.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/wmgl/comments/commentRss/127250.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/wmgl/services/trackbacks/127250.html</trackback:ping><description><![CDATA[<pre>#############           Example Script                  ##########################
#                       to run PTStitcher
#
#
# Only lines starting with 'p','o', i', or 'm' are read,
# so you can add comments and info as you like by using
# other line starting characters.
# The * character at the first of a line indicated the end of the script file.
# The stitcher script must contain:
# one 'p'- line describing the output image (eg Panorama)
# one 'o'-line for each input image
# one 'i' line for each input image that is optional
# the 'm'-line is optional and allows you to specify modes for the optimization.
# the 'C'-line is optional and allows morphing of control points.
# 'p'-line options
# w1000        width in pixels
# h600         height in pixels (default: width/2)
# f0           projection format,
#                  0 - rectilinear (for printing and viewing)
#                  1 - Cylindrical (for Printing and QTVR)
#                  2 - Equirectangular ( for Spherical panos), default
#                  3 - full-frame fisheye
# v360         horizontal field of view of panorama (default 360)
# nPICT        Panorama file format, one of:
#                  PICT          pict-file on macs, bmp-file on win (default)
#                  PSD           single layer Photoshop file, 48bits supported
#                  PNG           png-format, 48bits supported
#                  TIFF          tiff-format, 48bits supported
#                  PSD_mask      Photoshop file, one image per layer
#                                  + shape mask &amp; feathered clip mask at overlap center
#                  PSD_nomask    Photoshop file, one image per layer,
#                  TIFF_mask     tiff-format, multi-file, one image per file, 48bit supported
#                                  alpha layer with feathered clip mask at overlap center
#                  TIFF_m        tiff-format, multi-file, one image per file, 48bit supported
#                                  alpha layer with non-feathered clip mask at image border
#                                  + shape mask &amp; non-feathered clip mask at image border
#                  JPEG          Panoramic image in jpeg-format. Use with f1
#                                  for IBM Hotmedia panoramas.
#                  PAN           SmoothMove movie. Use only with f2.
#                  IVR           LivePicture IVR movie
#                                  cylindrical (format f1) or spherical (format f2)
#                  IVR_java      LivePicture Java Panorama,
#                                  cylindrical (format f1) or spherical (format f2)
#                  VRML          VRML background node, use only with f2 for panoramas, or
#                                  VRML-object for PTStereo
#                  QTVR          Apple QTVR-panomovie. Use only with f1
#                  3DMF          3DMF-object (PTStereo).
#
# n"QTVR w400 h300 c1"           additional viewer options in a quoted string together with format
#              the following options are recognized:
#                  w(width) and h(height) of viewer window (only QTVR on Macs)
#                  c(codec: 0-JPEG, 1-Cinepak, 2-Sorenson) (only QTVR on Macs)
#                  q(codec quality):
#                     0-high,1-normal,2-low    QTVR on Macs
#                     0-100(highest)           on other jpeg-formats (PAN, IVR, IVR_java, VRML)
#                  g  progressive jpeg (0-no, 1-yes) (PAN, IVR, IVR_java, VRML)
#                     Optimized JPEG (0-on(default), 2-disabled), (3-progressive with optimized disabled)
#                  p  initial pan angle ( QTVR on Macs, VRML, IVR)
#                  v  field of view (QTVR, VRML, IVR)
#                  Many more options can be set by editing the viewer scripts
# u10          width of feather for stitching all images. default:10
# k1           attempt color &amp; brightness correction using image number as anchor
# b1           attempt brightness correction with no color change using image number as anchor
# d1           attempt color correction with no brightness change using image number as anchor
#                  Do not use more than one of k, d, b.This is new method of correcting
p w800 nPSD_mask
# The 'i' lines describe input images and is optional
# nName        file name of the input image.
#                  over ridable with command line parameters to PTStitcher
i n"photo1.jpg"
# The 'o' lines describe input images. One line per image is required
# The width and height of the image is obtained from image
# f0           projection format,
#                  0 - rectilinear (normal lenses)
#                  1 - Panoramic (Scanning cameras like Noblex)
#                  2 - Circular fisheye
#                  3 - full-frame fisheye
#                  4 - PSphere, equirectangular
# v82          horizontal field of view of image (required)
# y0           yaw angle (required)
# p43          pitch angle (required)
# r0           roll angle (required)
# a,b,c        lens correction coefficients (optional)
#                  (see http://www.fh-furtwangen.de/~dersch/barrel/barrel.html)
# d,e          initial lens offset in pixels(defaults d0 e0, optional).
#                  Used to correct for offset from center of image
#                  d - horizontal offset,
#                  e - vertical offset
# g,t          initial lens shear.  Use to remove slight misalignment
#                  of the line scanner relative to the film transport
#                  g - horizontal shear
#                  t - vertical shear
# +buf         (obsolete, -buf and +buf are now ignored when stitching)
#                  load and merge image with buffer
# -buf         (obsolete, -buf and +buf are now ignored when stitching)
#                  save result to buffer. The first 'o' line should
#                  contain one '-buf' command, the last line one '+buf'
#                  command, and all other lines both '+buf -buf'
#                  Exception: remove all 'buf' commands when
#                  creating Photoshop-files to preserve the original images.
# u10          (obsolete, globally used on p line) width of feather for stitching. default:10
# S100,600,100,800   Selection(l,r,t,b), Only pixels inside the rectangle will be used for conversion.
#                       Original image size is used for all image parameters
#                       (e.g. field-of-view) refer to the original image.
#                       Selection can be outside image dimension.
# C100,600,100,800   Crop(l,r,t,b), Only pixels inside the rectangle will be used for conversion.
#                       Cropped image size is used for all image parameters
#                       (e.g. field-of-view) refer to the cropped part of the image.
# m20          (obsolete, use S &amp; C) ignore a frame 20 pixels wide. default: 0
# mx100        (obsolete, use S &amp; C) crop to brightest rectangle with size 100x200;
# my200        (obsolete, use S &amp; C) used only for circular fisheye images (f2)
# s0           (obsolete, ignored, always blend) specify placement of seam between buffer and image:
#                  0-middle of overlap('blend' ,default)
#                  1- at edge of image ('paste').
# o            (the small letter). Morph-to-fit using control points.
# k0           (obsolete, use p line correction still used with plugin)
#                  attempt color/brightness correction when merging image and buffer, one of:
#                  0 - no correction(default);
#                  1 - change image;
#                  2 - change buffer;
#                  3 - change both
#                  this feature does not work very well!
o f2 r0   p0    y0     v183    a0 b-0.1 c0  S100,600,100,800
o f2 r0   p0    y180   v183    a0 b-0.1 c0  S100,600,100,800
# 'm'-line options
# ----------------
# Set mode for stitcher, not required
#
# g2.5         Set gamma value for internal computations (default 1.0)
#                  See &lt;http://www.fh-furtwangen.de/~dersch/gamma/gamma.html&gt;
# i2           Set interpolator, See &lt;http://www.fh-furtwangen.de/~dersch/interpolator/interpolator.html&gt;
#                one of:
#                   0 - poly3 (default)
#                   1 - spline16,
#                   2 - spline36,
#                   3 - sinc256,
#                   4 - spline64,
#                   5 - bilinear,
#                   6 - nearest neighbor,
#                   7 - sinc1024
#              \/ antialiasing filters \/ See &lt;http://www.pano2qtvr.com/dll_patch/&gt;
#                   8 - Box
#                   9 - Bartlett/Triangle
#                   10 - Hermite
#                   11 - Hanning
#                   12 - Hamming
#                   13 - Blackmann
#                   14 - Gaussian 1/sqrt(2)
#                   15 - Gaussian 1/2
#                   16 - Quadardic
#                   17 - Cubic
#                   18 - Catmull-Rom
#                   19 - Mitchell
#                   20 - Lanczos2
#                   21 - Lanczos3
#                   22 - Blackman/Bessel
#                   23 - Blackman/sinc
#
# f0		   Invoke Faster Transformation also invoked by creating a file named "pano12_opt.txt"
#                   in the same foler as project with a line FAST_TRANSFORM
m g1.5 i6 f0
#
# 'z'-lines options
# ----------------
# Extended Depth-Of-Field, not required
#
# Automatically determine, for every point in a picture, which of mumerous overlapping
# images has best focus.  Masks are generated to reveale the best focused parts of
# each image.  Feathering must be selected.  Used with PSD_mask or TIFF_mask file format
# to edit the mask or with flattened file formats for flattened final result.   Does not
# work if color and/or brightness correction are invoked.
#
# m2           mask type
#                m0 hard-edged masks, mutually exclusive
#                m1 hard-edged masks, stack of nested masks
#                m2 blended masks, stack of nested masks (default &amp; strongly recommended)
#                   (this option includes a smoothing computation that seems to help a lot.)
# fN           focus estimation window size, N = halfwidth of window.
#                Recommended value is 0.5% of image width, e.g. 4 pixels for an 800-pixel image.
#                Computation cost for focus estimation increases proportional to N^2.  Default f4.
# sN           smoothing window size, N = halfwidth of window.
#                 Recommended value is 0.5% of image width, e.g. 4 pixels for an 800-pixel image.
#                 Computation cost for smoothing increases proportional to N^2.  Default s4.
z m2 f4 s4
#
# 'C' lines
# ----------------
# Morphing of control point lines
# One line per point
# Created automatically by optimizer
#
# i0           image
# x363.726     starting x point position
# y125.738     starting y point position
# X363.838     morphed x point position
# Y125.618     morphed y point position
C i0  x363.726 y125.738 X363.838 Y125.618
*
Every thing after * is ignored.</pre>
<pre>来自:<a href="http://photocreations.ca/panotools/stitch.txt">http://photocreations.ca/panotools/stitch.txt
</a></pre>
<img src ="http://www.cppblog.com/wmgl/aggbug/127250.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/wmgl/" target="_blank">noBugnoGain</a> 2010-09-21 15:19 <a href="http://www.cppblog.com/wmgl/articles/127250.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>视野和焦距的关系</title><link>http://www.cppblog.com/wmgl/articles/91809.html</link><dc:creator>noBugnoGain</dc:creator><author>noBugnoGain</author><pubDate>Fri, 31 Jul 2009 06:46:00 GMT</pubDate><guid>http://www.cppblog.com/wmgl/articles/91809.html</guid><wfw:comment>http://www.cppblog.com/wmgl/comments/91809.html</wfw:comment><comments>http://www.cppblog.com/wmgl/articles/91809.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/wmgl/comments/commentRss/91809.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/wmgl/services/trackbacks/91809.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: &nbsp;传感器尺寸：Consider a 35 mm camera with a normal lens having a focal length of F = 50 mm. The dimensions of the 35&nbsp;mm image format are 24&nbsp;mm (vertically) &#215; 36&nbsp;mm (horizontal), g...&nbsp;&nbsp;<a href='http://www.cppblog.com/wmgl/articles/91809.html'>阅读全文</a><img src ="http://www.cppblog.com/wmgl/aggbug/91809.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/wmgl/" target="_blank">noBugnoGain</a> 2009-07-31 14:46 <a href="http://www.cppblog.com/wmgl/articles/91809.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>