Ask Your Question

meisam's profile - activity

2020-01-28 04:22:30 -0500 received badge  Enthusiast
2019-11-30 04:42:09 -0500 answered a question Is there implementation of Procrustes analysis in C++/OpenCV?

This may be it: https://subokita.com/2014/04/07/procrustes-analysis/

2016-04-27 07:57:54 -0500 received badge  Editor (source)
2016-04-27 07:56:14 -0500 answered a question How to read pixel every frame?

Hi, your pixel assigning in the loop is wrong. You read some repetitious pixels from pixelsRGB and wrote them into m_frameData pixels, in other word, pixels coordinates of pixelsRGB doesn't update properly in each loop. And you also have to alternate x and y in atXYZC. You should try this(It works for BGR format not RGB, you don't have to change the image to RGB) :

for(unsigned int x = 0; x < frame.rows; x++)
{
for (unsigned int y = 0; y < frame.cols; y++)
{

                m_frameData->atXYZC(y,x,0,0) = (int) pixelsRGB[ (3*y) + 3*x*frame.cols];
                m_frameData->atXYZC(y,x,0,1) = (int) pixelsRGB [ (3*y+1) + 3*x*frame.cols];
                m_frameData->atXYZC(y,x,0,2) = (int) pixelsRGB[ (3*y+2) + 3*x*frame.cols];

} }

I hope it works.