video stream height measurement
古いコメントを表示
i m working on video analysing program where i have to measure the height of the incoming video stream object, Now i took the video stream into the matlab. I couldnt do the measurement part .Can u pls help me with this analysing part.
4 件のコメント
Walter Roberson
2013 年 1 月 23 日
Are the objects always the same distance away? Is the camera always using the same aperture? Or does each image contain an object of known size?
Jack Sparrow
2013 年 1 月 23 日
I think you need to know atleast the intrinsic or extrinsic parameter of the camera or atleast have an object in the reference area. I'm currently working on something close to this for my M.Sc but i'm stalk at calculating the vanishing point in the image after getting the vanishing lines.
M DINESH
2013 年 1 月 23 日
採用された回答
その他の回答 (2 件)
Walter Roberson
2013 年 1 月 23 日
0 投票
Provided that the same aperture will always be used, since the object will always be at the same distance, the easiest way to proceed would be to start by inserting an object of known size into the scene, taking an image of it, and finding the height in pixels of the known real-world height. Once you have the height in pixels, you can trivially calculate a scaling factor between pixels and real-world.
After that, it just becomes a matter of figuring out the size in pixels of each presented object, and multiplying that by the real-world scale factor previously calculated. As long as nothing changes (e.g., distance does not change.)
16 件のコメント
Jurgen
2013 年 1 月 23 日
Alternatively calculate the magnification with the lens formula. Then find the pixel size based on the ratio of resolution and sensor size.
M DINESH
2013 年 1 月 23 日
Walter Roberson
2013 年 1 月 23 日
I do not think I understand what you mean about "the frame data only" ? How are you reading the frames?
M DINESH
2013 年 1 月 23 日
Walter Roberson
2013 年 1 月 23 日
getdata() is suitable for getting an image from video. You could process that image directly, or you could write it out for later processing. If you did do later processing then you could imread() the saved image.
When you have an image in memory, you can do image processing on it to find the height in pixels, and then multiply the height in pixels by the pre-calculated scaling factor in order to find the real-world height.
M DINESH
2013 年 1 月 24 日
Walter Roberson
2013 年 1 月 24 日
You are trying what ?
M DINESH
2013 年 1 月 24 日
編集済み: Walter Roberson
2013 年 1 月 24 日
Walter Roberson
2013 年 1 月 24 日
As I wrote above,
After that, it just becomes a matter of figuring out the size in pixels of each presented object, and multiplying that by the real-world scale factor previously calculated.
You have not found the size in pixels of each presented object (in the image). You need to analyze the image content for that. The link I gave above should show some ideas on how to do that. The link was http://www.mathworks.co.uk/matlabcentral/answers/57813-image-color-segmentation-to-find-different-objects-of-a-candle
M DINESH
2013 年 1 月 24 日
編集済み: Walter Roberson
2013 年 1 月 24 日
Walter Roberson
2013 年 1 月 24 日
Due to noise in video system hardware, it is not uncommon for "black" pixels to not be exactly 0, and chances are good that at least one pixel in any one row or column would be non-zero just because of noise. And if the background is not completely black, many more pixels would be non-0. You likely need to threshold the data at the very least.
Please save one of the frames as an image file and upload it so we can have a look at it; http://www.mathworks.com/matlabcentral/answers/7924-where-can-i-upload-images-and-files-for-use-on-matlab-answers
M DINESH
2013 年 1 月 25 日
M DINESH
2013 年 1 月 25 日
Walter Roberson
2013 年 1 月 25 日
That seems to be an empty image.
M DINESH
2013 年 1 月 25 日
編集済み: Walter Roberson
2013 年 1 月 25 日
13 件のコメント
M DINESH
2013 年 1 月 25 日
Walter Roberson
2013 年 1 月 25 日
I don't think you can imread('*.jpg')
To work on a continuous stream, replace the imread() with the command to fetch a frame.
M DINESH
2013 年 1 月 25 日
M DINESH
2013 年 1 月 25 日
編集済み: Walter Roberson
2013 年 1 月 25 日
Walter Roberson
2013 年 1 月 25 日
Yes, use a while loop.
I do not know if the pixel measurement is right, as the image you posted earlier appears to be empty.
M DINESH
2013 年 1 月 25 日
M DINESH
2013 年 1 月 25 日
M DINESH
2013 年 1 月 28 日
編集済み: Walter Roberson
2013 年 1 月 28 日
Walter Roberson
2013 年 1 月 28 日
"while" loops do not use {} brackets in MATLAB.
M DINESH
2013 年 1 月 28 日
編集済み: Walter Roberson
2013 年 1 月 28 日
M DINESH
2013 年 1 月 28 日
Walter Roberson
2013 年 1 月 28 日
set(handles.staticText, 'String', num2str(x2));
I have not bothered to analyze the image you posted to figure out whether the pixel measurements are right. I suggest that you display the image and draw vertical bars at min(y) and max(y) to see whether the results look reasonable.
M DINESH
2013 年 2 月 11 日
カテゴリ
ヘルプ センター および File Exchange で Video Formats and Interfaces についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!