converting PXCImage to Mat format





 


   Greeting,


 


 I am working on obstacle detection using realsense, R200 camera and I am having a difficulty of converting PXCImage to a Mat format (OpenCV for further image processing). I used IplImage as an intermediate but i am loosing a lot of information when converting it to mat. i saw this effect (discontinuity on depth image) when i extracted the edge of depth image. what should i do? please anyone, I need help on this issue.


 


 thank you in advance
Have a look at this video that explains how to get the raw data from an F200, and convert the images into an OpenCV Mat object:


<https://www.youtube.com/watch?v=wIkIdjN6Oyw>


And here is the conversion shown in the video:



```
cv::Mat PXCImage2CVMat(PXCImage *pxcImage, PXCImage::PixelFormat format)
{
    PXCImage::ImageData data;
    pxcImage->AcquireAccess(PXCImage::ACCESS\_READ, format, &data);

    int width = pxcImage->QueryInfo().width;
    int height = pxcImage->QueryInfo().height;

    if(!format)
        format = pxcImage->QueryInfo().format;

    int type;
    if(format == PXCImage::PIXEL\_FORMAT\_Y8)
        type = CV\_8UC1;
    else if(format == PXCImage::PIXEL\_FORMAT\_RGB24)
        type = CV\_8UC3;
    else if(format == PXCImage::PIXEL\_FORMAT\_DEPTH\_F32)
        type = CV\_32FC1;

    cv::Mat ocvImage = cv::Mat(cv::Size(width, height), type, data.planes[0]);

    pxcImage->ReleaseAccess(&data);
    return ocvImage;
}
```

 




[View solution in original post](/t5/Software-Archive/converting-PXCImage-to-Mat-format/m-p/1090766#M65212)
I'm assuming that your provided image is the actual size that you are dealing with. It appears that the resolution of the image is quite low so that it will suffer pixelization with any enlargement at all. Fidelity of a raster image is always dependent on how much effective resolution (what its resolution is at the size it is to be used) the image has. So a 72 ppi image will only have 36 ppi if it is enlarged to 200%. Use File>Export As and export at 300 ppi or higher and see if that makes a dif... this is my first time digging into the processing source code so i hope this helps. the problem you are facing is more of a java problem though than a processing one.

by extending pgraphics you would have to replace the renderer implementations to inherit from your subclass(tgraphics) and not pgrap… Then it shouldn’t be a problem to set the InDesign Transparency Blend Space to RGB. Also when you export for screens don’t use a PDF/X preset, they are designed for press output. Use the Export Output tab to convert the ID doc to sRGB.


 


CMYK Blend Space:


 


![Screen Shot 10.png](https://community.adobe.com/t5/image/serverpage/image-id/150842iD57F1CC3C78841C4/image-size/large?v=1.0&px=999 "Screen Shot 10.png")


 


RGB Blend Space:


![Screen Shot 11.png](https://community.adobe.com/t5/image/serverpage/image-id/150843i56A067219BAD62EE/image-size/large?v=1.0&px=999 "Screen Shot 11.png") you could download each fex submission to a separate folder and then create links (hard or symbolic) to the matlab files (m, p, mex, etc.) in a single common folder for all fex submissions. this might cause problems with name collisions to common files (e.g., contents.m). Hi, I had a play around with it and managed to resolve it. When you download a picture from stock some are downloaded as a vector file. If you click on settings you can change it to download as a jpeg file.  This worked for me.  Cheers Try a soft reset first, if that doesn't correct it try a hard reset. BE SURE and Save Data before th eHard Reset, it clears all waypoints and such.  
  
 Soft Reset Hard Reset  
  




LCX 15mt Reset 
1. Turn unit OFF
1. Turn unit OFF

2. Press and hold the PAGES key
2. Press and hold the ZIN&ZOUT Keys at the same time

3. Press and hold the PWR key
3. Press and hold the PWR key

4. Release both buttons when the USA map appears
4. Release both buttons when the USA map appears After 5 hours of learning I have compiled these:


Mindset



1. **Make sure the placed image ratio is good** to make it more realistic. This can be attained by checking with the other object in the output picture, like trees, or other peoples' height. You are not going to place human with the size much smaller than the other human at the same picture. Similarly, you also must not place a person with the height higher than a tree.
2. **Get the right perspective**. Sometimes, when an object is placed in an odd perspective, image is going to look very bold that it has been photoshopped or copy pasted.
3. **Lighting**. It is important to pay attention to light source, like the sun, and make sure our object is appropriate with output background light source. This can be done by adjusting the lighting of object and adding shadow with referencing other shadow in output image.


Tools (to make edges more realistic)



1. **Layer masking.** If moving people, hair can look awful if just plainly moved. Masking allows us to further tweak our selection.
2. **Refine edge.** *This tool allows you to control many aspect of the edge of your selection* (desired object to move), like Edge Detection (brushing the edges of object and let photoshop do its job, usually around dog fur), Feather (Soften the area of selection), Smooth (reduce pointiness of your selection), Contrast (somewhat opposite of smooth), and Shift Edge (moving feather far or nearer the selection, usually to remove excess background color near the edges). *REFERENCE: <https://www.youtube.com/watch?v=5lDr2Nd8Yl4>*
3. **Layer Matting**. Inside we have many sub-tools to work on, like Color Decontamination (spread out soft mask around the edge, usually for hair to catch other hair that accidentally masked or can be used similarly to Shift Edge), Remove Matte (soften edge of sharp graphic or pixalated, raster look). *REFERENCE: <https://www.youtube.com/watch?v=N6K_htNQPPA>*
4. **Image Calculation**. By playing with the blending, we can make the background darker; thus, helping us making mask. *REFERENCE: <https://www.youtube.com/watch?v=0zf-H9RoCNk>* Hi Lynnhoustonbell,

We apologize for the delay in response.

The pdf file that you are converting a word will not give the accurate result or wont be editable, if-

1- The pdf file you have converted to word might be a scanned pdf which doesn't contain real text.

If it contains text also, then you can click on "**Enable all features**" option that appears on the top right side of the word document.

2- If your original pdf has images rather than text, then after converting to word document the images wont be editable.

3- The source of the pdf was a different format or created using any other application, which is causing trouble after conversion because of the presets used to create it.

Regards,

Akanchha please refer to following posts:

<https://devtalk.nvidia.com/default/topic/1021886/jetson-tx2/pcie-usb-lane-mapping/post/5203705/#5203705>
<https://devtalk.nvidia.com/default/topic/1013740/jetson-tx2/tx2-config-3-for-usb-lane-mapping/post/5207826/#5207826>
[https://devtalk.nvidia.com/default/topic/102…](https://devtalk.nvidia.com/default/topic/1023160/jetson-tx2/tx2-using-pcix1-instead-of-usb3-default-config-1-/post/5207785/#5207785) turns out what solved the problem was setting the cullpadding property using the setcullpadding() property.

per [the docs](https://photonstorm.github.io/phaser3-docs/phaser.tilemaps.tilemaplayer.html):

when a camera culls the tiles in this layer it does so using its view into the world, building up a rectangle inside which the tiles must exist or they will be culled. sometim…