Info
This question is closed. Reopen it to edit or answer.
freehand_masking_demo.m on a .mat file
1 view (last 30 days)
Show older comments
I have a grayscale image. I found the fft of that image.
B = fftshift(fft2(y)); C = log(1+abs(B));
I masked some specific pixels using C(949:1000,1102:1120)=1; But, I need to mask some random pixels. I tried using the matlab code shown in 'freehand_masking_demo.m', But I realise that it can only mask the region from an image (.tif or other format) as it needs to read the file. But, my file is not an image file it is the fft of original image.
Could you please guide me how to mask the region from 'C'?
I also tried,
maskedImage = bsxfun(@times, C, cast(burnedImage,class(C)));
With the above code I get the original image inside the masked region with blackout surrounding but I need otherway round i.e. black masked region with surrounding the original image.
I would like to thank you in advance for any help.
0 Comments
Answers (2)
Image Analyst
on 6 Nov 2015
Just skip the part of the demo where it calls imread() and reads the image from a file, and use your C variable instead.
2 Comments
Image Analyst
on 9 Nov 2015
Regarding your "Answer" -- Somehow you did not integrate my demo code properly to properly mask your grayscale image. If you don't have it figured out yet, attach your code so I can fix it.
komalben shah
on 9 Nov 2015
1 Comment
Image Analyst
on 9 Nov 2015
This should not have been an "Answer" to your original question, but a comment to me.
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!