Hello to all!!
I am trying to extend the FastCV corner detection sample in order to integrate OpenCV in it to combine the two libraries.
My philosophy is to keep the exact same code as to the point of fcvColorYUV420toRGB565u8 is being used where the YUV image from android is being converter to RGB565 in ordered to be proceced. From that far and beyond I will use both FastCV and OpenCV functions in order to achieve my result.
The thing I want to do with OpenCV recquires RGB888 images instead of RGB565. So I decided to use the new function fcvColorRGB565ToRGB888u8 which is added in FastCV 1.2.0 in order to convert the RGB565 image to RGB888 once there isn't any YUV420 To RGB888 function (there is fcvColorYUV420toRGB8888u8 to convert it to RGB8888 but OpenCV does not read RGBA images so I would have to cut the A channel, and that is why I preferred the way described above).
The problem is that when I try to use two fcvColor functions concatenated (the one after the other) the application crushes without throwing any error that I could see what the problem is to fix it. I put the second fcvColor function exactly after the first one and the program crushes. I thought that maybe a problem would occur if I use the destination image of the first function as source image (pointers of data in fact) of the second function. So I created new variables 128 bit alligned and passed it into the second function and again the same happens. I have tried to use a second fcvColor function in another part of the code, another fcvColor function not the one described above, in order to see if that works and again the program crushes.
What seems to be the problem? I can't use two fcvColor functions the one afther the other?
Panayiotis
Hi,
If you can share your code snippet that caused the problem, it will help us investigate the issue more easily.
Thanks,
-Jeff
The code isn't something specific, I use exactly the same coce as the example and I add at the end of the first fcvColor the second one, outside of the loop. So:
...
I have also tried to use the second function with new arguments and again it crushes.
Now I have tried to use only the second fcvColor (from rgb565 to rgb888) without using the first one and again it crashes. Like the function has a problem...
Nevertheless, I have tried to use another fcvColor function (from YUV420 to rgb8888) by its own, without first using YUV420toRGB565 and it works. But when I combine two fcvColour functions it crushes.
Hi,
Can you provide how renderBuffer and rgb888Output buffer are allocated as well as the w and h value?
Thanks.
We are investigating fcvColorRGB565ToRGB888u8, meanwhile you may try another API fcvColorYCbCr420PseudoPlanarToRGB888u8 that converts YCbCr420 to RGB888 directly.
The w and h values are standard and are equal to 800 and 480 respectively (multiple of 8).
For the aligning and the allocation of the two buffers I use exactly the same method as is used with the jimgData:
Thanks for the reply. But I did not see how the rgb888Output buffer is allocated. The code snippet is taking care of the alignment but that's not the concern. We need to see how big the buffers are.
You code snippet shows that the state.alignedImgBuf is of size w*h*3/2 and the data are copied over from rgb888Output. However, rgb888Output buffer size should be at least w * h * 3.
Another concern is that you modified the rgb888Output buffer address for alignment, did you have a copy of the original address?
Just wanted to follow up with this issue. We tried many different sized images on fcvColorRGB565ToRGB888u8. No issue has been found. Would like to know if you have followed previous recommendations, and if you are still seeing any problem.