postprocessing – Refocusing the images of the light field via the Fourier slice photography theorem

I am trying to refocus the images of a microlens array light field using Ren Ng's Four Ng slice photography theorem found in his thesis chapter 5, equation 5.7, which is available at https : // -thesis% 20Lytro.pdf

In terms, the Fourier slice photography theorem means that a photograph is the inverse 2D Fourier transform of a dilated 2D slice in the 4D Fourier transform of the light field.

Part of my confusion comes from the notation and its application in python to an acquired light field image. To start with, I understand what the Fourier transform is but when Ng says Fourier transform of the light field 4D, I don't know how to interpret it. Currently, my light field is a NumPy array such that my values ​​u = i, v = j index different under-aperture images where each pixel of the sub-aperture image has an x ​​and y coordinate, which So gives me a 4D light field array.

        lf_img = cv2.imread(lf_img, -cv2.IMREAD_ANYDEPTH)
        row_lens = lf_img.shape(0)/14 #14 is pixels under a microlens in this direction
        col_lens = lf_img.shape(1)/14 # 14 is pixels under a microlens in this direction
        vp_imgs = np.zeros((14,14,int(row_lens),int(col_lens),3))
        for i in range(14):
            for j in range(14):
                vp_imgs(i, j, :, :, :) = lf_img(i::14, j::14, 0:3) ##U,V,X,Y,(RGB)

Then I see images like this in Ng's thesis where it seems to me that he just took the 2D Fourier transform of each lenslet and to arrange them in a grid. So I don't really know how to interpret this Fourier 4D transform and how the splitting is done. Thank you!

Example of the type of light field image I work with:

media – Cannot add images to content "Image field is required"

When developing a new site with Drupal 8, I was trying to add an image to a custom block. In the editor, I clicked on the image icon and got a dialog to upload an image. After specifying a file (making sure it was the size of the download file), I received a strange error "Image field is required".

I took the error message literally and created a new custom block type, adding an "image" type field to the block. So now in the form I have a body and an Image field. If I try to download using the "image" field under the body, I get the same error "The image field is required".

Error message when trying to insert an image

I tried again using the Content / Media tab, to add an image file and get the same error:

Error downloading media

(I also notice that there is a "Caption" checkbox but no field for entering a caption. I guess I will have a text field once the image is uploaded.)

Drupal 8.8, all up to date.

postgresql – Is it a "bad idea" to have 2 linked tables, each having a field (named differently) whose value will always be the same in both?

Imagine i have the following database structure

TableUser --> userId (int) , weeksToLive (int)
TableCalendar --> calendarId (int) , numberOfCells (int) , userId (int) *(FK->TableUser)

The point is that it will always happen

numberOfCells(int)(TableCalendar) === weeksToLive(int)(TableCalendar)

So I am wondering if it is dangerous or something to have a field which will always be equal to the same value, which can always be obtained anyway using a different select statement

site column – Creation of a "Subject" field, with a different internal name

Technically we can have two columns with the same display name but a different internal name, but when we try to create this from the SharePoint user interface, that doesn't allow it, it generates the 39; error mentioned above ("The column name you entered is already used or reserved").

However, it allows the coding approach to be used as Visual Studio, PowerShell and PnP PowerShell So we can create the two site columns with the same display name using one of the coding techniques not from the user interface.

PnP PowerShell to create a site column (text type)

#Config Variables
$SiteURL = ""
$ColumnTitle = "Project Name"
$ColumnInternalName = "ProjectName"
$ColumnGroup="Crescent Site Columns"
$ColumnType = "Text"

#Get Credentials to connect
$Cred = Get-Credential

Try {
    #Connect to PNP Online
    Connect-PnPOnline -Url $SiteURL -Credentials $Cred

    #Create Site Column
    Add-PnPField -DisplayName $ColumnTitle -InternalName $ColumnInternalName -Group $ColumnGroup -Type $ColumnType
catch {
    write-host "Error: $($_.Exception.Message)" -foregroundcolor Red

Using PowerShell, create a site column (text type)

#Load SharePoint CSOM Assemblies
Add-Type -Path "C:Program FilesCommon FilesMicrosoft SharedWeb Server Extensions16ISAPIMicrosoft.SharePoint.Client.dll"
Add-Type -Path "C:Program FilesCommon FilesMicrosoft SharedWeb Server Extensions16ISAPIMicrosoft.SharePoint.Client.Runtime.dll"

$IsRequired = "TRUE"
$ColumnGroup="Crescent Projects"

Try {
    $Cred= Get-Credential
    $Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Cred.Username, $Cred.Password)

    #Setup the context
    $Ctx = New-Object Microsoft.SharePoint.Client.ClientContext($SiteURL)
    $Ctx.Credentials = $Credentials

    #Get all Site columns from the site
    $Fields = $Ctx.web.Fields

    #Check if the column name exists
    $NewField = $Fields | where {$_.Title -eq $ColumnName}
    if($NewField -ne $NULL)  
        Write-host "Site Column $ColumnName already exists!" -f Yellow
        #Define XML for Field Schema
        $FieldSchema = ""
        $NewField = $Fields.AddFieldAsXml($FieldSchema,$True,(Microsoft.SharePoint.Client.AddFieldOptions)::AddFieldToDefaultView)

        Write-host "Site Column Created Successfully!" -ForegroundColor Green  
Catch {
    write-host -f Red "Error Creating Site Column!" $_.Exception.Message

Source of the above script:

SharePoint Online: create a site column using PowerShell

8 – Pre-fill an entity reference field (media image) when creating a node

I'm trying to open a node creation form (for example, /node/add/article) and to have a prefilled entity reference field.

My field (field_image) is a Entity reference has a Media Of type Picture and the form uses the Multimedia library widget.

I basically tried to do it by implementing hook_form_alter in a custom module but nothing that I tried worked. I have seen solutions like this. It works with other types of fields that I have tried. For example:

// Pre-populate Entity Reference field to taxonomy term

$term = Drupal::entityTypeManager()->getStorage('taxonomy_term')->load(13);
$form('field_category')('widget')(0)('target_id')('#default_value') = $term;

The above works very well. But this is not the case below.

// Pre-populate Entity Reference field to Media Image

$media = Drupal::entityTypeManager()->getStorage('media')->load(38);
$form('field_image')('widget')(0)('target_id')('#default_value') = $media;

I also tried trying to provide only the media ID instead of the entity, but it didn't work.

I also tried the Prepopulate module but I couldn't get it to work either, although it works with all the other types of fields that I have tried.

Anyone know if this is possible and how?

Edit: maybe I should mention that I am not looking for a solution to define a default value for this field. The referenced entity must be defined dynamically

For reference, here is my full code:

 * Implements hook_form_alter().
function siteconfig_form_alter(&$form, FormStateInterface $form_state, $form_id) {

  if ($form_id == 'node_article_form') {

    // This works
    $term = Drupal::entityTypeManager()->getStorage('taxonomy_term')->load(13);
    $form('field_category')('widget')(0)('target_id')('#default_value') = $term;

    // This doesn't work
    $media = Drupal::entityTypeManager()->getStorage('media')->load(38);
    $form('field_image')('widget')(0)('target_id')('#default_value') = $media;

javascript – How do I store the information obtained in a form field to place it on another page in a welcome sentence?

Questions and answers

Questions and answers

Insira seu nome no campo abaixo para começar a jogar

What is the terminology, the name of the user interface for the read-only field value?

what is the terminology of these user interface elements in this screenshot?

  • John Doe
  • Principal:

These user interface elements are read-only field values, these values ​​can be changed by Update ((Modifier link button.

I'm looking for the right terminology to use it in the search engine to find examples of UX design.

enter description of image here

mobile – Advanced application filter filled with text field

This is my first question in this forum so I apologize in advance if the question is asked incorrectly. I need to create a fairly advanced filter for my application which is mostly filled with text fields instead of buttons, sliders and drop down fields. I spent weeks looking for a UX idea for a similar filter, but I couldn't find one. Basically, it's a wheel filter (for a better understanding) where I need to filter its diameter, its radius of angle, its length and other geometric properties and ux is very crucial for the application. Each property needs filtering in the exact range and quantity. The sizes of each property range from 0.1 to 500 in 0.01 steps, so do prefabricated cursor or rage buttons, like d & # 39; other applications, would be overkill. I have already tried 3 approaches where the first was a technical drawing, but I gave up because I just couldn't keep all the annotations on the mobile screen, then the list stretchy


enter description of image here


enter description of image here

And the latest menu style


enter description of image here


enter description of image here

Either way, it doesn't look right or the UX is just awful. I can't say more. Please, any help in this regard will be greatly appreciated.

Use WPbakery for your own custom field

Anyone know how to activate WPbakery for my own custom field? Currently, it's just a plain