Published
Edited
Mar 25, 2021
Importers
1 star
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
myRealLineDataEvol = realLineEvolProc(
selectedAreaDemo, // the area on which you want to get a line of pixel
videoFramesDemo, // the frames of the video
columnIdxDemo, // choose the column you want on the rect
hProjDemo, // assuming you project your area on a rect. hProj is the height of this proj
projAreaDemo, // your selected area is composed of 4 points (0 to 3). Proj Area is an array that tells how you want the area to be projected on the rect
)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
projArea = [
{x:wProj,y:0}, // point 0 projected coordinates
{x:wProj, y:hProj}, // point 1 projected coordinates
{x:0, y:hProj}, // point 2 projected coordinates
{x:0,y:0} // point 3 projected coordinates
];
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
function getMatrixProjToReal(selectedArea,projArea){
const a = forwardProjectionMatrixForPoints(selectedArea);
const b = forwardProjectionMatrixForPoints(projArea).adjugate();
return a.multiply(b);
}
Insert cell
Insert cell
Insert cell
getRealLineExtrimities = function(columnIdx,matrixProjToReal){
const projPoint1 = ({x:columnIdx,y:0}); // line start on the projected view
const projPoint2 = ({x:columnIdx,y:hProj}); // line end on the projected view
const realPoint1 = projectPoint(projPoint1,matrixProjToReal); // line start on the original/real image
const realPoint2 = projectPoint(projPoint2,matrixProjToReal); // line end on the real image
return [realPoint1,realPoint2]
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
realLineEvolProc = function(
selectedArea, // the area on which you want to get a line of pixel
videoFrames, // the frames of the video
columnIdx = 0, // choose the column you want on the rect
hProj = 100, // assuming you project your area on a rect. hProj is the height of this proj
p_projArea = projArea, // your selected area is composed of 4 points (0 to 3). p_projArea is an array that tells how you want the area to be projected on the rect
)
{
const matrixProjToReal = getMatrixProjToReal(selectedArea,p_projArea);
const realLineCoords = getRealLineCoords(columnIdx,hProj,matrixProjToReal);
const realLineEvol = getRealLineDataEvol(realLineCoords,videoFrames);
return realLineEvol
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
projAreaDemo = [
{x:wProjDemo,y:0}, // point 0 projected coordinates
{x:wProjDemo, y:hProjDemo}, // point 1 projected coordinates
{x:0, y:hProjDemo}, // point 2 projected coordinates
{x:0,y:0} // point 3 projected coordinates
];
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more