How to combine: image - optical flow - coordinate system (axis2pixels)

조회 수: 9 (최근 30일)
Paul Matteschk
Paul Matteschk 2022년 1월 22일
편집: Aishwarya 2023년 10월 6일
hi everyone,
my goal is to calculate windspeed from cloudimages (frames).
I use Lucas Kanade for Flow Estimation.
Unfortunalty iam stucked by plotting my results:
-i want the output diagramm/image/flowfield full frame without white border
-moreover i would like to add axis with the pixel units (tried imref2d)
-and a grid
I am sure there is a way. but who knows him?
% display optical flow
step = 30;
imshow(im_2);
[w,h] = size(optical_flow_u);
u_down = optical_flow_u(1:step:end, 1:step:end);
v_down = optical_flow_v(1:step:end, 1:step:end);
[m,n] = size(im2_level);
[X,Y] = meshgrid(1:n, 1:m);
X_down = X(1:step:end, 1:step:end);
Y_down = Y(1:step:end, 1:step:end);
hold on;
quiver(X_down, Y_down, u_down, v_down, 0.5, 'color',[1 0 0]);

답변 (1개)

Aishwarya
Aishwarya 2023년 10월 6일
편집: Aishwarya 2023년 10월 6일
Hi Paul,
As per my understanding you are facing difficulties in changing the plot properties of the flow estimation output.
To address your questions.
Change the property of the figure:
  • Change “Position” property of the figure window according to image size and position of figure required.
f = figure;
f.Position = [10 10 500 500];
To add axis and grid to the plot:
  • “axis on” will add the axis in pixel units. Consider making the following changes in the code:
hold on;
quiver(X_down, Y_down, u_down, v_down, 0.5, 'color',[1 0 0]);
% Add axis and label them
axis on;
xlabel('X (pixels)');
ylabel('Y (pixels)');
% Turn on grid
grid on;
hold off;
Hope this helps!
Regards,
Aishwarya Palli

카테고리

Help CenterFile Exchange에서 Image Processing and Computer Vision에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by