Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Why this incongruency happens regarding number of pixels?

1 回表示 (過去 30 日間)
Stelios Fanourakis
Stelios Fanourakis 2019 年 2 月 24 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Hi
I use the image I attached.
I use this line to get the sum of pixels from row 307 to 366, at columns from 464 to 490
for col = 464 : 490
heights(col) = sum(rgbImage(366,col) - rgbImage(307,col));
end
This subtraction would give us 59 pixels and with a calibration factor of 0,042 it would give us around 2,48 mm for all the columns.
When I export the values to an excel file I get
If you multiply the below values with 0,042 you only get around 6 values acceptable and the closest to 2,5mm.
Why this incongruency???
By measuring heights(col), I should get 59 pixels multiplied by 0,042 I would get around 2,47 mm. Why I don't get those values when I export them to Excel??
Any ideas?
1
5
7
10
13
21
31
38
48
54
58
65
69
76
75
73
69
67
66
58
52
45
39
33
28
24
18
14
  11 件のコメント
Image Analyst
Image Analyst 2019 年 2 月 24 日
If you have an RGB image, why are you conly giving two indexes? It should have 3.
Perhaps you'd find improfile easier since it just returns x,y coordinates and you can find the end points easily from the first element and the last element of the coordinates.
Why are you summing the values?
Stelios Fanourakis
Stelios Fanourakis 2019 年 2 月 24 日
Image Analyst. Can you please give me an example of how I could use the improfile command at my specific issue?
How I define X1,X2,Y1,Y2 and embed image as well. I have tried it in the past with no luck

回答 (1 件)

Image Analyst
Image Analyst 2019 年 2 月 24 日
See attached spatial calibration demo. Adapt as needed.
  5 件のコメント
Stelios Fanourakis
Stelios Fanourakis 2019 年 2 月 24 日
I guess this line
heights(col) = rgbImage(370,col) - rgbImage(215,col);
Does not make any arithmetic calculation. It is different than imdistline()
imdistline subtracts arithmetic number of pixels from point A to point B.
But by indexing the rows and columns of an image and making subtraction out of those, is totally different thing. Isn't it?
If not arithmetic subtraction then what?
Stelios Fanourakis
Stelios Fanourakis 2019 年 2 月 24 日
I see. It is a subtraction of pixels values (intensity values), not the pixel as a number.
I double checked it.
Thanks for your time Image Analyst.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by