Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Monday, May 14, 2012 8:46:22 AM(UTC)

johnsz  
johnsz

Groups: Registered
Posts: 9


It seems, that it works with "OR" logic between color components.
How to use it with "AND" logic ?
I need to found "near-to-black" images (dark reds, greens, yellow, etc) and change thems to black. all other pixels should be untouched.
it seems, it could be processed with 1 library call in HSV colorspace, but "AND" logic required.
Or, more suitable way exists ?
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Tuesday, May 15, 2012 5:13:44 AM(UTC)

Ibrahim  
Guest

Groups: Guests
Posts: 3,022

Was thanked: 2 time(s) in 2 post(s)

John,
There is an easy approach to do your requirements. You can use the L_SetBitmapRgnColorHSVRange() function to create a region that contains all "near-to-black" colors. After that, you should call the L_FillBitmap() function to fill the region that you create with the black color.
For more information about L_SetBitmapRgnColorHSVRange() and L_FillBitmap(), please see them in our main C DLL help file that is shipped with the toolkit.
 
#3 Posted : Thursday, May 17, 2012 6:25:36 AM(UTC)

johnsz  
johnsz

Groups: Registered
Posts: 9


Thank you, this really helpfull.

I have another questions:
1. Assume, that some region selected.
How to detect that pixel inside region or not ?
Also, it would be very useful to have some iterator (or callback function), that called for each pixel inside region. I think, this will greatly reduce processing time. Possibly, you already have this functionality.

For example, construction like this:
for each pixel in region do
do some pixel processing
enddo
 
#4 Posted : Sunday, May 20, 2012 12:54:59 AM(UTC)

Ibrahim  
Guest

Groups: Guests
Posts: 3,022

Was thanked: 2 time(s) in 2 post(s)

John,
Most of our image processing functions will only affect the region if it's defined. If you need these functions, using them would be much faster than working on every pixel alone. The loop that accesses individual pixels like that would most likely be very slow compared to our image processing functions.

If you have questions related to processing other than the Fill function we discussed here, please send the details of your question in an email to support@leadtools.com or open a separate forum thread for each issue.
 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.068 seconds.