I am detecting all the regions in an image which contain square shape. I get the detected regions containing squares in terms of its four coordinates (e.g. A,B,C,D) as shown below:
After detecting the region where the square is present i need to create the histogram of the region. At the moment, first of all i am creating separate image for each region and then i send each image to getHistogram(Mat detectedSquare);
to get histogram.
Problem: The computational time is very very high for my application so, i want to find some method in which i can skip creating this separate separate squares for each region.
What i want to do: To directly create the histogram for each region without creating an image for it.
Currenlty i am creating separate image for each region as following and i want to get rid of it:
Mat detectedSquare;
detectedSquare.create(rows, cols, CV_8UC3);
Rect regionOfInterest = Rect (min_x,min_y, rows, cols);
detectedSquare= original_Image(regionOfInterest);
getHistogram(Mat detectedSquare);