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!