- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I am using R200 camera and java is the programming language.
I am getting both color and depth image data and able to save that data and also able to recreate the image,But while i am trying to get the mapped color image to depth i am getting ERROR .
i am using CreateColorImageMappedToDepth and getting ERROR while trying to get the integer array via using mappedData.ToIntArray(0, mBuff);
Same code was working F200
CodeSnippet:-
    PXCMCapture.Sample sample = senseMgr.QuerySample();
	                    if ((sample.color != null)&(sample.depth != null))
	                    {   
	                           PXCMImage depth= sample.depth;
	                        PXCMImage color= sample.color;
	                        PXCMProjection projection=device.CreateProjection();// Create the PXCMProjection instance.             
	                        PXCMImage mappedColorImage=projection.CreateColorImageMappedToDepth(depth,color); 
	                        System.out.println(mappedColorImage.QueryInfo().format);
	                        System.out.println(mappedColorImage.QueryInfo().height);
	                        System.out.println(mappedColorImage.QueryInfo().width);
	                        PXCMImage.ImageData mappedData = new PXCMImage.ImageData(); 
	                        sts = mappedColorImage.AcquireAccess(PXCMImage.Access.ACCESS_READ,PXCMImage.PixelFormat.PIXEL_FORMAT_RGB32, mappedData);
	                          if (sts.compareTo(pxcmStatus.PXCM_STATUS_NO_ERROR) < 0)
	                        {
	                           System.out.println ("Failed to mapped  color data with depth");
	                          System.exit(3);
	                        }    
	                          
	                          int mBuff[] = new int [mappedData.pitches[0]/4 * cHeight];
	                          mappedData.ToIntArray(0, mBuff); //ERROR on this line   
	                          
	                          m_df.image.setRGB(0, 0, cWidth, cHeight, mBuff, 0, mappedData.pitches[0]/4);
	                          m_df.repaint();
ERROR:-
	#
	# A fatal error has been detected by the Java Runtime Environment:
	#
	#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0000000052f0c220, pid=6160, tid=1384
	#
	# JRE version: Java(TM) SE Runtime Environment (8.0_66-b17) (build 1.8.0_66-b17)
	# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.66-b17 mixed mode windows-amd64 compressed oops)
	# Problematic frame:
	# C  [msvcr100.dll+0x3c220]
	#
	# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
	#
	# An error report file with more information is saved as:
	# D:\Software\eclipse-jee-juno-SR2-win32-x86_64\Workspace\IntelR200\hs_err_pid6160.log
	#
	# If you would like to submit a bug report, please visit:
	#   http://bugreport.java.com/bugreport/crash.jsp
	#
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm using C# so it may be different to the Java implementation but I do it this way (working with both F200 & R200):
var mwidth = mappedImage.info.width;
var mheight = mappedImage.info.height;
mappedPixels = mdata.ToShortArray(0, mwidth * mheight);
Maybe your mBuff variable is wrong?
 
					
				
				
			
		
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page