extractselectionregionhalcon

Halcon - extract object from low contrast noisy image


I have this image:

enter image description here

and would need to get the region of the crate. like this:

enter image description here

I have not been able to get a clean selection so far. I tried thresholding the image, tried after adding some mult_image, add_image, but no luck.

Any help on detecting the outlines/region of the crate is greatly appreciated.

NOTE: the crates can be different hights, even higher than this. in that case the imgage itself is higher too. BUT this implies that the bright areas left and right of the crates might not be entirely visible.

Thank you

EDIT:

This is the original image

enter image description here


Solution

  • This is a quick and dirty solution. Thresholding seems to be working OK, but first erode the region and than dilate it:

    read_image (Image, 'D:/OneDrive - Subpixel d.o.o/Other/Stackoverflow/3/4e7Za.png')
    rgb1_to_gray (Image, GrayImage)
    equ_histo_image (GrayImage, ImageEquHisto)
    threshold (ImageEquHisto, Regions, 145, 227)
    fill_up (Regions, RegionFillUp)
    
    erosion_circle (RegionFillUp, RegionErosion, 30.5)
    dilation_circle (RegionErosion, RegionDilation, 30.5)
    

    It seems that the color camera would solve your problem much better, since the crate does have other color. Is this an option?

    enter image description here