Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

C# breaking monochrome image down into new images.

  1. May 22, 2014 #1
    Hi all, c# coder here, i am seeking ways to segment images into separate bitmaps based on colour values.

    I have an image, and i have already applied edge detection and changed the threshold to 230 to give me black and white "blobs". Now the issue is finding these blobs, and copying them into separate bitmaps. Now I want to do this without external libraries as this is for me to understand how it works.

    Every time I Google this I get a opencv or aforge link. Does anyone know of a link or a technique name? Note: it is not breaking it down to monochrome that I seek it is separating the black from the white.

    Any help appreciated, thanks.
  2. jcsd
  3. May 23, 2014 #2


    User Avatar
    Gold Member

    It sounds like "masking" to me.
    http://en.wikipedia.org/wiki/Mask_(computing [Broken])
    Last edited by a moderator: May 6, 2017
  4. May 23, 2014 #3
    nice but not what I'm looking for. that combines to images, I'm looking to separate.
  5. May 23, 2014 #4


    User Avatar
    Gold Member

    I'm not sure I understand. If the image is already in black and white, isn't it technically already separated?
  6. May 23, 2014 #5
    I don't know quite what you want, but I'm guessing that you want to crop copies of your original image based on where the blobs are in the filtered (edge-enhanced, high-contrast) image.

    So, if I'm guessing correctly, your original picture has several relatively bright objects on a dark background. You apply the 230 contrast to create a mask of the object of interest, but you do an edge-enhancement first to keep the 230 contrast from trimming the objects too much.

    Now you want to identify continuous white regions and draw rectangles around them so you can use those rectangles to crop copies of the original image.

    Is this what you're trying to do?

    If I'm guessing right, the terms would be object extraction (which you have already done), image segmentation, and auto-cropping. Also, to some extent, "image detection".
    Last edited: May 23, 2014
  7. May 23, 2014 #6
    yes scott!thanks! that is what I want. but I need to get four edge points so I can crop them.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook