✅ Process image using Emgu.CV, WPF app .NET 7.0
So i have to check if the image i upload is in Grayscale or not and based on it make further progress
here is how i upload image:
and here is how i try to convert it but no matter if i upload gray image or not it says the image is already in grayscale, (i checked using ImageJ)
9 Replies
gray means the values in all color channels are equal
you can just go through all pixels' colors and check if they're equal
I'm not wrong, right?
@AntonC i can
but it's slow as shit
i hsould be able to use Emgu.CV lib
to do it
I don't know what that is
I'd just spin up a few threads using this thing https://learn.microsoft.com/en-us/dotnet/standard/parallel-programming/how-to-write-a-simple-parallel-foreach-loop
Write a simple parallel program using Parallel.ForEach
In this article, learn how to enable data parallelism in .NET. Write a Parallel.ForEach loop over any IEnumerable or IEnumerable data source.
if it's still ot fast enough, one could use simd, but I've never needed to use this https://learn.microsoft.com/en-us/dotnet/standard/simd
SIMD-accelerated types in .NET
This article describes SIMD-enable types in .NET and demonstrates how to use hardware SIMD operations in C# and .NET.
But who knows, maybe that library supports this stuff in a simpler way
it does and it's mandatory i use it for this method
but ty for trying to help
but i think im doing wrong type of image
by doing bitmapSource
bacuse it's in system.drawing
and i need to use type from emgu
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.