how can reconstruct one grayscale image with the other??

I have 2 grayimage m1:
and m2:
you can see that m1 and m2 has a little differences.. Is there any way to reconstruct m1 wit m2?? I want to have m1 without any holes and any thing that are like holes... should I turn this images to binary image?

답변 (2개)

Image Analyst
Image Analyst 2014년 9월 18일
I'm sure we've talked this before. You can use active contour (demo attached again) to fill in bays on your image. Then use that to extract the new gray scale image
smoothBorder = activecontour(grayImage, mask, 400, 'edge');
newGrayImage = grayImage; % Initialize
newGrayImage(~smoothBorder) = 0; % Black outside smoothed border.

댓글 수: 9

I like your answer; though, doesn't this require the two image be co-registered first?
Well, if the two images are not co-registered, they need to be first co-registered and then use the active contour.
Well the "mask" is generated from the image, so it's automatically registered with grayImage.
Mohammad Abouali
Mohammad Abouali 2014년 9월 18일
편집: Mohammad Abouali 2014년 9월 19일
Oh, I didn't read your code properly. I think she want to perform some sort of image inpainting to fill up the small circular hole that is on lower left corner of the M1 using information from M2.
In this case you need to first co-register the two images (although they don't appear to be exactly the same. So, use activecontour for both image and then find the translation and possible rotation of these two masks. Then transfer the second image into the first image plane and then using the active contours mask replace those pixels that you want.
It needs more coding than can be provided here, but I think the general outline should be this.

No, see that's the problem when someone just abandons a discussion and starts up a new one where the last one left off. People have no context. This is like the 4th or 5th question on the same topic. She wants to segment the lungs out and I gave her code that works fine when the lungs are dark, but then she said that with one image where some bright mass is connected to the bright tissue surrounding the lungs, it considers the bright mass inside the lungs as the surrounding tissue. But she does not want it to be. She wants it to be considered as being inside the lungs even though it's basically part of the white surrounding stuff. So there's nothing to register/align, it's just a matter of getting a smooth boundary on the lung mask and not having that bay/incursion into the lungs because she wants the white mass to be counted as being inside the lung, not being part of the surrounding tissue, even though intensity-wise it's connected to the surrounding tissue.

hi Image analyst I should explain some things: I am a beginner in matlab and some thing is new or Incomprehensible for me.so when I ask a question and some one help me during this the other questions comes in my mind so I thought if I search more about answer or ask these new questions in a new discussion it is better...if you think that I thought wrong I should say excuse me...you are one of the best person who helps me so your idea is important for me... excuse me excuse me excuse me
Probably this weekend I can find time to start with the masked image (top one) here, and adapt the activecontour() demo I provided to you to that image. If you get it done first, let me know.
sara, I found my code in your other question and tacked on my active contour demo and played around with it for about half an hour for you. I hope it's sufficient. There is no "right" answer. You can adjust the number of iterations to decide how much of the white stuff surrounding the lung should be considered as being in the location of where the lung should "normally" be vs being outside the lung and not be considered part of the lung. You can see it's including the white part in the lower left as lung but it's also getting some white stuff in the upper right as lung. So if you consider that white incursion in the lower left to be lung, then it will also get white stuff going into the lung in other parts, like in the central/between-lung region. It doesn't know where along the perimeter it should include or exclude white stuff - it just does it more or less equally all around. See image below, and code below the image in blue text.
If it's still not good enough for you then you'll have to start a more sophisticated algorithm, and perhaps that's what you really want to do anyway as part of your graduate school work. But of course that could be 2-4 years of work and I can't put in that much time to help you. I hope you understand. Normally I only devote less than 5 minutes to someone's task.
sara
sara 2014년 9월 20일
편집: sara 2014년 9월 20일
thanks Image Analyst yes I understand....I should try these things and merge these with "something that are in my mind and I think maybe is true" ... I will comeback soon.thank you for the time that you spend on my question. Always Your advice are very useful for me.
If it's the best answer you'll think you'll get from anyone, and at least got you started in the right direction, then can you mark it as accepted?

댓글을 달려면 로그인하십시오.

sara
sara 2014년 9월 22일

0 개 추천

dear Image Analyst
If we want to use activecontour our mask should be larger than marker...so If we have for example 13 slices that we want to reconstruct one of them with the others so first we should know that wich one can be mask??am I right?

댓글 수: 1

I haven't used activecontour a lot. I don't know if the starter mask has to be larger than the final mask, or if it can be smaller, or go both inside and outside. Not sure - you'd have to try it. At least that's what I think you were asking, because morphological reconstruction with a marker image using imreconstruct() is a different thing.

댓글을 달려면 로그인하십시오.

질문:

2014년 9월 18일

댓글:

2014년 9월 22일

Community Treasure Hunt

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

Start Hunting!

Translated by