I am working on a program that detects faults in solar modules using thermographic images.
Currently I am using the cascade object detector training it with several images of defects. It works (kind of), but is not as precise as I would like it to be as there is a lot a of objects in the ground that are falsely detected.
Anyway, my idea is to first detect all the modules by putting one boundary box over each module (I already done this), for example in one image I will have 30 boundary boxes. Then, with another detector look for any "fault looking shape" just inside of each of the previous modules boundarybox ROI's.
For example, I have this image, please imagine there are green boundaryboxes over each of the modules. Lets say I have 40 boxes.
I want to run another detector that will only detect objects inside of each of the modules boundary box, I was thinking on a for loop that will detect an object first inside module bbox 1 ROI, then 2, then 3, then 4, etc. using this:
bbox = detector(I,roi) detects objects within the rectangular search region specified by roi. Set the 'UseROI' property to true to use this syntax.
The problem is I dont know how to make this, Are the boundaryboxes saved in a matrix? How can a use a for loop to get the coordinates of a bbox to use it as a ROI for another detector? Can someone help me providing me some example code that would make something like this?
Thank you a lot!