Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

the k-means clustering will only give you grayscale bands. that operation is not helpful here. canny makes no sense either.

now I can think of two ways. to handle this. if the orientation label is clearly more dense than the imaged tissue, you can identify the label with a high brightness threshold. then apply some morphological dilate and erase.

if it isn't clearly denser/brighter (as is the case in your picture... there's a spot in the tissue that rivals the label), you'll have to go the contours/components way:

  • crop away the white border, if there is any
  • otsu thresholding to binarize
  • morphological close to link up the tissue sufficiently
  • findContours or connectedComponentsWithStats
  • sort the contours/components by area

this presupposes that your noise (the orientation labels) aren't near the imaged tissue. if they are, you'd have to identify them some other way and then erase them using inpainting.

the k-means clustering will only give you grayscale bands. that operation is not helpful here. canny makes no sense either.

now I can think of two ways. ways to handle this. if the orientation label is clearly more dense than the imaged tissue, you can identify the label with a high brightness threshold. then apply some morphological dilate and erase.

if it isn't clearly denser/brighter (as is the case in your picture... there's a spot in the tissue that rivals the label), you'll have to go the contours/components way:

  • crop away the white border, if there is any
  • otsu thresholding to binarize
  • morphological close to link up the tissue sufficiently
  • findContours or connectedComponentsWithStats
  • sort the contours/components by area

this presupposes that your noise (the orientation labels) aren't near the imaged tissue. if they are, you'd have to identify them some other way and then erase them using inpainting.

the k-means clustering will only give you grayscale bands. that operation is not helpful here. canny makes no sense either.

now I can think of two ways to handle this. if the orientation label is clearly more dense than the imaged tissue, you can identify the label with a high brightness threshold. then apply some morphological dilate and erase.

if your orientation label is not clearly denser/brighter than the imaged tissue (there's a spot in the tissue that rivals the label).

since it isn't clearly denser/brighter (as is the case in your picture... there's a spot in the tissue that rivals the label), denser/brighter, you'll have to go the contours/components way:

  • crop away the white border, if there is any
  • otsu thresholding to binarize
  • morphological close to link up the tissue sufficiently
  • findContours or connectedComponentsWithStats
  • sort the contours/components by area

this presupposes that your noise (the orientation labels) aren't near the imaged tissue. if they are, you'd have to identify them some other way and then erase them using inpainting.

your label also has some kind of faint halo (you can make out a rectangular carrier for the text), so that's an issue as well.

the k-means clustering will only give you grayscale bands. that operation is not helpful here. canny makes no sense either.

now I can think of two ways to handle this. if the orientation label is clearly more dense than the imaged tissue, you can identify the label with a high brightness threshold. then apply some morphological dilate and erase.then erase that area (img[mask] = 0).

your orientation label is not clearly denser/brighter than the imaged tissue (there's a spot in the tissue that rivals the label).

since it isn't clearly denser/brighter, you'll have to go the contours/components way:

  • crop away the white border, if there is any
  • otsu thresholding to binarize
  • morphological close to link up the tissue sufficiently
  • findContours or connectedComponentsWithStats
  • sort the contours/components by area

this presupposes that your noise (the orientation labels) aren't near the imaged tissue. if they are, you'd have to identify them some other way and then erase them using inpainting.

your label also has some kind of faint halo (you can make out a rectangular carrier for the text), so that's an issue as well.

the k-means clustering will only give you grayscale bands. that operation is not helpful here. canny makes no sense either.

now I can think of two ways to handle this. if the orientation label is clearly more dense than the imaged tissue, you can identify the label with a high brightness threshold. then apply some morphological dilate and then erase that area (img[mask] = 0).

your orientation label is not clearly denser/brighter than the imaged tissue (there's a spot in the tissue that rivals the label).

since it isn't clearly denser/brighter, you'll have to go the contours/components way:

  • crop away the white border, if there is any
  • otsu thresholding to binarize
  • morphological close to link up the tissue sufficiently
  • findContours or connectedComponentsWithStats
  • sort the contours/components by area

this presupposes that your noise (the orientation labels) aren't near the imaged tissue. if they are, you'd have to identify them some other way and then erase them using inpainting.now you can erase just the label, leaving tissue and background, or select the tissue and erase everything else.

your label also has some kind of faint halo (you can make out a rectangular carrier for the text), so that's an issue as well.

I'd suggest the latter.

all this presupposes that your noise (the orientation labels) aren't near the imaged tissue. if they are, you'd have to identify them some other way and then erase them using inpainting.