Comments (6)
One thing to note from your code:
//new MaskedFilter(new Sepia(), image).ApplyInPlace(image);
This looks very strange to me. You use same image as mask image, as input image
for processing. I would not expect this.
The code around ApplyMask() seem to be valid. Did you try doing these steps
first in IPLab application and see if it all works (just to exclude coding
errors):
http://www.aforgenet.com/projects/iplab/
I believe you are telling about 24 bpp and 8 bpp input image, not mask. Since
mask can be only 8 bpp (you would get exception otherwise).
Original comment by [email protected]
on 13 Aug 2015 at 9:36
from aforge.
Very appreciate for your prompt response.
*Correct:* //new MaskedFilter(new Sepia(), *imageMask*).ApplyInPlace(*image*
);
Sorry about this issue, cause I use this function:
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
------------------------
static void ApplyBlobMaskingOnImage(ref
AForge.Imaging.UnmanagedImage image, ref System.Drawing.Rectangle[] rects)
{
if (rects == null || rects.Length == 0)
return;
var imageMask = AForge.Imaging.UnmanagedImage.Create(
image.Width, image.Height, *image.PixelFormat*);
foreach (var rect in rects)
if (rect != System.Drawing.Rectangle.Empty)
AForge.Imaging.Drawing.FillRectangle(imageMask, rect,
System.Drawing.Color.White);
new ApplyMask(imageMask).ApplyInPlace(image);
//new MaskedFilter(new Sepia(), imageMask).ApplyInPlace(image);
}
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
------------------------
But I don't care that I must use Gray image mask as overlay instead RGB
image mask even for RGB image! and "ApplyMask" or "MaskedFilter" don't
throw exception about this!
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
------------------------
.
.
.
var imageMask = AForge.Imaging.UnmanagedImage.Create(
image.Width, image.Height,
*System.Drawing.Imaging.PixelFormat.Format8bppIndexed*);
.
.
.
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
------------------------
Be nice if the filters check for overlay that be Grayscale.
Very very good and thanks.
Good luck.
Hashem.
Original comment by [email protected]
on 13 Aug 2015 at 12:27
from aforge.
The documentation clearly says about the fact that mask must be 8bpp:
http://www.aforgenet.com/framework/docs/html/fbcfe698-f9a2-a672-c334-30983103064
3.htm
The code tells an exception should be thrown if it is not 8bpp:
https://code.google.com/p/aforge/source/browse/trunk/Sources/Imaging/Filters/Oth
er/ApplyMask.cs
Original comment by [email protected]
on 13 Aug 2015 at 1:05
- Changed state: Rejected
from aforge.
You are right and this issue is discarded, I'm sorry.
But I couldn't find the try catch blocks in my code that prevent to appear
this exception. All of them content has this
command:"MessageBox.Show(ex.Message);".
Original comment by [email protected]
on 13 Aug 2015 at 1:29
from aforge.
________________________________________________________
if ( ( maskImage != null ) && ( maskImage.PixelFormat !=
PixelFormat.Format8bppIndexed ) )
{
throw new ArgumentException( "The mask image must be 8
bpp grayscale image." );
}
*maskImage **= value;*
unmanagedMaskImage = null;
mask = null;
_________________________________________________________
I found it!!!! Bug is exist!
Check is before set value!
On Thu, Aug 13, 2015 at 5:59 PM, Hashem Zavvari <[email protected]>
wrote:
Original comment by [email protected]
on 13 Aug 2015 at 1:48
from aforge.
Yes, good spot. Somehow the silly bug has survived.
Original comment by [email protected]
on 13 Aug 2015 at 1:51
- Changed state: Accepted
- Added labels: Project-Imaging
from aforge.
Related Issues (20)
- FindHull Integer overrun HOT 2
- GetPinCapabilitiesAndConfigureSizeAndRate() does not release streamConfig HOT 1
- problems with 3 cameras HOT 2
- NewFrame event doesn't fire after stop and start again in Windows service HOT 4
- ignoring 12bit Videoformat fails ... obviously a typo <= instead of >= HOT 1
- ProcessImage support for 32bpp
- GC.KeepAlive for UnmanagedImages HOT 2
- Subtraction of double with Complex has wrong output HOT 1
- Access Violation in Clone() for ROI subimage aligned with bottom of original image
- Keep Aspect Ratio HOT 1
- Add Deep Reinforcement Learning to MachineLearning namespace
- Export to GitHub HOT 4
- Missnig packages on NuGet HOT 1
- Patch for memory leak in Video.FFMPEG's VideoFileWriter::Close() HOT 1
- Optional standard gradient calculation in Sobel filter
- getting timestamp with avireader method
- AForge.Net VideoCaptureDevice.VideoCapabilities doesn't work.
- Convolution filter with threshold doubles frequency of 'zero' values
- POSIT does not properly offset Z axis.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aforge.