久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

哪種方法是估計拍攝物體尺寸的最佳方法?

Which is the best way to estimate measure of photographed things?(哪種方法是估計拍攝物體尺寸的最佳方法?)
本文介紹了哪種方法是估計拍攝物體尺寸的最佳方法?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

我的應(yīng)用程序應(yīng)該使用歐元硬幣作為參考來估計物體的長度(以毫米為單位).這是一個截圖示例:

為了得到所拍攝硬幣的直徑,我首先計算了一個圓通過表格中這 3 個點(diǎn)的方程

x^2 + y^2 + ax + by + c = 0

然后我得到直徑

2 * square_root((a/2)^2 + (b/2)^2 -c).

最后我可以執(zhí)行以下比例得到紅筆的長度:

/* length_estimated_pen (mm) : distance_green_pins (points) = real_diameter_coin (mm) : diameter_on_screen (points) */讓 distanceGreen:Double = Double(sqrt(pow(self.greenLocationA.center.x - self.greenLocationB.center.x, 2.0) + pow(self.greenLocationA.center.y - self.greenLocationB.center.y, 2.0)))讓estimatedMeasure:Double = (distanceGreen * Double(ChosenMeter.moneyDiameter))/直徑

ChosenMeter.moneyDiameter 中存儲了所選硬幣的實(shí)際直徑作為參考(通過單擊下面的 3 個按鈕之一).

我需要使用 Double 而不是 CGFloat 因?yàn)?

[注]

選擇此圖像是為了強(qiáng)調(diào)傾斜,但您應(yīng)該使用與芯片表面幾乎平行的平面圖像以避免透視失真.這張圖片不是一個很好的例子,立方體離相機(jī)比硬幣更遠(yuǎn)......

為此,請參閱不同投影的選擇標(biāo)準(zhǔn)

My app is supposed to estimate the length (in millimeters) of an object using euro coins as reference. This is a screenshot example:

To get the diameter of the photographed coin I first calculate the equation of a the circle passing through those 3 points of the form

x^2 + y^2 + ax + by + c = 0

and then I have the diameter by

2 * square_root((a/2)^2 + (b/2)^2 -c).

Finally I can perform the following proportion to get the length of the red pen:

/* length_estimated_pen (mm) : distance_green_pins (points) = real_diameter_coin (mm) : diameter_on_screen (points) */

let distanceGreen:Double = Double(sqrt(pow(self.greenLocationA.center.x - self.greenLocationB.center.x, 2.0) + pow(self.greenLocationA.center.y - self.greenLocationB.center.y, 2.0)))

let estimatedMeasure:Double = (distanceGreen * Double(ChosenMeter.moneyDiameter)) / diameter

where in ChosenMeter.moneyDiameter there is stored the real diameter of the chosen coin as reference (by clicking one of the 3 buttons below).

I need to work with Double instead of CGFloat because this tutorial to solve a system of linear equations (to get a,b,c coefficient of circle equation) works with Double.

The problem is the estimated length of the red pen is always overestimated of more than 10 mm. I guess I should apply a correction factor or complicate the calculus taking into consideration other factors, but which? Can you give me some hints? Any help would be useful to me.

解決方案

  1. find the coin (green bounding box rectangle)

    either manually or by some search for specific color,pattern,hough transform,segmentation... This will limit the area to search for next steps

  2. find the boundary (distinct red edge in color intensity)

    so create a list of points that are the coin boundary (be careful with shadows) just scan for high enough intensity bumps.

  3. compute the circle center

    just average of all border points...

  4. test all boundary points for min/max distance to center

    if the tilt is small then you will have many points with min and max radius so take the middle from them. If the |max-min| is very small then you got no tilt. Linebetween min/max distance point and center gives you black basis vectors.

  5. use black basis vectors to measure

    So select 2 points (red line d) to measure and cast green rays from them parallel to basis vectors. Their intersection will create 2 lines a,b. from that it is easy:

    • d = sqrt((a*a)+(b*b))

    where a,b is the size of the lines in units. you can obtain it like:

    • a_size_unit = a_size_pixel * coin_r_unit / rmax_pixel
    • b_size_unit = b_size_pixel * coin_r_unit / rmin_pixel

[note]

This image was selected to emphasize the skew but you should use images of planes almost paralel to chip surface to avoid perspective distortion. This image is not a good example the cube is more distant to camera then coin ...

To account for this see selection criteria for different projections

這篇關(guān)于哪種方法是估計拍攝物體尺寸的最佳方法?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

How to draw stars using Quartz Core?(如何使用 Quartz Core 繪制星星?)
Why does giving addArcWithCenter a startAngle of 0 degrees make it start at 90 degrees?(為什么給 addArcWithCenter 一個 0 度的 startAngle 使它從 90 度開始?)
Find the CGPoint on a UIView rectangle intersected by a straight line at a given angle from the center point(在與中心點(diǎn)成給定角度的直線相交的 UIView 矩形上找到 CGPoint)
Convert Character to Int in Swift 2.0(在 Swift 2.0 中將字符轉(zhuǎn)換為 Int)
How to convert an Int to a Character in Swift(如何在 Swift 中將 Int 轉(zhuǎn)換為字符)
In Swift 3, how to calculate the factorial when the result becomes too high?(在 Swift 3 中,當(dāng)結(jié)果變得太高時如何計算階乘?)
主站蜘蛛池模板: 日韩在线观看一区二区三区 | 欧美一区二区三区 | 国产精品久久久久久久久污网站 | 国产精品免费一区二区三区四区 | h视频免费在线观看 | 国产成人免费网站 | yiren22 亚洲综合 | 亚洲一区二区三 | 91精品久久久久久久久 | 成人精品视频在线观看 | 夜夜爽99久久国产综合精品女不卡 | 成人免费视频7777777 | 国产精品久久久久久久7电影 | 国产精品成人一区 | 免费日韩av | 超碰在线影院 | 欧美精品91 | 亚洲36d大奶网 | 欧美一级在线观看 | 一区二区三区日 | 91porn在线| 男人午夜视频 | 国产精品成人一区 | 欧美影院久久 | 国产亚洲精品精品国产亚洲综合 | 亚洲97 | 成人精品一区二区 | 久久免费视频1 | 一级片网址 | 日韩在线视频一区二区三区 | 国产探花在线精品一区二区 | 蜜桃一区二区三区 | 91麻豆精品国产91久久久更新资源速度超快 | 一区二区三区视频在线免费观看 | 国产精品久久久久久久岛一牛影视 | 欧美日韩高清一区二区三区 | 成人免费观看视频 | 国外成人免费视频 | 中文字字幕一区二区三区四区五区 | 神马久久久久久久久久 | 国产伦精品一区二区 |