I am looking for conceptual advice regarding managing a large quantity of data in a computer vision project of mine. I am having trouble a) conceptualizing and b) implementing a concept of coordinating this large stream of data coming both as input to the program from the cameras and generated by the code.

So the data I have to get a handle on is separable into five separate 'streams' as I'll call them:

Raw frames (direct input from camera) Target images (sub-frames, taken from the previous image stream) Timestamps (for the raw frames) Vehicle attitude data (GPS, body angles, etc. from a wireless serial port connection to the vehicle) Attitude data timestamps

The general flow, if we were to do this completely sequentially, would be:

Frame = grabInputFrame();
TargetsVector = searchForTargets(Frame);
VehicleData = getDataFromVehicle();

for each Target in TargetVector (
    targetData = processData(Target, VehicleData);
    updateTargetLog(targetData);
}

So here's the deal: I'm trying to do this by means of threads, since the algorithms are very processor intensive and not sequentially related (I mean that I don't need the color data to get the GPS coords of the target). BUT, I do need to coordinate images with targets and timestamps with those images, so I can use the right vehicle data for the right image, etc.

A friend of mine suggested a relational DB approach, but I'm using C++. What I wonder is, is there a way to mimic relational DBs in C++ (having keys associate with data, like a timestamp or target ID associate to the data or target image)? Would connecting to a SQL DB make this easier to manage? Is there a significant performance penalty associated with doing so? The most important point here is that whatever I do, I have to be able to lock the shared data so I can multi-thread it safely.

I hope that someone with some experience in hierarchical data structures like this can shed some light on my situation. I thank you in advance for your ideas and criticisms.

有帮助吗?

解决方案

OpenMP may be helpful for such a problem, there are inbuilt functions provided for locks and atomic operations. Since you have 5 parallel operations, you can create 5 threads and based on the threadId, perform different operations.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top