Reconstruct an Image

  • Hello,


    We would like to select specific pixels (about 18k/frame) of an image for processing, and then placing them back to their original position. Currently, we have used ImageBufferMultiROI to extract the target pixels and combining them in order into a smaller image to process. After calculations, we want to map each pixel of the reduced image back into its position in the original image, creating an image with the same dimensions as the original.


    Any suggestions for how we might be able to achieve that? We were thinking about using PixelReplicator, but we need as much as 4k replications of a pixel, and the "Replicate" has to be an image which makes things complicated.


    I appreciate any help.


    Best,

    Lucy

  • Hello Lucy,


    The task of processing certain regions and then merging the results back into the original image sounds interesting.

    Reading all the ROIs by using ImageBufferMultiROI is a good choice, while each ROI image is handled one after the other.

    After calculations, we want to map each pixel of the reduced image back into its position in the original image, creating an image with the same dimensions as the original.

    A possible approach into this would be:

    Glue all result images together into a single image by using AppendImage and include/append at the end the full image out of ImageBufferMultiROI.


    To get independent pathes for ROI and Full image you can use InsertImage and RemoveImage in alternating combination.

    There will be a single result image that can be written into FrameBufferRandomRead.

    When the full image is within FrameBufferRandomRead you can use a valid addressing approach for FrameBufferRandomRead.


    This would be a sketch of the intended data flow:

    pasted-from-clipboard.png

    Here you can get VA Design roiProcessReplace.va

    It can be directly simulated :-)


    The VA design attached shows the data flow, while the resulting adressing is not fully implemented.
    An addtional idea for further work would be to use ImageBufferMultiROIdyn and feed the ROI-coordinates dynamically on basis of LUT, using the same details to get the final ReAddressing work. A simple RAMLut could keep all required adresses too.


    Best regards,