- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
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 copiado
5 Respostas
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
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
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
You are wrong: the code says "if not rgb24 or not rgb32 then don't do it".
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
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.
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
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?
- Marcar como novo
- Marcador
- Subscrever
- Silenciar
- Subscrever fonte RSS
- Destacar
- Imprimir
- Denunciar conteúdo inapropriado
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

Responder
Opções do tópico
- Subscrever fonte RSS
- Marcar tópico como novo
- Marcar tópico como lido
- Flutuar este Tópico para o utilizador atual
- Marcador
- Subscrever
- Página amigável para impressora