PIX Call that Previously Succeeded Failed During Playback error on IASetVertexBuffers() - directx

I'm trying to debug the shaders in a SlimDX DirectX11 game I've been coding for a while. The code runs fine and executes without a hitch (albeit seemingly ignoring my textures) and when I run an experiment to capture a single frame inside PIX it executes fine, however if I try to access either the Render or Mesh tabs in PIX for my captured frame I get the following error:
A call that previously succeeded failed during playback:
EID: 96
Call: ID3D11DeviceContext::IASetVertexBuffers()
HRESULT: E_FAIL
The EID is one that occurs just before the frame I've captured (my frame starts at EID 108) so I can't see where it's failing.
I decided to run a full stream of frames to see if that would show me the error. This time I got something useful.
A call that previously succeeded failed during playback:
EID: 15
Call: IDXGISwapChain::GetParent()
HRESULT:E_FAIL
And the event log that caused it:
Frame 1 EID
Call 4 D3D11CreateDeviceAndSwapChain(NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, 0, NULL, 0, 7, 0x0016EE7C, 0x0016EE74 --> 0x07145B60, 0x0016EE6C --> 0x071453B0, NULL, 0x0016EE70 --> 0x071BA108)
Call 5 CreateObject(D3D11 Device, 0x071453B0)
Call 6 CreateObject(DXGI Factory, 0x07145A58)
Call 7 CreateObject(DXGI Adapter, 0x07145AA8)
Call 8 CreateObject(DXGI Device, 0x07145B00)
Call 9 CreateObject(DXGI Swap Chain, 0x07145B60)
Call 10 CreateObject(DXGI Surface, 0x07145BF8)
Call 11 CreateObject(D3D11 Texture2D, 0x07145C58)
Call 12 CreateObject(D3D11 Device Context, 0x071BA108)
Call 13 <0x071BA108> ID3D11DeviceContext::Release()
Call 14 <0x071453B0> ID3D11Device::GetImmediateContext(0x071BA108 --> 0x6C54A8D8)
Call 15 <0x07145B60> IDXGISwapChain::GetParent(IID_IDXGIFactory, 0x0016EF40 --> 0x07145A58)
Call 16 <0x07145A58> IDXGIFactory::MakeWindowAssociation(0x00020574, 2)
Call 17 <0x07145A58> IDXGIFactory::Release()
Call 18 <0x071BA108> ID3D11DeviceContext::RSSetViewports(1, 0x0016EF28)
Call 19 <0x071453B0> ID3D11Device::CreateTexture2D(0x0016EDCC, NULL, 0x0016EDC8 --> 0x071460F8)
Call 20 CreateObject(D3D11 Texture2D, 0x071460F8)
Call 21 <0x071453B0> ID3D11Device::CreateDepthStencilView(0x071460F8, 0x0016EE2C, 0x0016EE4C --> 0x07146198)
Call 22 CreateObject(D3D11 Depth-Stencil View, 0x07146198)
Call 23 <0x071460F8> ID3D11Texture2D::Release()
Call 24 <0x07145B60> IDXGISwapChain::GetBuffer(0, IID_ID3D11Texture2D, 0x0016EF3C --> 0x07145C58)
Call 25 <0x071453B0> ID3D11Device::CreateRenderTargetView(0x07145C58, NULL, 0x0016EF40 --> 0x071461F0)
Call 26 CreateObject(D3D11 Render Target View, 0x071461F0)
Call 27 <0x07145C58> ID3D11Texture2D::Release()
Call 28 <0x071BA108> ID3D11DeviceContext::OMSetRenderTargets(1, 0x0016EF54 --> { 0x071461F0 }, 0x07146198)
Call 29 <0x071453B0> ID3D11Device::CreateVertexShader(0x00A90FA0, 1116, NULL, 0x0016EF24 --> 0x071462F8)
Call 30 CreateObject(D3D11 Vertex Shader, 0x071462F8)
Call 31 <0x071453B0> ID3D11Device::CreatePixelShader(0x00A8FC00, 1160, NULL, 0x0016EF24 --> 0x071467B8)
Call 32 CreateObject(D3D11 Pixel Shader, 0x071467B8)
Call 33 <0x071453B0> ID3D11Device::CreateVertexShader(0x00A92348, 568, NULL, 0x0016EF24 --> 0x07146CA0)
Call 34 CreateObject(D3D11 Vertex Shader, 0x07146CA0)
Call 35 <0x071453B0> ID3D11Device::CreatePixelShader(0x00ABE3F8, 8232, NULL, 0x0016EF24 --> 0x07146F38)
Call 36 CreateObject(D3D11 Pixel Shader, 0x07146F38)
Call 37 <0x071453B0> ID3D11Device::CreateVertexShader(0x00A92548, 568, NULL, 0x0016EF24 --> 0x07146F90)
Call 38 CreateObject(D3D11 Vertex Shader, 0x07146F90)
Call 39 <0x071453B0> ID3D11Device::CreatePixelShader(0x00B117C0, 1756, NULL, 0x0016EF24 --> 0x07139848)
Call 40 CreateObject(D3D11 Pixel Shader, 0x07139848)
Call 41 <0x071453B0> ID3D11Device::CreateVertexShader(0x00A925D8, 568, NULL, 0x0016EF24 --> 0x071454A0)
Call 42 CreateObject(D3D11 Vertex Shader, 0x071454A0)
Call 43 <0x071453B0> ID3D11Device::CreatePixelShader(0x00ABE018, 7196, NULL, 0x0016EF24 --> 0x07145738)
Call 44 CreateObject(D3D11 Pixel Shader, 0x07145738)
Call 45 <0x071453B0> ID3D11Device::AddRef()
Call 46 <0x071453B0> ID3D11Device::CreateTexture2D(0x0016EE08, 0x00A90768, 0x0016EE04 --> 0x07145790)
Call 47 CreateObject(D3D11 Texture2D, 0x07145790)
Call 48 <0x07145790> ID3D11Texture2D::GetType(0x0016EDB4)
Call 49 <0x07145790> ID3D11Texture2D::QueryInterface(IID_ID3D11Texture2D, 0x0016EDD8 --> 0x07145790)
Call 50 <0x07145790> ID3D11Texture2D::GetDesc(0x0016EE24)
Call 51 <0x071453B0> ID3D11Device::CreateShaderResourceView(0x07145790, 0x0016EDBC, 0x0016EF44 --> 0x07145830)
Call 52 CreateObject(D3D11 Shader Resource View, 0x07145830)
Call 53 <0x07145790> ID3D11Texture2D::Release()
Call 54 <0x07145790> ID3D11Texture2D::Release()
Call 55 <0x071453B0> ID3D11Device::Release()
Call 56 <0x071453B0> ID3D11Device::AddRef()
Call 57 <0x071453B0> ID3D11Device::CreateTexture2D(0x0016EE08, 0x00A8F6A0, 0x0016EE04 --> 0x0713A990)
Call 58 CreateObject(D3D11 Texture2D, 0x0713A990)
Call 59 <0x0713A990> ID3D11Texture2D::GetType(0x0016EDB4)
Call 60 <0x0713A990> ID3D11Texture2D::QueryInterface(IID_ID3D11Texture2D, 0x0016EDD8 --> 0x0713A990)
Call 61 <0x0713A990> ID3D11Texture2D::GetDesc(0x0016EE24)
Call 62 <0x071453B0> ID3D11Device::CreateShaderResourceView(0x0713A990, 0x0016EDBC, 0x0016EF44 --> 0x071C3B98)
Call 63 CreateObject(D3D11 Shader Resource View, 0x071C3B98)
Call 64 <0x0713A990> ID3D11Texture2D::Release()
Call 65 <0x0713A990> ID3D11Texture2D::Release()
Call 66 <0x071453B0> ID3D11Device::Release()
Call 67 <0x071453B0> ID3D11Device::CreateSamplerState(0x0016EED4, 0x0016EED0 --> 0x07145938)
Call 68 CreateObject(D3D11 Sampler State, 0x07145938)
Call 69 <0x071BA108> ID3D11DeviceContext::PSSetShaderResources(0, 1, 0x0016EF38 --> { 0x07145830 })
Call 70 <0x071BA108> ID3D11DeviceContext::PSSetShaderResources(4, 1, 0x0016EF38 --> { 0x071C3B98 })
Call 71 <0x071BA108> ID3D11DeviceContext::PSSetSamplers(0, 1, 0x0016EF38 --> { 0x07145938 })
Call 72 <0x071453B0> ID3D11Device::CreateBuffer(0x0016EDF4, 0x0016EDDC, 0x0016EDF0 --> 0x0713AA30)
Call 73 CreateObject(D3D11 Buffer, 0x0713AA30)
Call 74 <0x071BA108> ID3D11DeviceContext::PSSetConstantBuffers(0, 1, 0x0016EE68 --> { 0x0713AA30 })
Call 75 <0x071453B0> ID3D11Device::CreateTexture2D(0x0016ECD0, NULL, 0x0016ECCC --> 0x0713AAB8)
Call 76 CreateObject(D3D11 Texture2D, 0x0713AAB8)
Call 77 <0x071453B0> ID3D11Device::CreateRenderTargetView(0x0713AAB8, 0x0016ED28, 0x0016ED44 --> 0x071C3BF0)
Call 78 CreateObject(D3D11 Render Target View, 0x071C3BF0)
Call 79 <0x071453B0> ID3D11Device::CreateShaderResourceView(0x0713AAB8, 0x0016ECF4, 0x0016ED14 --> 0x071C3C48)
Call 80 CreateObject(D3D11 Shader Resource View, 0x071C3C48)
Call 81 <0x071453B0> ID3D11Device::CreateTexture2D(0x0016ECD0, NULL, 0x0016ECCC --> 0x0713AB58)
Call 82 CreateObject(D3D11 Texture2D, 0x0713AB58)
Call 83 <0x071453B0> ID3D11Device::CreateRenderTargetView(0x0713AB58, 0x0016ED28, 0x0016ED44 --> 0x071C3CA0)
Call 84 CreateObject(D3D11 Render Target View, 0x071C3CA0)
Call 85 <0x071453B0> ID3D11Device::CreateShaderResourceView(0x0713AB58, 0x0016ECF4, 0x0016ED14 --> 0x071C3CF8)
Call 86 CreateObject(D3D11 Shader Resource View, 0x071C3CF8)
Call 87 <0x071453B0> ID3D11Device::CreateTexture2D(0x0016ECD0, NULL, 0x0016ECCC --> 0x0713ACA8)
Call 88 CreateObject(D3D11 Texture2D, 0x0713ACA8)
Call 89 <0x071453B0> ID3D11Device::CreateRenderTargetView(0x0713ACA8, 0x0016ED28, 0x0016ED44 --> 0x071C3D50)
Call 90 CreateObject(D3D11 Render Target View, 0x071C3D50)
Call 91 <0x071453B0> ID3D11Device::CreateShaderResourceView(0x0713ACA8, 0x0016ECF4, 0x0016ED14 --> 0x071C3DA8)
Call 92 CreateObject(D3D11 Shader Resource View, 0x071C3DA8)
Call 93 <0x071453B0> ID3D11Device::CreateTexture2D(0x0016ECD0, NULL, 0x0016ECCC --> 0x0713AD48)
Call 94 CreateObject(D3D11 Texture2D, 0x0713AD48)
Call 95 <0x071453B0> ID3D11Device::CreateRenderTargetView(0x0713AD48, 0x0016ED28, 0x0016ED44 --> 0x071C3E00)
Call 96 CreateObject(D3D11 Render Target View, 0x071C3E00)
Call 97 <0x071453B0> ID3D11Device::CreateShaderResourceView(0x0713AD48, 0x0016ECF4, 0x0016ED14 --> 0x071C3E58)
Call 98 CreateObject(D3D11 Shader Resource View, 0x071C3E58)
Call 99 <0x071453B0> ID3D11Device::CreateTexture2D(0x0016ED00, NULL, 0x0016ECFC --> 0x0713ADE8)
Call 100 CreateObject(D3D11 Texture2D, 0x0713ADE8)
Call 101 <0x071453B0> ID3D11Device::CreateRenderTargetView(0x0713ADE8, 0x0016ED58, 0x0016ED74 --> 0x071C3EB0)
Call 102 CreateObject(D3D11 Render Target View, 0x071C3EB0)
Call 103 <0x071453B0> ID3D11Device::CreateShaderResourceView(0x0713ADE8, 0x0016ED24, 0x0016ED44 --> 0x071C3F08)
Call 104 CreateObject(D3D11 Shader Resource View, 0x071C3F08)
Call 105 <0x071453B0> ID3D11Device::CreateTexture2D(0x0016ED00, NULL, 0x0016ECFC --> 0x0713AE88)
Call 106 CreateObject(D3D11 Texture2D, 0x0713AE88)
Call 107 <0x071453B0> ID3D11Device::CreateRenderTargetView(0x0713AE88, 0x0016ED58, 0x0016ED74 --> 0x071C3F60)
Call 108 CreateObject(D3D11 Render Target View, 0x071C3F60)
Call 109 <0x071453B0> ID3D11Device::CreateShaderResourceView(0x0713AE88, 0x0016ED24, 0x0016ED44 --> 0x071C3FB8)
Call 110 CreateObject(D3D11 Shader Resource View, 0x071C3FB8)
Call 111 <0x071453B0> ID3D11Device::CreateInputLayout(0x0016EC64, 3, 0x066B15E8, 152, 0x0016EC5C --> 0x0713AFD8)
Call 112 CreateObject(D3D11 Input Layout, 0x0713AFD8)
Call 113 <0x071BA108> ID3D11DeviceContext::IASetInputLayout(0x0713AFD8)
Call 114 <0x071BA108> ID3D11DeviceContext::IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST)
Call 115 <0x071453B0> ID3D11Device::CreateBuffer(0x0016EDC0, 0x0016EDA8, 0x0016EDBC --> 0x0713B0C0)
Call 116 CreateObject(D3D11 Buffer, 0x0713B0C0)
Call 117 <0x071453B0> ID3D11Device::GetImmediateContext(0x071BA108 --> 0x6C54A8D8)
Call 118 <0x071BA108> ID3D11DeviceContext::Release()
Call 119 <0x071BA108> ID3D11DeviceContext::VSSetConstantBuffers(0, 1, 0x0016EE34 --> { 0x0713B0C0 })
Call 120 <0x071453B0> ID3D11Device::GetImmediateContext(0x071BA108 --> 0x6C54A8D8)
Call 121 <0x071BA108> ID3D11DeviceContext::Release()
Call 122 <0x071BA108> ID3D11DeviceContext::UpdateSubresource(0x0713B0C0, 0, NULL, 0x066B1928, 0, 0)
Call 123 <0x071453B0> ID3D11Device::CreateBuffer(0x0016EC4C, 0x0016EC34, 0x0016EC48 --> 0x0713B148)
Call 124 CreateObject(D3D11 Buffer, 0x0713B148)
Call 125 <0x071453B0> ID3D11Device::CreateBuffer(0x0016EC4C, 0x0016EC34, 0x0016EC48 --> 0x0713B1D0)
Call 126 CreateObject(D3D11 Buffer, 0x0713B1D0)
Call 127 <0x071453B0> ID3D11Device::CreateBuffer(0x0FDCE878, 0x0FDCE860, 0x0FDCE874 --> 0x0713A120)
Call 128 CreateObject(D3D11 Buffer, 0x0713A120)
Call 129 <0x071453B0> ID3D11Device::CreateBuffer(0x0FDCE878, 0x0FDCE860, 0x0FDCE874 --> 0x0713A1A8)
Call 130 CreateObject(D3D11 Buffer, 0x0713A1A8)
Call 131 <0x071453B0> ID3D11Device::CreateBuffer(0x0FB9EFE8, 0x0FB9EFD0, 0x0FB9EFE4 --> 0x0713B258)
Call 132 CreateObject(D3D11 Buffer, 0x0713B258)
Call 133 <0x071453B0> ID3D11Device::CreateBuffer(0x0FB9EFE8, 0x0FB9EFD0, 0x0FB9EFE4 --> 0x0713B2E0)
Call 134 CreateObject(D3D11 Buffer, 0x0713B2E0)
Call 135 <0x071453B0> ID3D11Device::CreateBuffer(0x0FDCE878, 0x0FDCE860, 0x0FDCE874 --> 0x071C65E8)
Call 136 CreateObject(D3D11 Buffer, 0x071C65E8)
Call 137 <0x071453B0> ID3D11Device::CreateBuffer(0x0FDCE878, 0x0FDCE860, 0x0FDCE874 --> 0x071C6670)
Call 138 CreateObject(D3D11 Buffer, 0x071C6670)
Call 139 <0x071453B0> ID3D11Device::CreateBuffer(0x0F49EEF8, 0x0F49EEE0, 0x0F49EEF4 --> 0x071C6710)
Call 140 CreateObject(D3D11 Buffer, 0x071C6710)
Call 141 <0x071453B0> ID3D11Device::CreateBuffer(0x0F49EEF8, 0x0F49EEE0, 0x0F49EEF4 --> 0x071C6798)
Call 142 CreateObject(D3D11 Buffer, 0x071C6798)
Call 143 <0x071453B0> ID3D11Device::CreateBuffer(0x0F7EED88, 0x0F7EED70, 0x0F7EED84 --> 0x071C6820)
Call 144 CreateObject(D3D11 Buffer, 0x071C6820)
Call 145 <0x071453B0> ID3D11Device::CreateBuffer(0x0F7EED88, 0x0F7EED70, 0x0F7EED84 --> 0x071C68A8)
Call 146 CreateObject(D3D11 Buffer, 0x071C68A8)
Call 147 <0x071453B0> ID3D11Device::CreateBuffer(0x0F7EED88, 0x0F7EED70, 0x0F7EED84 --> 0x071C6930)
Call 148 CreateObject(D3D11 Buffer, 0x071C6930)
Call 149 <0x071453B0> ID3D11Device::CreateBuffer(0x0F7EED88, 0x0F7EED70, 0x0F7EED84 --> 0x071C69B8)
Call 150 CreateObject(D3D11 Buffer, 0x071C69B8)
Call 151 <0x071453B0> ID3D11Device::CreateBuffer(0x0F63F038, 0x0F63F020, 0x0F63F034 --> 0x071C6A40)
Call 152 CreateObject(D3D11 Buffer, 0x071C6A40)
Call 153 <0x071453B0> ID3D11Device::CreateBuffer(0x0F63F038, 0x0F63F020, 0x0F63F034 --> 0x071C6AC8)
Call 154 CreateObject(D3D11 Buffer, 0x071C6AC8)
Call 155 <0x071453B0> ID3D11Device::CreateBuffer(0x0F49EEF8, 0x0F49EEE0, 0x0F49EEF4 --> 0x071C6B50)
Call 156 CreateObject(D3D11 Buffer, 0x071C6B50)
Call 157 <0x071453B0> ID3D11Device::CreateBuffer(0x0F49EEF8, 0x0F49EEE0, 0x0F49EEF4 --> 0x071C6BD8)
Call 158 CreateObject(D3D11 Buffer, 0x071C6BD8)
Call 159 <0x071453B0> ID3D11Device::CreateBuffer(0x0F63F038, 0x0F63F020, 0x0F63F034 --> 0x071C6C60)
Call 160 CreateObject(D3D11 Buffer, 0x071C6C60)
Call 161 <0x071453B0> ID3D11Device::CreateBuffer(0x0F63F038, 0x0F63F020, 0x0F63F034 --> 0x071C6CE8)
Call 162 CreateObject(D3D11 Buffer, 0x071C6CE8)
Call 163 <0x071453B0> ID3D11Device::CreateBuffer(0x0F7EED88, 0x0F7EED70, 0x0F7EED84 --> 0x071C6D70)
Call 164 CreateObject(D3D11 Buffer, 0x071C6D70)
Call 165 <0x071453B0> ID3D11Device::CreateBuffer(0x0F7EED88, 0x0F7EED70, 0x0F7EED84 --> 0x071C6DF8)
Call 166 CreateObject(D3D11 Buffer, 0x071C6DF8)
Call 167 <0x071453B0> ID3D11Device::CreateBuffer(0x0FB9EFE8, 0x0FB9EFD0, 0x0FB9EFE4 --> 0x071C6E80)
Call 168 CreateObject(D3D11 Buffer, 0x071C6E80)
Call 169 <0x071453B0> ID3D11Device::CreateBuffer(0x0FB9EFE8, 0x0FB9EFD0, 0x0FB9EFE4 --> 0x071C6F08)
Call 170 CreateObject(D3D11 Buffer, 0x071C6F08)
Call 171 <0x071BA108> ID3D11DeviceContext::ClearRenderTargetView(0x071461F0, 0x0016EE5C)
Call 172 <0x071BA108> ID3D11DeviceContext::ClearDepthStencilView(0x07146198, 1, 1.000f, 0)
Call 173 <0x071453B0> ID3D11Device::CreateBuffer(0x0016EE04, 0x0016EDEC, 0x0016EE00 --> 0x071C6F90)
Call 174 CreateObject(D3D11 Buffer, 0x071C6F90)
Call 175 <0x071BA108> ID3D11DeviceContext::PSSetConstantBuffers(0, 1, 0x0016EE78 --> { 0x071C6F90 })
Call 176 <0x071453B0> ID3D11Device::GetImmediateContext(0x071BA108 --> 0x6C54A8D8)
Call 177 <0x071BA108> ID3D11DeviceContext::Release()
Call 178 <0x071BA108> ID3D11DeviceContext::UpdateSubresource(0x0713B0C0, 0, NULL, 0x066B1928, 0, 0)
Call 179 <0x071BA108> ID3D11DeviceContext::VSSetShader(0x071462F8, NULL, 0)
Call 180 <0x071BA108> ID3D11DeviceContext::PSSetShader(0x071467B8, NULL, 0)
Call 181 <0x071453B0> ID3D11Device::CreateInputLayout(0x0016E9C4, 3, 0x066B15E8, 152, 0x0016E9BC --> 0x0713A230)
Call 182 CreateObject(D3D11 Input Layout, 0x0713A230)
Call 183 <0x071BA108> ID3D11DeviceContext::IASetInputLayout(0x0713A230)
Call 184 <0x071BA108> ID3D11DeviceContext::IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST)
Call 185 <0x071453B0> ID3D11Device::GetImmediateContext(0x071BA108 --> 0x6C54A8D8)
Call 186 <0x071BA108> ID3D11DeviceContext::Release()
Call 187 <0x071BA108> ID3D11DeviceContext::VSSetConstantBuffers(0, 1, 0x0016EE08 --> { 0x0713B0C0 })
Call 188 <0x071BA108> ID3D11DeviceContext::PSSetShaderResources(2, 1, 0x0016EE20 --> { NULL })
Call 189 <0x071BA108> ID3D11DeviceContext::PSSetShaderResources(3, 1, 0x0016EE20 --> { NULL })
Call 190 <0x071BA108> ID3D11DeviceContext::PSSetShaderResources(5, 1, 0x0016EE20 --> { NULL })
Call 191 <0x071BA108> ID3D11DeviceContext::PSSetShaderResources(6, 1, 0x0016EE20 --> { NULL })
Call 192 <0x071BA108> ID3D11DeviceContext::OMSetRenderTargets(4, 0x0016EDE8 --> { 0x071C3BF0, 0x071C3CA0, 0x071C3D50, 0x071C3E00 }, 0x07146198)
Call 193 <0x071BA108> ID3D11DeviceContext::ClearRenderTargetView(0x071C3BF0, 0x0016EDD0)
Call 194 <0x071BA108> ID3D11DeviceContext::ClearRenderTargetView(0x071C3CA0, 0x0016EDD0)
Call 195 <0x071BA108> ID3D11DeviceContext::ClearRenderTargetView(0x071C3D50, 0x0016EDD0)
Call 196 <0x071BA108> ID3D11DeviceContext::ClearRenderTargetView(0x071C3E00, 0x0016EDD0)
Call 197 <0x071BA108> ID3D11DeviceContext::ClearDepthStencilView(0x07146198, 1, 1.000f, 0)
Call 198 <0x071453B0> ID3D11Device::CreateBuffer(0x0F49EEF8, 0x0F49EEE0, 0x0F49EEF4 --> 0x071C7018)
Call 199 CreateObject(D3D11 Buffer, 0x071C7018)
Call 200 <0x071453B0> ID3D11Device::CreateBuffer(0x0F49EEF8, 0x0F49EEE0, 0x0F49EEF4 --> 0x071C70A0)
Call 201 CreateObject(D3D11 Buffer, 0x071C70A0)
Call 202 <0x071453B0> ID3D11Device::CreateBuffer(0x0FDCE878, 0x0FDCE860, 0x0FDCE874 --> 0x071C7128)
Call 203 CreateObject(D3D11 Buffer, 0x071C7128)
Call 204 <0x071453B0> ID3D11Device::CreateBuffer(0x0FDCE878, 0x0FDCE860, 0x0FDCE874 --> 0x071C71B0)
Call 205 CreateObject(D3D11 Buffer, 0x071C71B0)
Call 206 <0x071453B0> ID3D11Device::CreateBuffer(0x0F63F038, 0x0F63F020, 0x0F63F034 --> 0x071C7238)
Call 207 CreateObject(D3D11 Buffer, 0x071C7238)
Call 208 <0x071453B0> ID3D11Device::CreateBuffer(0x0F63F038, 0x0F63F020, 0x0F63F034 --> 0x071C72C0)
Call 209 CreateObject(D3D11 Buffer, 0x071C72C0)
Call 210 <0x071453B0> ID3D11Device::CreateBuffer(0x0FA3EAB8, 0x0FA3EAA0, 0x0FA3EAB4 --> 0x071C7348)
Call 211 CreateObject(D3D11 Buffer, 0x071C7348)
Call 212 <0x071453B0> ID3D11Device::CreateBuffer(0x0FA3EAB8, 0x0FA3EAA0, 0x0FA3EAB4 --> 0x071C73D0)
Call 213 CreateObject(D3D11 Buffer, 0x071C73D0)
Call 214 <0x071BA108> ID3D11DeviceContext::IASetVertexBuffers(0, 1, 0x0016ED04 --> { 0x0713A120 }, 0x0016ED08, 0x0016ED0C)
Call 215 <0x071BA108> ID3D11DeviceContext::IASetIndexBuffer(0x0713A1A8, DXGI_FORMAT_R16_UINT, 0)
Call 216 <0x071BA108> ID3D11DeviceContext::DrawIndexed(924, 0, 0)
Call 217 <0x071BA108> ID3D11DeviceContext::IASetVertexBuffers(0, 1, 0x0016ED04 --> { 0x0713B258 }, 0x0016ED08, 0x0016ED0C)
Call 218 <0x071BA108> ID3D11DeviceContext::IASetIndexBuffer(0x0713B2E0, DXGI_FORMAT_R16_UINT, 0)
Call 219 <0x071BA108> ID3D11DeviceContext::DrawIndexed(13692, 0, 0)
Call 220 <0x071BA108> ID3D11DeviceContext::IASetVertexBuffers(0, 1, 0x0016ED04 --> { 0x071C65E8 }, 0x0016ED08, 0x0016ED0C)
Call 221 <0x071BA108> ID3D11DeviceContext::IASetIndexBuffer(0x071C6670, DXGI_FORMAT_R16_UINT, 0)
Call 222 <0x071BA108> ID3D11DeviceContext::DrawIndexed(4044, 0, 0)
Call 223 <0x071BA108> ID3D11DeviceContext::IASetVertexBuffers(0, 1, 0x0016ED04 --> { 0x071C6710 }, 0x0016ED08, 0x0016ED0C)
Call 224 <0x071BA108> ID3D11DeviceContext::IASetIndexBuffer(0x071C6798, DXGI_FORMAT_R16_UINT, 0)
Call 225 <0x071BA108> ID3D11DeviceContext::DrawIndexed(28260, 0, 0)
Call 226 <0x071BA108> ID3D11DeviceContext::IASetVertexBuffers(0, 1, 0x0016ED04 --> { 0x071C6820 }, 0x0016ED08, 0x0016ED0C)
Call 227 <0x071BA108> ID3D11DeviceContext::IASetIndexBuffer(0x071C68A8, DXGI_FORMAT_R16_UINT, 0)
Call 228 <0x071BA108> ID3D11DeviceContext::DrawIndexed(1860, 0, 0)
Call 229 <0x071BA108> ID3D11DeviceContext::IASetVertexBuffers(0, 1, 0x0016ED04 --> { 0x071C6930 }, 0x0016ED08, 0x0016ED0C)
Call 230 <0x071BA108> ID3D11DeviceContext::IASetIndexBuffer(0x071C69B8, DXGI_FORMAT_R16_UINT, 0)
Call 231 <0x071BA108> ID3D11DeviceContext::DrawIndexed(36, 0, 0)
Call 232 <0x071BA108> ID3D11DeviceContext::IASetVertexBuffers(0, 1, 0x0016ED04 --> { 0x071C6A40 }, 0x0016ED08, 0x0016ED0C)
Call 233 <0x071BA108> ID3D11DeviceContext::IASetIndexBuffer(0x071C6AC8, DXGI_FORMAT_R16_UINT, 0)
Call 234 <0x071BA108> ID3D11DeviceContext::DrawIndexed(25584, 0, 0)
Call 235 <0x071BA108> ID3D11DeviceContext::IASetVertexBuffers(0, 1, 0x0016ED04 --> { 0x071C6C60 }, 0x0016ED08, 0x0016ED0C)
Call 236 <0x071BA108> ID3D11DeviceContext::IASetIndexBuffer(0x071C6CE8, DXGI_FORMAT_R16_UINT, 0)
Call 237 <0x071BA108> ID3D11DeviceContext::DrawIndexed(6816, 0, 0)
Call 238 <0x071BA108> ID3D11DeviceContext::IASetVertexBuffers(0, 1, 0x0016ED04 --> { 0x071C6D70 }, 0x0016ED08, 0x0016ED0C)
Call 239 <0x071BA108> ID3D11DeviceContext::IASetIndexBuffer(0x071C6DF8, DXGI_FORMAT_R16_UINT, 0)
Call 240 <0x071BA108> ID3D11DeviceContext::DrawIndexed(12528, 0, 0)
Call 241 <0x071BA108> ID3D11DeviceContext::IASetVertexBuffers(0, 1, 0x0016ED04 --> { 0x071C6E80 }, 0x0016ED08, 0x0016ED0C)
Call 242 <0x071BA108> ID3D11DeviceContext::IASetIndexBuffer(0x071C6F08, DXGI_FORMAT_R16_UINT, 0)
Call 243 <0x071BA108> ID3D11DeviceContext::DrawIndexed(3252, 0, 0)
Call 244 <0x071453B0> ID3D11Device::CreateBuffer(0x0016EBF8, 0x0016EBE0, 0x0016EBF4 --> 0x071C7458)
Call 245 CreateObject(D3D11 Buffer, 0x071C7458)
Call 246 <0x071453B0> ID3D11Device::CreateBuffer(0x0016EBF8, 0x0016EBE0, 0x0016EBF4 --> 0x071C74E0)
Call 247 CreateObject(D3D11 Buffer, 0x071C74E0)
Call 248 <0x071BA108> ID3D11DeviceContext::VSSetShader(0x07146CA0, NULL, 0)
Call 249 <0x071BA108> ID3D11DeviceContext::PSSetShader(0x07146F38, NULL, 0)
Call 250 <0x071453B0> ID3D11Device::CreateInputLayout(0x0016E958, 3, 0x066B18A8, 120, 0x0016E950 --> 0x071C4D40)
Call 251 CreateObject(D3D11 Input Layout, 0x071C4D40)
Call 252 <0x071BA108> ID3D11DeviceContext::IASetInputLayout(0x071C4D40)
Call 253 <0x071BA108> ID3D11DeviceContext::IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST)
Call 254 <0x071BA108> ID3D11DeviceContext::PSSetShaderResources(7, 1, 0x0016EDB4 --> { NULL })
Call 255 <0x071BA108> ID3D11DeviceContext::OMSetRenderTargets(1, 0x0016ED9C --> { 0x071C3EB0 }, 0x07146198)
Call 256 <0x071BA108> ID3D11DeviceContext::ClearRenderTargetView(0x071C3EB0, 0x0016ED70)
Call 257 <0x071BA108> ID3D11DeviceContext::ClearDepthStencilView(0x07146198, 1, 1.000f, 0)
Call 258 <0x071BA108> ID3D11DeviceContext::PSSetShaderResources(2, 1, 0x0016EDB4 --> { 0x071C3CF8 })
Call 259 <0x071BA108> ID3D11DeviceContext::PSSetShaderResources(3, 1, 0x0016EDB4 --> { 0x071C3DA8 })
Call 260 <0x071BA108> ID3D11DeviceContext::IASetVertexBuffers(0, 1, 0x0016EDA0 --> { 0x071C7458 }, 0x0016EDA4, 0x0016EDA8)
Call 261 <0x071BA108> ID3D11DeviceContext::IASetIndexBuffer(0x071C74E0, DXGI_FORMAT_R16_UINT, 0)
Call 262 <0x071BA108> ID3D11DeviceContext::DrawIndexed(6, 0, 0)
Call 263 <0x071C7458> ID3D11Buffer::Release()
Call 264 <0x071C74E0> ID3D11Buffer::Release()
Call 265 <0x071453B0> ID3D11Device::CreateBuffer(0x0016EBF0, 0x0016EBD8, 0x0016EBEC --> 0x071C7568)
Call 266 CreateObject(D3D11 Buffer, 0x071C7568)
Call 267 <0x071453B0> ID3D11Device::CreateBuffer(0x0016EBF0, 0x0016EBD8, 0x0016EBEC --> 0x071C75F0)
Call 268 CreateObject(D3D11 Buffer, 0x071C75F0)
Call 269 <0x071BA108> ID3D11DeviceContext::VSSetShader(0x07146F90, NULL, 0)
Call 270 <0x071BA108> ID3D11DeviceContext::PSSetShader(0x07139848, NULL, 0)
Call 271 <0x071453B0> ID3D11Device::CreateInputLayout(0x0016E950, 3, 0x065688E0, 120, 0x0016E948 --> 0x071C5600)
Call 272 CreateObject(D3D11 Input Layout, 0x071C5600)
Call 273 <0x071BA108> ID3D11DeviceContext::IASetInputLayout(0x071C5600)
Call 274 <0x071BA108> ID3D11DeviceContext::IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST)
Call 275 <0x071BA108> ID3D11DeviceContext::PSSetShaderResources(1, 1, 0x0016EDAC --> { NULL })
Call 276 <0x071BA108> ID3D11DeviceContext::OMSetRenderTargets(1, 0x0016ED94 --> { 0x071C3F60 }, 0x07146198)
Call 277 <0x071BA108> ID3D11DeviceContext::ClearRenderTargetView(0x071C3F60, 0x0016ED68)
Call 278 <0x071BA108> ID3D11DeviceContext::ClearDepthStencilView(0x07146198, 1, 1.000f, 0)
Call 279 <0x071BA108> ID3D11DeviceContext::PSSetShaderResources(5, 1, 0x0016EDAC --> { 0x071C3C48 })
Call 280 <0x071BA108> ID3D11DeviceContext::PSSetShaderResources(6, 1, 0x0016EDAC --> { 0x071C3E58 })
Call 281 <0x071BA108> ID3D11DeviceContext::PSSetShaderResources(7, 1, 0x0016EDAC --> { 0x071C3F08 })
Call 282 <0x071BA108> ID3D11DeviceContext::IASetVertexBuffers(0, 1, 0x0016ED98 --> { 0x071C7568 }, 0x0016ED9C, 0x0016EDA0)
Call 283 DestroyObject(D3D11 Buffer, 0x071C7458)
Call 284 <0x071BA108> ID3D11DeviceContext::IASetIndexBuffer(0x071C75F0, DXGI_FORMAT_R16_UINT, 0)
Call 285 DestroyObject(D3D11 Buffer, 0x071C74E0)
Call 286 <0x071BA108> ID3D11DeviceContext::DrawIndexed(6, 0, 0)
Call 287 <0x071C7568> ID3D11Buffer::Release()
Call 288 <0x071C75F0> ID3D11Buffer::Release()
Call 289 <0x071453B0> ID3D11Device::CreateBuffer(0x0016EC00, 0x0016EBE8, 0x0016EBFC --> 0x071C7678)
Call 290 CreateObject(D3D11 Buffer, 0x071C7678)
Call 291 <0x071453B0> ID3D11Device::CreateBuffer(0x0016EC00, 0x0016EBE8, 0x0016EBFC --> 0x071C7700)
Call 292 CreateObject(D3D11 Buffer, 0x071C7700)
Call 293 <0x071BA108> ID3D11DeviceContext::VSSetShader(0x071454A0, NULL, 0)
Call 294 <0x071BA108> ID3D11DeviceContext::PSSetShader(0x07145738, NULL, 0)
Call 295 <0x071453B0> ID3D11Device::CreateInputLayout(0x0016E960, 3, 0x06568960, 120, 0x0016E958 --> 0x071C56C0)
Call 296 CreateObject(D3D11 Input Layout, 0x071C56C0)
Call 297 <0x071BA108> ID3D11DeviceContext::IASetInputLayout(0x071C56C0)
Call 298 <0x071BA108> ID3D11DeviceContext::IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST)
Call 299 <0x071BA108> ID3D11DeviceContext::OMSetRenderTargets(1, 0x0016EDBC --> { 0x071461F0 }, 0x07146198)
Call 300 <0x071BA108> ID3D11DeviceContext::ClearRenderTargetView(0x071461F0, 0x0016EDA0)
Call 301 <0x071BA108> ID3D11DeviceContext::ClearDepthStencilView(0x07146198, 1, 1.000f, 0)
Call 302 <0x071BA108> ID3D11DeviceContext::PSSetShaderResources(1, 1, 0x0016EDBC --> { 0x071C3FB8 })
Call 303 <0x071BA108> ID3D11DeviceContext::IASetVertexBuffers(0, 1, 0x0016EDA8 --> { 0x071C7678 }, 0x0016EDAC, 0x0016EDB0)
Call 304 DestroyObject(D3D11 Buffer, 0x071C7568)
Call 305 <0x071BA108> ID3D11DeviceContext::IASetIndexBuffer(0x071C7700, DXGI_FORMAT_R16_UINT, 0)
Call 306 DestroyObject(D3D11 Buffer, 0x071C75F0)
Call 307 <0x071BA108> ID3D11DeviceContext::DrawIndexed(6, 0, 0)
Call 308 <0x071C7678> ID3D11Buffer::Release()
Call 309 <0x071C7700> ID3D11Buffer::Release()
Call 310 <0x07145B60> IDXGISwapChain::Present(0, 0)
Frame 311 Frame 2
There's nothing in the output log either. Has anybody encountered this before? If so how did you fix it?

Although the reply may not be needed any longer or may differ from the cause of your problem, I at least was troubled by the IASetVertexBuffers() error problem of PIX similar to it.
The cause in my case was having disposed of the buffer which remains bound as a Vertex buffer.
The error has been avoided when the original buffer was disposed of after it, after binding null to the Vertex buffer.
// Create Buffer
buffer = new SlimDX.Direct3D11.Buffer(device, stream, vertexBufferDesc);
stream.Dispose();
// Bind
device.ImmediateContext.InputAssembler.SetVertexBuffers(0, new VertexBufferBinding(buffer, stride, 0));
// Draw
effectPass.Apply(device.ImmediateContext);
device.ImmediateContext.Draw(primitiveCount, 0);
// Unbind and Dispose
device.ImmediateContext.InputAssembler.SetVertexBuffers(0, new VertexBufferBinding(null, 0, 0));
buffer.Dispose();

I encountered those errors before, whenever I was using stream output with the vertex shader (not sure if with geometry shader also). There was no fix for it.
Depending on what GPU you have, try debugging your application with AMDs GPU PerfStudio or Nvidias Parallel Nsight. Maybe it will work in them.

Related

SVG stroke gradient causes horizontal lines to display on iOS Safari

Adding a radial gradient to my SVG path seems to cause weird horizontal (anti-aliasing?) lines on some iOS devices or when you zoom in/out on an iOS device. I wasn't able to replicate it anywhere else.
Here's the (isolated) code:
<svg class="componentClass__chart-svg" width="335" height="318" viewBox="0 0 335 320" xmlns="http://www.w3.org/2000/svg">
<defs>
<radialGradient id="axesGradient" cx="50%" cy="0%" fx="50%" fy="0%" r="50%">
<stop stop-color="#FFFFFF" offset="10%"></stop>
<stop stop-color="#FFFFFF" offset="100%" stop-opacity="0.2"></stop>
</radialGradient>
</defs>
<path class="componentClass__axes" stroke-width="2" stroke="url(#axesGradient)" fill="none" d="M151 12 Q167 0 183 12 L319 108 Q335 120 329 139 L276 299 Q270 318 250 318 L85 318 Q65 318 59 299 L6 139 Q0 120 16 108 Z
M151 37 Q167 25 183 37 L293 116 Q309 128 303 147 L260 275 Q254 294 234 294 L101 294 Q81 294 75 275 L32 147 Q26 128 42 116 Z
M151 62 Q167 50 183 62 L267 124 Q283 136 277 155 L244 251 Q238 270 218 270 L117 270 Q97 270 91 251 L58 155 Q52 136 68 124 Z
M151 87 Q167 75 183 87 L241 132 Q257 144 251 163 L228 227 Q222 246 202 246 L133 246 Q113 246 107 227 L84 163 Q78 144 94 132 Z
M152 113 Q167 100 183 113 L215 139 Q231 152 224 171 L213 203 Q206 222 186 222 L149 222 Q129 222 122 203 L111 171 Q104 152 119 139 Z
" />
</svg>
And the issue:
SVG showing horizontal line
Note this doesn't happen on every iPhone or iPad, but you're usually able to replicate it when you try zooming in and out.
I was able to nail down the issue to this particular use case: as soon as you add the gradient to the stroke, it starts happening. If you change stroke="url(#axesGradient) to just stroke="#FFF", it doesn't seem to happen.
Is there any way I can optimize the SVG to prevent rendering issues?
Here's a Codepen with the exact code above.
Had the same problem, but in my case these lines appeared in any browser on IOS 16, updating to IOS 16.3 fixed it

Export datas from mongodb using mongoexport from a specific time range with query and timestamp

I'm trying to export a collection from mongodb using mongoexport. This works so far:
mongoexport.exe --db dataloggin --collection p1 --out myRecords.json
The problem is that the file is huge and I can not open it anymore (araound 20GB, 30 days, every half a second a document).
I just need the data between the 3. March and the 5 March, so I tried to select this date range with the query selector as following:
mongoexport.exe --db dataloggin --collection p1 -q='{"timestamp":{"$gte":{"$timestamp":"2016-03-3T00:00:00.000Z"}:},"timestamp":{"$lt":{"$timestamp":"2016-03-05T00:00:00.000Z"}}}' --out myRecords.json
But I get an error:
error validating settings: query '[39 123 116 105 109 101 115 116 97 109 112 58 123 36 103 116 101 58 123 36 116 105 109 101 115 116 97 109 112 58 50 48 49 54 45 48 49 45 48 49 84 48 48 58 48 48 58 48 48 46 48 48 48 90 125 58 125 44 116 105 109 101 115 116 97 109 112 58 123 36 108 116 58 123 36 116 105 109 101 115 116 97 109 112 58 50 48 49 54 45 48 49 45 48 49 84 48 48 58 48 48 58 48 48 46 48 48 48 90 125 125 125 39]' is not valid JSON: json: cannot unmarshal string into Go value of type map[string]interface {}
Someone have an idea?
Many Thanks and regards

How to overcome with this error when using Networkx's kernighan_lin_bisection

I want to use kernighan_lin_bisection from Networkx to separate a network data.
But the error below showed up and I'm stuck.
It would be highly appreciated if you could help me overcome this error.
QT-------------------------------------------------------------------------
IndexError Traceback (most recent call last)
in ()
17 for c in init_partition:
18 for n in c:
---> 19 color_map_i[n]=colors[counter]
20 counter=counter+1
21
IndexError: list assignment index out of range
UNQT---------------------------------------------------------------------------
The coding I used and data source"200224_04_act.prn" are below.
QT---------------------------------------------------
G=nx.read_edgelist("200224_04_act.prn",nodetype=int)
colors=["red","blue","green"]
pos=nx.spring_layout(G)
init_nodes=np.array_split(G.nodes(),2)
init_partition=[set(init_nodes[0]),set(init_nodes[1])]
print(init_partition)
from networkx.algorithms.community import kernighan_lin_bisection
color_map_i=["black"]*nx.number_of_nodes(G)
print(color_map_i)
counter=0
for c in init_partition:
for n in c:
color_map_i[n]=colors[counter]
counter=counter+1
print(color_map_i)
nx.draw_networkx_edges(G,pos)
nx.draw_networkx_nodes(G,pos,node_color=color_map_i)
nx.draw_networkx_labels(G,pos)
plt.axis("off")
plt.show()
lst_b=kernighan_lin_bisection(G,partition=init_partition)
color_map_b=["black"]*nx.number_of_nodes(G)
counter=0
for c in lst_b:
for n in c:
color_map_b[n]=colors[counter]
counter=counter+1
nx.draw_networkx_edges(G,pos)
nx.draw_networkx_nodes(G,pos,node_color=color_map_b)
nx.draw_networkx_labels(G,pos)
plt.axis("off")
plt.show()
UNQT--------------------------------------------------------------
"200224_04_act.prn" below.(Number of nodes is around 2000 but I made it
small due to the limit of number of character)
1 415
2 415
3 415
3 1350
4 1351
5 1352
6 383
7 993
8 1353
9 887
10 887
11 887
12 887
13 887
14 1185
15 1185
16 1185
17 1185
18 1185
19 1146
20 1146
21 1146
22 1146
21 776
23 776
24 707
25 707
26 707
27 707
28 707
29 754
21 754
30 754
31 754
32 754
33 778
34 778
35 778
36 778
37 778
38 859
39 859
40 1354
41 563
42 563
43 563
44 563
45 563
46 1209
47 1209
48 1209
49 1209
50 1209
51 715
52 715
53 715
54 715
55 715
56 1048
57 1048
58 1047
59 1047
60 1047
61 1047
62 1047
63 718
64 718
65 718
66 718
67 718
68 947
17 947
69 947
70 889
71 744
72 744
73 744
74 744
75 744
76 1137
77 1137
78 1137
79 1137
80 612
81 612
82 612
83 612
17 612
84 790
85 790
86 790
87 790
88 790
89 922
90 922
91 922
92 922
93 922
21 738
94 738
95 738
96 738
97 738
98 1355
81 807
99 807
17 807
100 725
101 725
17 725
102 725
103 725
23 1046
104 661
105 661
106 661
107 661
108 661
109 907
110 907
111 907
112 907
113 907
114 840
115 840
116 840
117 840
17 840
118 759
23 759
119 759
23 761
120 761
121 761
122 761
123 1356
124 1265
125 1265
126 1265
127 1265
128 1265
129 894
29 894
130 894
131 894
132 667
133 667
124 758
134 758
135 758
122 758
136 758
137 471
138 471
You've got
for c in init_partition:
for n in c:
color_map_i[n]=colors[counter]
counter=counter+1
It looks to me like n will loop over all of the nodes of the graph. I do not see any entries in the graph that are 0. So probably the nodes are numbered 1 to N, while color_map_i is indexed from 0 to N-1. So it would break when n=N.
A good way to hunt for bugs like this in general would be to print n right before the line giving the error. This would give a hint to what the problem is.

Why does calcHist in Opencv produce 0 array in output?

I do hist calculation using OpenCV. I have the following implementation.
//Check image
for (int i = 0; i < block.rows; i++)
{
unsigned char *ptr = block.ptr<unsigned char>(i);
for (int j = 0; j < block.cols; j++)
{
cout << (int)ptr[j] << " ";
}
cout << endl;
}
//That gave
240 130 176 129 96 122 192 127 240 123 112 122 64 121 80 118 128 129 224 119
160 138 176 132 144 128 144 132 64 128 64 126 16 128 16 129 112 126 64 127
128 128 96 133 240 124 240 132 96 126 32 124 144 128 144 129 176 128 144 124
0 136 112 136 80 131 64 131 16 132 48 131 0 128 224 129 240 126 144 129
16 132 240 138 160 132 64 134 16 131 112 129 208 126 0 128 16 126 176 122
208 139 176 133 176 135 240 138 176 136 80 131 128 133 192 132 64 129 144 132
32 136 176 138 224 139 224 136 80 127 160 135 144 132 64 131 192 131 48 126
80 144 192 138 16 136 192 138 240 135 112 135 32 133 208 132 32 130 64 130
144 141 144 135 48 139 32 135 32 134 112 134 80 130 160 126 144 131 96 128
80 144 208 139 112 141 16 137 96 138 48 134 0 136 96 137 32 135 192 130
208 143 224 140 64 140 240 132 224 132 96 133 160 133 96 134 0 129 96 131
128 148 144 140 128 139 96 139 32 136 48 135 80 132 96 137 0 133 240 140
208 136 96 144 64 137 144 135 16 135 16 132 0 134 160 136 128 134 128 132
240 147 176 144 160 138 176 144 176 139 160 143 224 135 128 137 96 139 160 136
176 139 144 133 240 142 192 139 112 133 112 135 208 131 208 132 128 135 48 133
32 150 0 144 128 139 0 141 64 142 32 136 16 137 112 136 16 137 48 133
128 143 0 141 48 141 192 135 128 144 16 138 80 136 192 134 16 134 160 131
0 144 144 148 16 143 48 136 144 140 144 138 160 136 192 137 80 138 160 136
16 142 32 141 192 140 160 135 32 136 192 135 192 135 240 135 48 138 0 143
208 142 96 149 160 146 208 146 32 138 192 141 112 136 208 138 96 142 160 137
128 145 64 142 16 136 0 137 144 132 32 136 96 138 48 136 240 131 208 130
48 142 128 143 128 143 160 149 208 140 16 142 176 137 208 136 240 138 0 143
192 146 160 141 112 144 96 143 112 135 224 140 96 135 176 135 80 135 128 135
48 144 224 147 0 139 48 139 128 142 224 143 0 144 80 140 16 139 192 140
0 146 160 143 176 138 160 146 240 135 128 136 176 137 192 134 192 136 112 136
208 147 16 143 80 149 112 146 224 134 16 145 48 141 224 138 128 137 112 135
64 146 0 140 192 140 0 143 208 140 96 138 128 137 176 138 208 138 48 135
64 148 224 142 16 140 64 143 112 137 64 141 64 143 224 135 80 138 80 138
240 143 240 142 64 145 0 142 208 142 128 139 0 136 240 141 48 138 80 137
64 147 32 148 112 145 80 140 64 143 112 144 0 139 112 137 176 136 80 143
48 148 64 146 144 142 160 139 176 140 0 140 144 139 32 138 80 137 112 139
208 145 192 145 96 148 240 145 128 139 16 141 80 142 224 137 16 144 208 140
240 142 96 139 176 148 16 139 96 143 16 141 32 139 176 141 48 134 192 141
128 147 64 145 80 150 112 140 112 143 240 142 96 143 224 139 192 143 144 137
0 148 80 145 128 142 48 146 160 140 32 141 192 139 16 136 176 138 16 143
48 149 80 143 80 144 112 144 64 144 208 143 96 142 192 142 240 138 48 138
192 143 48 149 176 145 176 142 64 142 160 139 16 138 128 139 64 139 192 138
192 147 224 144 64 143 64 148 0 144 96 143 32 147 208 142 64 141 224 137
112 146 208 144 96 141 64 142 208 141 112 138 144 138 80 135 16 140 176 140
208 146 96 144 112 148 112 146 112 147 192 148 16 141 32 143 224 137 80 140
128 149 96 146 224 144 32 141 240 144 112 136 192 141 64 139 96 135 144 138
160 144 80 149 208 146 96 145 128 142 64 142 64 147 208 141 144 141 16 141
48 145 192 145 32 140 176 142 0 143 96 136 160 139 80 136 192 138 96 138
32 151 224 152 208 143 112 142 0 142 144 145 176 145 0 139 240 141 32 139
112 142 0 139 176 136 64 140 128 140 64 135 64 139 128 140 64 137 96 138
128 150 0 153 32 146 208 140 80 149 240 141 240 136 224 140 160 140 32 146
240 141 160 142 192 144 208 138 112 141 144 138 128 138 48 135 176 140 16 135
96 150 176 148 80 142 224 142 16 148 208 140 240 136 224 141 32 140 144 137
192 139 0 144 64 142 144 143 32 139 192 138 160 139 208 137 80 140 96 134
48 148 192 146 16 149 0 141 144 137 32 140 192 142 176 138 240 140 16 138
80 146 144 142 80 143 192 137 224 141 176 140 80 139 128 138 64 135 144 134
160 146 208 143 160 143 0 145 112 140 224 144 208 142 80 144 0 138 144 142
144 143 48 139 32 141 0 147 16 140 0 143 176 140 128 133 176 139 160 134
176 150 240 145 64 146 144 142 96 138 240 141 128 141 112 140 128 137 160 135
176 140 128 139 224 144 160 138 208 138 224 135 48 139 208 132 160 137 96 134
208 143 112 148 0 141 96 143 96 136 32 143 176 138 240 139 160 141 176 141
176 148 176 142 112 140 16 143 96 136 80 139 240 139 144 138 160 139 160 137
96 145 32 151 224 142 96 143 48 143 96 141 112 135 48 141 240 136 80 138
80 145 0 140 64 141 48 144 32 141 208 137 80 136 192 134 32 135 16 137
64 147 48 148 240 143 208 139 112 140 240 138 176 141 32 144 64 138 64 139
160 142 208 141 160 142 48 140 208 138 80 136 160 137 48 141 224 137 96 134
64 149 48 147 32 142 80 148 176 142 192 142 208 138 48 139 112 136 64 139
144 144 96 143 240 140 240 138 160 140 0 140 0 135 208 133 32 134 192 132
80 143 0 145 128 140 48 143 208 141 96 143 96 139 192 138 0 139 112 140
96 144 80 140 64 144 32 141 192 137 32 138 176 137 80 137 80 138 0 136
64 147 144 145 208 140 64 138 144 145 224 137 48 140 0 140 96 139 192 134
64 141 208 143 128 144 80 135 192 135 112 139 176 135 128 139 144 135 128 134
80 145 32 146 80 142 64 143 192 143 176 140 224 142 112 141 32 139 144 141
96 141 64 141 240 143 224 136 48 142 160 132 192 136 160 136 64 137 32 134
224 147 192 144 96 145 16 140 192 142 128 138 0 141 0 145 176 136 96 140
128 146 16 143 160 139 176 141 192 138 208 137 48 141 160 129 96 137 144 134
112 145 32 146 208 135 240 139 240 137 192 142 176 132 96 138 144 131 16 140
64 143 112 141 112 142 0 140 160 141 0 135 240 136 224 141 112 137 64 134
160 144 80 143 160 145 192 141 96 135 80 140 240 134 224 138 48 137 176 137
64 140 80 138 0 138 64 136 48 136 128 133 16 133 224 132 80 135 224 133
224 142 16 146 80 145 224 137 144 138 160 138 160 132 64 137 112 133 0 135
224 140 80 141 0 138 112 135 0 132 144 136 240 131 112 137 208 133 0 135
16 143 32 139 32 142 160 138 96 133 128 136 112 132 16 136 176 133 112 136
96 141 0 138 96 133 176 136 112 133 176 136 240 126 0 131 16 127 80 130
112 142 160 138 0 136 16 140 192 132 48 138 64 136 176 135 208 130 160 140
So pixel values are there.
//Histogram calculation
int histbin = 128;//quantize
int histSize[] = { histbin };
float range[] = { 0, 255 };
const float *ranges[] = { range };
Mat hist;
int channels[] = { 0};
calcHist(&block, 1, channels, Mat(), hist, 1, histSize, ranges, true, false);
//Print output
for (int h = 0; h < histbin; h++)
{
float binVal = hist.at<float>(h);
cout << " " << binVal;
}
I have outputs as follow.
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
What is wrong with my implementation?

Convert PNG images to pixel gray-level values feature vectors

I am a newbie in MATLAB and I have a set of bmp images which I need to convert into pixel gray-level values as feature vectors of image. Can anyone suggest me the way how I can do that?
I need to use these pixel gray-level values as features and then perform operations like PCA/LDA.
I tried imread() but it returns me a matrix.. I feel feature vector will be just one row vector.
Regards,
imread() is the correct way to do it. Then just convert from a matrix into a vector. For example:
>> X = randi(255, 10)
X =
208 41 168 181 112 71 192 215 90 20
231 248 10 9 98 174 66 65 212 14
33 245 217 71 196 168 130 208 150 136
233 124 239 12 203 42 179 63 141 199
162 205 174 25 48 31 228 237 234 239
25 37 194 210 125 128 245 90 73 34
72 108 190 178 114 245 140 51 194 146
140 234 101 81 165 87 36 65 193 120
245 203 168 243 181 150 39 158 98 4
247 245 44 9 193 58 66 121 145 86
>> X(:)
ans =
208
231
33
233
162
25
72
140
245
247
...
Then you can just stack your different observations together with [] and do PCA.

Resources