opencv - Image Segmentation -


so trying write code lets me segment fuses see in picture below. have come 2 approaches:

1) based on color. threshold using opencv's inrange function. approach works fuses except brown fuse. brown fuse similar in colour fusebox , therefore it's hard segment out.

2) considered thresholding image heavily can detect white points/terminals on fuses using opencv simpleblobdetector. filter out blobs distances each other. know size of fuses, can filter out invalid fuses. approach works fuses white 1 appears in thresholded images.

i hoping pointer on how segment such image. background subtraction work?

enter image description here

my experience segmentation single approach not work difficult segmentation. if 1 algorithm works brown , other white, union of 2 should yield complete result. know nice have 1 elegant algorithm, many of best results have had resort hybrid of multiple techniques.

i'd consider separating channels rgb , hue, saturation, , value , looking @ each channel separately. browns similar in color have different saturation or color channel values. adding , subtracting different channels can enhance contrast. simple in many cases produces fast , simple output can used thresholding, watershed (see below), or perhaps background subtraction.

i think might want try watershed algorithm. many examples , explainations available. watershed requires provide mask contains background (the fusebox , table) , piece of each of foreground objects (fuses). understand it, can detect contacts on fuses piece done.

another approach accept can't see brown fuses. if can detect empty slots , every other color, may able know deduction brown ones are.

it's had know work beforehand without experimentation, should give ideas of how improve have.


Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -