I want to change the backgroung color of image into transparent and then work with the pixels of it
Show older comments
Is it possible to crop a part of the image automatically without drawing the circle or any other shape around it?
I already have the special shape (nearly a circle) and black backround color around it, but would like to only have the special shape part of it, which is mostly not black. (picture attached -> komplett_S1.jpg) Because I have to load different images, I can not only "draw" one shape and it fits every image, right?
At the moment I cut the picture to a "square" which has black spots at the corners of the picture which I want to cut too.
I am able to change the original colored image into grayscale, into binary image and then draw a circle around the biggest blob. The aim is, to "cut" this circle for the image in original color and grayscale too. (picture2) When changing the backgroungcolor of the picture there is no transparency which I wish to have and the edges are not clear as drawed by the circle in "Biggest Blob". (picture3 and picture4)
In my nex step I would like to sum the small dots inside the special shape (circle) which are brighter than a special value. All the black spots inside the red circle drawn should be deleted or better to say, summed up for another value (for example tfa).
But at first I want to "cut" and show the special shape (image cutted at the red circle in grayscale and original color) of the image. Is there any way for doing that?
The grayscale picture which I want to work with in the future should be shown at the top in the middle and the original image in the right top corner (picture5).
Many thanks for your help!
2 Comments
For the purposes of processing, there is no need to crop or make anything transparent. Nothing in base MATLAB or IPT will handle an image with attached alpha data, so making a transparent image only creates a new problem.
Create a mask which describes the colored regions you want to analyze, (e.g. such that each region is represented by one blob). You can then count the blobs or find their average intensity or do whatever you want on them.
If you want to find information about interstitial spaces which may include gaps at the perimeter, perhaps you can consider the difference of the aforementioned mask and its convex hull.
What are the specific statistics that are needed? Blob count? Area? What is the appropriate brightness metric/threshold? Do green regions which aren't bright enough count as black regions?
Svenja Jetzinger
on 12 Apr 2024
Accepted Answer
More Answers (1)
Categories
Find more on Region and Image Properties in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


