Hi,
I am working on a project at the moment that uses openCv for the blob detection. I have created a polyline around the blobs but I want to create points on the polyline and get the normals of the polyline. The idea is that when the computer detects a blob it produces a noise growth ( in the direction of the normal angle) which starts from the polyline outlining the blob.
much appreciate any help.
This is how i am creating the polyline.
polyLine.clear();
for (int i = 0; i < blobs.size(); i++){
ofPolyline tempPl;
tempPl.addVertices(blobs[i].pts);
tempPl.addVertex(blobs[i].pts[0]);
tempPl = tempPl.getResampledBySpacing(10);
polyLine.push_back(tempPl);
}
You have to compute the normals per segment. To do so, as you already have the points (blobs[i].pts), you can compute them directly.
For each point, get the next point (this are the points forming the segment), and compute the normal of the line bewteen the points ( normal ( point2 - point1 ) )