Filter löschen
Filter löschen

Erase color outside of region of interest in image

3 Ansichten (letzte 30 Tage)
Samantha Wallace
Samantha Wallace am 31 Mai 2018
Kommentiert: Walter Roberson am 1 Jun. 2018
I have a template image that has the outline of a human body, front and back. An individual colors in areas of interest on this template sheet, but a lot of the times they color outside of the body border, I only am interested in analyzing the data that is colored inside of the body border. Does anyone know a way I can erase or ignore the parts colored in outside the body on the template sheet?

Antworten (1)

Walter Roberson
Walter Roberson am 1 Jun. 2018
Presuming that mask is a 2D logical array the same number of rows and columns as your original color image, then:
masked_image = RGBImage .* repmat(mask, [1 1 3]);
The masked image would have 0 in the places to be ignored.
  2 Kommentare
Samantha Wallace
Samantha Wallace am 1 Jun. 2018
The image that is colored on using an iPad just a paper with two body outlines(front and back) with a white background and some words. Then a new image is made once they color on the original image. I haven't been able to get the method you mentioned above work for my application.
Walter Roberson
Walter Roberson am 1 Jun. 2018
As you have control over the template, it sounds to me as if it would be easy for you to create an additional array which was true for each location in the body outlines and false elsewhere including the white background and the words. If you call that array "mask", and if the image to be processed is the same size then my code applies.
More difficult would be a case where you are taking a picture of what they draw and processing the picture. In such a situation it is likely that the picture would not be exactly aligned with the template and the focal distance is unlikely to be exactly fixed so the resolution would probably not exactly match the template. If we also assume that the outline might be covered over by the colouring, then extracting the inside of the outline might require some kind of image registration or cross-correlation or something like that. If the person colored completely over the edges of the template then the problem could get more difficult.

Melden Sie sich an, um zu kommentieren.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by