This question relates to somewhat practice and experienced based process. I have an Mat binary image which consist of simple white color polygons in a black background. Actually those polygons represent an article in a newspaper page. So what I want is to store the details of the location of the article inside the newspaper page. One Mat image has only one polygon in it. So one option is to
- Use pure OpenCV calls to store Mat into a .xml or .yml file (How to write a Float Mat to a file in OpenCV : accepted answer)
- Find the coordinates of the polygon where there are vertices and store only those coordinates into the database
Following is a sample image of a Mat I am going to store.
The first option seems possible but I don't know how to implement the second approach. If it is possible, that would be most efficient as I think, because then there would be only few coordinates to be saved for each article. I can implement a complex procedure to find the vertices for that and also to redraw the Mat image using those coordinates when needed. But I hope there is a simple process in opencv for this task.
So what I want to know is which approach is better and if the second approach is better, how to do that in opencv with c++. I am neither an opencv expert nor c++ expert so an appropriate answer would save me many hours and also efficiency of the program.
See Question&Answers more detail:os