Original Post
Hello everyone! This is my first time using the forum, so please forgive me for any mistakes I might make!
Over the past few months, I have been working on an algorithm with these specifications:
input: image of a bubble and some buffer space around it (in 8bpp grayscale)
output: true if the bubble is marked, false otherwise
false: [sharedmedia=core:attachments:9038][sharedmedia=core:attachments:9036][sharedmedia=core:attachments:9035]
true: [sharedmedia=core:attachments:9033][sharedmedia=core:attachments:9034][sharedmedia=core:attachments:9032]
also true: [sharedmedia=core:attachments:9037]
I have tried a lot of different methods, such as:
[font=arial]1. Color method: taking the average darkness of the region surrounding the bubble ([font=courier new,courier,monospace]surDarkAvg[/font]) and the darkness of the entire region ([font=courier new,courier,monospace]darkAvg[/font]). The darker [font=courier new, monospace]darkAvg [/font][font=Helvetica Neue, Arial, Verdana, sans-serif]is than [font=courier new,courier,monospace]surDarkAvg[/font], the higher change of being marked.[/font][/font]
2. Edge detection: detecting the edges (= contiguous black pixels) of the bubble and noting that the farther apart edges are, the more likely the bubble is not filled
However, these methods yield widely varying results on darker bubbles and ones with different resolutions, so aren't accurate. I have spent a lot of time on this, so I wanted to ask you for your thoughts.
Also, there are complications like some bubbles being marked messily, where edge detection is not as accurate.
Thanks in advance!
Over the past few months, I have been working on an algorithm with these specifications:
input: image of a bubble and some buffer space around it (in 8bpp grayscale)
output: true if the bubble is marked, false otherwise
false: [sharedmedia=core:attachments:9038][sharedmedia=core:attachments:9036][sharedmedia=core:attachments:9035]
true: [sharedmedia=core:attachments:9033][sharedmedia=core:attachments:9034][sharedmedia=core:attachments:9032]
also true: [sharedmedia=core:attachments:9037]
I have tried a lot of different methods, such as:
[font=arial]1. Color method: taking the average darkness of the region surrounding the bubble ([font=courier new,courier,monospace]surDarkAvg[/font]) and the darkness of the entire region ([font=courier new,courier,monospace]darkAvg[/font]). The darker [font=courier new, monospace]darkAvg [/font][font=Helvetica Neue, Arial, Verdana, sans-serif]is than [font=courier new,courier,monospace]surDarkAvg[/font], the higher change of being marked.[/font][/font]
2. Edge detection: detecting the edges (= contiguous black pixels) of the bubble and noting that the farther apart edges are, the more likely the bubble is not filled
However, these methods yield widely varying results on darker bubbles and ones with different resolutions, so aren't accurate. I have spent a lot of time on this, so I wanted to ask you for your thoughts.
Also, there are complications like some bubbles being marked messily, where edge detection is not as accurate.
Thanks in advance!