- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
The problem is in CIppImage::ToGray(CIppImage& img, const float* coeffs)
The test below will allways return, and it should not:
if( NChannels() != 3 || NChannels() != 4 )
return -1;;
I think that AND should be used instead of OR:
if( NChannels() != 3 && NChannels() != 4 )
return -1;;
Thank you.
Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Just I verified picnic application with converting from RGB to Gray scale, it works fine, so coding logic should be correct.
Are you getting any error in the result of this function?
Thanks,
Naveen Gv
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You are wrong: the code says "if not rgb24 or not rgb32 then don't do it".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I use the following IPP version:
7.0 build 205.58, [7.0.1032.205]
I used this specific function from my application and it returned -1 for color images.
The function should work if the image is rgb24 or rgb32, that is
if (!(rgb24 || rgb32))return -1;
This is equivalent to:
if (!rgb24 && !rgb32)return -1;
So the code should say"if not rgb24 AND not rgb32 then don't do it".
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hmm, I guess you are correct. It is too early in the morning here...
For rgb24, it would look like this:
if( 3 != 3 || 3 != 4 )
return -1;
This will always return -1 !
Naveen checked in Picnic, but I cannot find any grayscale functions in Picnic.
I also searched for ToGray() references in the source code of Picnic, but I didn't find any references except the implementation.
Naveen, can you clarify?
For rgb24, it would look like this:
if( 3 != 3 || 3 != 4 )
return -1;
This will always return -1 !
Naveen checked in Picnic, but I cannot find any grayscale functions in Picnic.
I also searched for ToGray() references in the source code of Picnic, but I didn't find any references except the implementation.
Naveen, can you clarify?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting idana@picscout.com
I think that AND should be used instead of OR:
if( NChannels() != 3 && NChannels() != 4 )
return -1;
That's true. We will fix it. Probably, there were assertions before with "assert(NChannels==3 || NChannels==4)". When substituting with "if", the expression must be turned inside out completely "NChannels!=3 && NChannels!=4"
Thank you,
Sergey
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page