c++: 4 channel image. How to trim edges with transparency = 0?
I have a 4 channel image (png), what is the best way to trim away the edges that has 0 transparency with performance in mind?
Before:
After:
Thanks.
Can you upload the image with actual transparency?
not really an opencv problem.
@sjhalayka I uploaded the actual image with transparency. @berak In a complex distributed system it is a bad choice to use multiple libraries for image Computer Vision and Image processing (ImageMagick can do trimming). But since OpenCV is sophisticated enough to pretty much implement anything to an image, why not use it for all purposes at once, if you have an implementation idea for trimming go ahead and share it does not have to be code.
@mohsene, -- noone cares about image transparency in computer-vision.
@berak I didn't know that this community helps depending on "personal interests". thanks for leaving your helpful comments ๐๐ผ
@mohsene -- Good morning LOL. Your best bet is to start by scanning each row. Do you know how to do that in C++/OpenCV?
@mohsene, what have you tried so far, on your own ? (anything about "complex distributed system" is just hot air, if your skills did not allow to try anything (please at least proove, you did !), and you're only fishing for someone to write your code.)
@mohsene, -- btw, https://github.com/mohsene that's you ?
again -- you HAVE TO try something on you own, before asking questions, no ?
@berak I was expecting you when I first wrote this question; I've read many questions in this community and I did try multiple solutions but they weren't that efficient (one for instance is accessing each pixel which is a bad idea).
I know that you are the type of guy who humiliates who you don't like (i've seen your responses in this community you are kind of popular for that in here). I did not ask for code. even a hint would be much appreciated to lead me to do the task myself. at the end of the day thanks for everyone and just because you have knowledge does not mean you treat people (starters) like that and call them morons.
@berak sir, distributed systems (microservices) are not hot air, it is a very efficient and effective way of building a complex system in smaller components that are reusable and easy to deploy on their own and all connected together to handle massive user load. read more about Kubernetes, Spinnaker and Docker and how they play together to achieve that. deploying a secondary image processing/computer vision system beside OpenCV would be an over kill for such system. that is why I mentioned that I had no other choice but to implement trimming using OpenCV keeping in mind that OpenCV in my case is used for computer vision purposes as well such as nudity detection, facial recognition and color extraction.